Attribute storage for structures.
More...
#include <Attributes.h>
|
template<typename T > |
void | add (T &attribute) |
| Add the given attribute to the attribute storage.
|
|
template<typename T > |
Field & | add (Field &field, T &attribute) |
| Add the given attribute to the attribute storage, with the given field as continuation parameter.
|
|
template<typename T > |
const T * | get () const |
| Retrieve an attribute of the given type from storage, if present.
|
|
Attribute storage for structures.
Provides facilities for adding and retrieving attributes from a structure.
◆ add() [1/2]
Field & Cogs::Reflection::Attributes::add |
( |
Field & |
field, |
|
|
T & |
attribute |
|
) |
| |
|
inline |
Add the given attribute to the attribute storage, with the given field as continuation parameter.
- Template Parameters
-
T | Type of the attribute to register, derived from the attribute parameter. |
- Parameters
-
field | Reference to the field the attribute is being added to. |
attribute | Reference to an attribute to add. |
- Returns
- Reference to the provided field, for continuation style setup.
◆ add() [2/2]
void Cogs::Reflection::Attributes::add |
( |
T & |
attribute | ) |
|
|
inline |
Add the given attribute to the attribute storage.
- Template Parameters
-
T | Type of the attribute to register, derived from the attribute parameter. |
- Parameters
-
attribute | Reference to an attribute to add. |
◆ get()
const T * Cogs::Reflection::Attributes::get |
( |
| ) |
const |
|
inline |
Retrieve an attribute of the given type from storage, if present.
- Template Parameters
-
T | Type of the attribute to retrieve. The type must be properly registered with the type system. |
- Returns
- A pointer to the attribute, if found, nullptr if no attribute of the given type is present.
References Cogs::T.
The documentation for this struct was generated from the following file: