#include <registrybase.h>
A Registry manages a set of entries of the same type. E.g., all classes are registered at the registry Classes, while all data types are registered at DataTypes.
Registries are declared by the macro MAXON_REGISTRY as derived classes of Registry with the template parameter R being the derived class. For the entries all types are supported which are supported by Data.
Each registry is identified by a unique identifier.
Classes | |
class | IdIteratorBase |
class | IteratorBase |
class | IteratorTemplate |
Public Types | |
using | Dependencies = Tuple<> |
using | EntryType = T |
using | Iterator = IteratorTemplate< IteratorBase > |
using | IdIterator = IteratorTemplate< IdIteratorBase > |
Static Public Member Functions | |
static Iterator | GetEntries () |
static IdIterator | GetEntriesWithId () |
static const T * | Find (const Id &eid) |
static const T & | Get (const Id &eid) |
static Result< void > | Insert (const Id &eid, const T &object, const ModuleInfo *module) |
static Result< void > | Insert (const Id &eid, T &&object, const ModuleInfo *module) |
static Result< void > | PrivateInsert (const Id &eid, T &object, const ModuleInfo *module) |
static Result< GenericData > | Register (const Id &eid, const T &object) |
static Result< GenericData > | Register (const Id &eid, T &&object) |
static Result< GenericData > | PrivateRegister (const Id &eid, T &object) |
static Result< Bool > | Erase (const Id &eid) |
using Dependencies = Tuple<> |
using EntryType = T |
The type of entries stored at this registry.
using Iterator = IteratorTemplate<IteratorBase> |
using IdIterator = IteratorTemplate<IdIteratorBase> |
|
static |
Returns an iterator over all entries registered at this registry. Because the iterator supports the foreach-protocol, you can write
If you are also interested in the Id of the entry, you have to use the iterator returned by GetEntriesWithId().
|
static |
Returns an iterator over all entries registered at this registry. Each entry is returned as a pair of the Id and the entry itself. Because the iterator supports the foreach-protocol, you can write
|
static |
Returns a pointer to the registry entry registered at this registry under the given identifier. If no entry exists for the given identifier, nullptr is returned.
[in] | eid | Identifier within this registry. |
|
static |
Returns the entry registered at this registry under the given identifier. If no entry exists for the given identifier, a null-value reference is returned.
[in] | eid | Identifier within this registry. |
Registers an entry at this registry under the given identifier. If an entry already exists for the identifier, nothing happens, and an IllegalStateError is returned.
[in] | eid | Identifier within this registry. |
[in] | object | Value to register. |
[in] | module | The module which initiates the call. When the module is freed, the entry will be freed too. |
Registers an entry at this registry under the given identifier. If an entry already exists for the identifier, nothing happens, and an IllegalStateError is returned.
[in] | eid | Identifier within this registry. |
[in] | object | Value to register. |
[in] | module | The module which initiates the call. When the module is freed, the entry will be freed too. |
|
static |
Registers an entry at this registry under the given identifier. If an entry already exists for the identifier, nothing happens, and an IllegalStateError is returned. The entry will be removed when the lifetime of the object wrapped in the return value ends.
[in] | eid | Identifier within this registry. |
[in] | object | Value to register. |
|
static |
Registers an entry at this registry under the given identifier. If an entry already exists for the identifier, nothing happens, and an IllegalStateError is returned. The entry will be removed when the lifetime of the object wrapped in the return value ends.
[in] | eid | Identifier within this registry. |
[in] | object | Value to register. |
|
static |