![]() |
NDEVR
API Documentation
|
An optimized class for storing a reference to a variable of some type up to 8 bytes in size without ownership or allocations on the stack. More...
Public Member Functions | |
| VariableReference (const VariableReference &reference) | |
| Copy constructor. | |
| template<class t_type> | |
| constexpr | VariableReference (t_type &value) |
| Constructs a VariableReference from a typed variable, storing a pointer to the variable and populating type metadata. | |
| template<class t_object_type> | |
| void | fillInfoTable (const ObjectInfo< t_object_type > &, uint01 level) |
| Recursively populates the type info table for the referenced variable, descending into Vector sub-types as needed. | |
| template<class t_type> | |
| t_type | get () const |
| Retrieves the referenced value converted to the requested type. | |
| template<class t_type> | |
| void | get (t_type &value, uint04 level, uint04 index) const |
| Retrieves the referenced value into an output variable, using the type hierarchy level and element index. | |
| template<class t_type> | |
| void | getSingle (t_type &value, uint04 level, uint04 index) const |
| Reads a single scalar value from the referenced memory by interpreting the raw pointer according to the stored type metadata at the given hierarchy level and index. | |
| template<class t_type> | |
| constexpr | operator t_type () const |
| Implicit conversion operator. | |
| template<class t_type> | |
| constexpr bool | operator!= (const t_type &b) const |
| Inequality operator. | |
| template<class t_type> | |
| constexpr VariableReference & | operator= (const t_type &b) |
| Assignment operator. | |
| constexpr VariableReference & | operator= (const VariableReference &) |
| Copy assignment operator. | |
| template<class t_type> | |
| constexpr bool | operator== (const t_type &b) const |
| Equality operator. | |
| template<class t_type> | |
| constexpr void | set (const t_type &value) |
| Sets the referenced variable to the given value. | |
An optimized class for storing a reference to a variable of some type up to 8 bytes in size without ownership or allocations on the stack.
Definition at line 118 of file VariableReference.h.
|
inlineconstexpr |
Constructs a VariableReference from a typed variable, storing a pointer to the variable and populating type metadata.
| [in] | value | The variable to reference. |
Definition at line 150 of file VariableReference.h.
References fillInfoTable().
Referenced by VariableReference(), operator=(), and operator=().
|
inline |
Copy constructor.
Creates a VariableReference pointing to the same memory with identical type metadata.
| [in] | reference | The VariableReference to copy from. |
Definition at line 174 of file VariableReference.h.
References VariableReference().
|
inline |
Recursively populates the type info table for the referenced variable, descending into Vector sub-types as needed.
| [in] | level | The current depth in the type hierarchy. |
Definition at line 161 of file VariableReference.h.
References fillInfoTable(), and GetTypeInfo().
Referenced by VariableReference(), and fillInfoTable().
|
inline |
Retrieves the referenced value converted to the requested type.
Definition at line 242 of file VariableReference.h.
References get().
Referenced by get(), operator t_type(), operator!=(), and operator==().
|
inline |
Retrieves the referenced value into an output variable, using the type hierarchy level and element index.
| [in] | value | The output variable to populate. |
| [in] | level | The depth in the type hierarchy to read from. |
| [in] | index | The element index within the current level. |
Definition at line 255 of file VariableReference.h.
References getSingle().
|
inline |
Reads a single scalar value from the referenced memory by interpreting the raw pointer according to the stored type metadata at the given hierarchy level and index.
| [in] | value | The output variable to populate with the read value. |
| [in] | level | The depth in the type hierarchy to read from. |
| [in] | index | The element offset from the base pointer. |
Definition at line 270 of file VariableReference.h.
References assign().
Referenced by get().
|
inlineconstexpr |
Implicit conversion operator.
Retrieves the referenced value as the requested type.
Definition at line 233 of file VariableReference.h.
References get().
|
inlineconstexpr |
Inequality operator.
Compares the referenced value against the given value.
| [in] | b | The value to compare against. |
Definition at line 224 of file VariableReference.h.
References get().
|
inlineconstexpr |
Assignment operator.
Sets the referenced variable to the given value.
| [in] | b | The value to assign. |
Definition at line 195 of file VariableReference.h.
References VariableReference().
|
inlineconstexpr |
Copy assignment operator.
Does not reassign the internal pointer.
Definition at line 204 of file VariableReference.h.
References VariableReference().
|
inlineconstexpr |
Equality operator.
Compares the referenced value against the given value.
| [in] | b | The value to compare against. |
Definition at line 214 of file VariableReference.h.
References get().
|
inlineconstexpr |
Sets the referenced variable to the given value.
| [in] | value | The value to assign to the referenced variable. |
Definition at line 185 of file VariableReference.h.