class RegistrationAgent

Defined at line 83 of file ../../src/lib/vmo_store/owned_vmo_store.h

An agent which owns VMOs in an `OwnedVmoStore`.

`RegistrationAgent` serves as the registration point for VMOs stored in an `OwnedVmoStore`.

A `RegistrationAgent` provides runtime guardrails so that multiple agents can use the same

store, but they can't access each other's VMOs.

Destroying a `RegistrationAgent` without first unregistering all the VMOs that it registered is

invalid, and causes the program to crash.

Note that `RegistrationAgent` does not provide any thread-safety guarantees, users must provide

their own locking mechanisms to ensure that different `RegistrationAgent`s can't compete across

threads, taking into account the chosen `Backing` method for the `OwnedVmoStore`.

Public Methods

void RegistrationAgent (OwnedVmoStore<Backing> * store)

Creates a `RegistrationAgent` attached to `store`.

`RegistrationAgent` may not outlive `store`.

Defined at line 91 of file ../../src/lib/vmo_store/owned_vmo_store.h

void ~RegistrationAgent ()

Defined at line 93 of file ../../src/lib/vmo_store/owned_vmo_store.h

template <typename... MetaArgs>
zx::result<typename VmoStore::Key> Register (zx::vmo vmo, MetaArgs... vmo_args)

Same as `VmoStore::Register`, but the registered VMO is only accessible through this

`RegistrationAgent`.

Defined at line 103 of file ../../src/lib/vmo_store/owned_vmo_store.h

template <typename... MetaArgs>
zx_status_t RegisterWithKey (typename VmoStore::Key key, zx::vmo vmo, MetaArgs... vmo_args)

Same as `VmoStore::RegisterWithKey`, but the registered VMO is only accessible through this

`RegistrationAgent`.

Defined at line 115 of file ../../src/lib/vmo_store/owned_vmo_store.h

zx::result<zx::vmo> Unregister (typename VmoStore::Key key)

Same as `VmoStore::Unregister`, but unregistration fails with `ZX_ERR_ACCESS_DENIED` if the

VMO was not initially registered by this `RegistrationAgent`.

Defined at line 126 of file ../../src/lib/vmo_store/owned_vmo_store.h

StoredVmo * GetVmo (const typename VmoStore::Key & key)

Same as `VmoStore::GetVmo`, but only returns non-null if the VMO referenced by `key` was

originally registered by this `RegistrationAgent`.

Defined at line 140 of file ../../src/lib/vmo_store/owned_vmo_store.h

void RegistrationAgent (const RegistrationAgent & )

Defined at line 148 of file ../../src/lib/vmo_store/owned_vmo_store.h

void RegistrationAgent (RegistrationAgent && )

Defined at line 148 of file ../../src/lib/vmo_store/owned_vmo_store.h

RegistrationAgent & operator= (const RegistrationAgent & )

Defined at line 148 of file ../../src/lib/vmo_store/owned_vmo_store.h

RegistrationAgent & operator= (RegistrationAgent && )

Defined at line 148 of file ../../src/lib/vmo_store/owned_vmo_store.h