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.
Definition at line 129 of file Attributes.h.
◆ add() [1/2]
template<typename T >
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.
Definition at line 155 of file Attributes.h.
◆ add() [2/2]
template<typename T >
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. |
Definition at line 139 of file Attributes.h.
◆ get()
template<typename T >
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.
Definition at line 172 of file Attributes.h.
The documentation for this struct was generated from the following file:
- D:/a/1/s/Cogs/Cogs.Foundation/Source/Reflection/Attributes.h