[reflectionSnippet3] More...
#include <Reflection.h>
Classes | |
struct | ArrayInfo |
Holds extended type info for array-like types. More... | |
struct | EmptyInfo |
Holds no extended type info. More... | |
struct | MemberInfo |
Holds extended type info for members of struct. More... | |
struct | StructInfo |
Holds extended type info for structs. More... | |
Public Member Functions | |
constexpr | TypeInfo () |
[reflectionSnippet4] More... | |
constexpr | TypeInfo (TypeCategory type, uint16_t sizeInBytes, StructInfo structInfo) |
Constructs a TypeInfo used by Struct Types. More... | |
constexpr | TypeInfo (TypeCategory type, uint16_t sizeInBytes, MemberInfo member) |
Constructs a TypeInfo used by Struct Members (children of Struct Type) More... | |
constexpr | TypeInfo (TypeCategory type, uint16_t sizeInBytes, uint8_t numberOfChildren, ArrayInfo arrayInfo) |
Constructs a TypeInfo used by Array-like Types (T[N], Array<T, N> and Vector<T>) More... | |
constexpr | TypeInfo (TypeCategory type, uint16_t sizeInBytes) |
Constructs a TypeInfo of given type and size. More... | |
constexpr auto | getNumberOfChildren () const |
Get number of children (if any) of this info. Only valid when hasLink == false More... | |
constexpr bool | setNumberOfChildren (size_t numChildren) |
Sets the number of children of this typeinfo. More... | |
constexpr bool | hasValidLinkIndex () const |
Check if this type info has a valid link index. More... | |
constexpr bool | needsLinking () const |
Check if this type info needs to be linked. More... | |
constexpr auto | getLinkIndex () const |
Obtains link valid index (assuming hasLink == true and needsLinking() == false ) More... | |
constexpr bool | setLinkIndex (ssize_t newLinkIndex) |
Change Link index for this type. More... | |
constexpr bool | isPrimitiveType () const |
Check if type is primitive. More... | |
constexpr bool | isPrimitiveOrPackedStruct () const |
Check if type is primitive or it's a struct with isPacked property == true More... | |
Static Public Member Functions | |
static constexpr bool | isPrimitiveCategory (TypeCategory category) |
Public Attributes | |
bool | hasLink: 1 |
Contains a link to another type. More... | |
TypeCategory | type: 7 |
Type of typeinfo. More... | |
union { | |
uint8_t numberOfChildren | |
Only valid when TypeInfo::hasLink == false More... | |
uint8_t linkIndex | |
Only valid when TypeInfo::hasLink == true More... | |
}; | |
uint16_t | sizeInBytes |
Size in bytes of the described type. More... | |
union { | |
EmptyInfo emptyInfo | |
MemberInfo memberInfo | |
StructInfo structInfo | |
ArrayInfo arrayInfo | |
}; | |
[reflectionSnippet3]
A single 8 bytes union holding most important information about a reflected type This structure is expected to be stored in an flat array. Children items are always following parent items in the flat array. For example when a struct is defined, its members are defined as its children. When one of these children is simple primitive type, this type is stored inline with the type itself. When instead a complex type is needed, a linkID is provided. Such link is as offset in the flat array where detailed definition of the complex type exists. [reflectionSnippet4]
|
inlineconstexpr |
[reflectionSnippet4]
Constructs an invalid type info.
|
inlineconstexpr |
Constructs a TypeInfo used by Struct Types.
|
inlineconstexpr |
Constructs a TypeInfo used by Struct Members (children of Struct Type)
|
inlineconstexpr |
Constructs a TypeInfo used by Array-like Types (T[N], Array<T, N> and Vector<T>)
|
inlineconstexpr |
Constructs a TypeInfo of given type and size.
|
inlineconstexpr |
Obtains link valid index (assuming hasLink
== true
and needsLinking() == false
)
|
inlineconstexpr |
Get number of children (if any) of this info. Only valid when hasLink
== false
|
inlineconstexpr |
Check if this type info has a valid link index.
|
inlineconstexpr |
Check if type is primitive or it's a struct with isPacked
property == true
|
inlineconstexpr |
Check if type is primitive.
|
inlineconstexpr |
Check if this type info needs to be linked.
|
inlineconstexpr |
Change Link index for this type.
newLinkIndex | New Link Index |
true
if the link index has been changed successfully
|
inlineconstexpr |
Sets the number of children of this typeinfo.
numChildren | New number of children |
true
if it has been changed successfully bool SC::Reflection::TypeInfo::hasLink |
Contains a link to another type.
uint8_t SC::Reflection::TypeInfo::linkIndex |
Only valid when TypeInfo::hasLink == true
uint8_t SC::Reflection::TypeInfo::numberOfChildren |
Only valid when TypeInfo::hasLink == false
uint16_t SC::Reflection::TypeInfo::sizeInBytes |
Size in bytes of the described type.
TypeCategory SC::Reflection::TypeInfo::type |
Type of typeinfo.