template <typename _Key, typename _Meta = void>

class AbstractStorage

Defined at line 24 of file ../../src/lib/vmo_store/storage_types.h

Defines the contract of a base storage class that can be used with `VmoStore`.

`Key` is the type of key used to address VMOs in the store.

`Meta` is optional user metadata associated with the `StoredVmo`s kept by the store.

Public Methods

zx_status_t Reserve (size_t capacity)

Reserves `capacity` lots on this store.

zx_status_t Insert (Key key, StoredVmo<Meta> && vmo)

Insert `vmo` at `key`.

Must return `ZX_ERR_ALREADY_EXISTS` if `key` is already in use.

std::optional<Key> Push (StoredVmo<Meta> && vmo)

Allocates an unused key and associates `vmo` with it, returning the new key on success.

StoredVmo<Meta> * Get (const Key & key)

Get the `StoredVmo` associated with `key`. Returns `nullptr` if `key` doesn't match a stored

VMO.

std::optional<StoredVmo<Meta>> Extract (Key key)

Erases the VMO referenced by `key`.

Returns the `StoredVmo` that was previously referenced by `key`, or empty if no VMO was found

for `key`.

size_t count ()

Returns the number of registered `StoredVmo`s in this store.

void ~AbstractStorage<_Key, _Meta> ()

Defined at line 28 of file ../../src/lib/vmo_store/storage_types.h

bool is_full ()

Implement `is_full` for types that will not automatically grow so users can be notified that

the container needs to grow.

Defined at line 48 of file ../../src/lib/vmo_store/storage_types.h