|
Nebula
|
#include <attributeregistry.h>
Static Public Member Functions | |
| template<typename TYPE> | |
| static AttributeId | Register (Util::StringAtom name, TYPE defaultValue, uint32_t flags=0) |
| register a type (templated) | |
| template<typename TYPE> | |
| static AttributeId | Register (Attribute *attribute) |
| template<typename TYPE> | |
| static bool | IsRegistered () |
| Check if a type is registered. | |
| static AttributeId | Register (Util::StringAtom name, SizeT typeSize, void const *defaultValue, uint32_t flags=0) |
| register a POD, mem-copyable type | |
| static AttributeId | GetAttributeId (Util::StringAtom name) |
| get attribute id from name | |
| static Attribute * | GetAttribute (AttributeId descriptor) |
| get attribute description by id | |
| static SizeT | TypeSize (AttributeId descriptor) |
| get type size by attribute id | |
| static uint32_t | Flags (AttributeId descriptor) |
| get flags by attribute id | |
| static void const *const | DefaultValue (AttributeId descriptor) |
| get attribute default value pointer | |
| static Util::FixedArray< Attribute * > const & | GetAllAttributes () |
| get an array of all attributes | |
Private Member Functions | |
| AttributeRegistry () | |
| ~AttributeRegistry () | |
Static Private Member Functions | |
| static AttributeRegistry * | Instance () |
| The registry's constructor is called by the Instance() method, and nobody else. | |
| static void | Destroy () |
| This static method is used to destroy the registry object and should be called right before the main function exits. | |
Private Attributes | |
| Util::FixedArray< Attribute * > | componentDescriptions |
| Util::Dictionary< Util::StringAtom, AttributeId > | registry |
Static Private Attributes | |
| static AttributeRegistry * | Singleton = 0 |
|
private |
|
private |
|
inlinestatic |
get attribute default value pointer
|
staticprivate |
This static method is used to destroy the registry object and should be called right before the main function exits.
It will make sure that no accidential memory leaks are reported by the debug heap.
|
inlinestatic |
get flags by attribute id
|
inlinestatic |
get an array of all attributes
|
inlinestatic |
get attribute description by id
|
inlinestatic |
get attribute id from name
|
staticprivate |
The registry's constructor is called by the Instance() method, and nobody else.
|
inlinestatic |
Check if a type is registered.
|
inlinestatic |
|
inlinestatic |
register a POD, mem-copyable type
|
inlinestatic |
register a type (templated)
TYPE must be trivially copyable and destructible, and also standard layout.
Essentially a POD type, but we do allow non-trivially-constructible types since components are created by copying the default value, not with constructors. The reason for this is because it allows us to do value initialization in declarations.
|
inlinestatic |
get type size by attribute id
|
private |
|
private |
|
staticprivate |