ADTF
|
This is used to create a structure type independently. More...
Public Member Functions | |
structure (const std::string &strName, size_t nAlignment=0) | |
Initializes the structure. More... | |
size_t | GetSize () const override |
size_t | GetAlignment () const override |
template<typename ArithmeticType > | |
std::enable_if< std::is_arithmetic< ArithmeticType >::value, structure >::type & | Add (const std::string &strName, size_t nArrayCount=1, size_t nAlignment=0, int32_t nBytePosition=-1, bool bLittleEndian=true) |
Adds a new member of arithmetic type (POD) More... | |
structure & | Add (const std::string &strName, const cEnumerationType &oTypeDefinition, size_t nArrayCount=1, size_t nAlignment=0, int32_t nBytePosition=-1, bool bLittleEndian=true) |
Adds a new member of an enumeration type. More... | |
structure & | Add (const std::string &strName, const cStructureType &oTypeDefinition, size_t nArrayCount=1, size_t nAlignment=0, int32_t nBytePosition=-1, bool bLittleEndian=true) |
Adds a new member of a structure type. More... | |
Public Member Functions inherited from cStructureType | |
cStructureType (const std::string &strName, size_t nSize, size_t nAlignment) | |
Initializes the structure type. More... | |
cStructureType (const cStructureType &oOther) | |
std::string | GetName () const override |
const std::vector< member > & | GetMembers () const |
std::pair< std::string, std::string > | GetAsStringPair () const |
Legacy conversion to a pair of (first) md_struct and (second)md_description. More... | |
operator std::pair< std::string, std::string > () const | |
Legacy conversion operator to a pair of (first) md_struct and (second)md_description. More... | |
Private Member Functions | |
void | Add (const std::string &strName, size_t nArrayCount, size_t nAlignment, int32_t nBytePosition, bool bLittleEndian, const std::shared_ptr< cType > &oTypeDefinition) |
size_t | Align (size_t nOffset, size_t nAlignment) const |
void | AlignOffset (size_t nAlignment) |
Private Attributes | |
size_t | m_nCurrentOffset = 0 |
size_t | m_nCurrentSerializedOffset = 0 |
size_t | m_nMaxAlignment = 1 |
Additional Inherited Members | |
Protected Member Functions inherited from cStructureType | |
void | Add (member &&sNewMember) |
Adds a new member to the structure. More... | |
This is used to create a structure type independently.
Definition at line 462 of file type_reflection_legacy.h.
structure | ( | const std::string & | strName, |
size_t | nAlignment = 0 |
||
) |
Initializes the structure.
[in] | strName | The name |
[in] | nAlignment | The alignment. 0 => Alignment will be calculated from the members. |
structure& Add | ( | const std::string & | strName, |
const cEnumerationType & | oTypeDefinition, | ||
size_t | nArrayCount = 1 , |
||
size_t | nAlignment = 0 , |
||
int32_t | nBytePosition = -1 , |
||
bool | bLittleEndian = true |
||
) |
Adds a new member of an enumeration type.
[in] | strName | The name of the member. |
[in] | oTypeDefinition | The enumeration type definition. |
[in] | nArrayCount | The array size of the member. |
[in] | nAlignment | The Alignment of the member. 0 => alignment is taken from the type. |
[in] | nBytePosition | The byte position in the serialized representation. |
[in] | bLittleEndian | Whether the value in the serialized representation is little endian or not. |
structure& Add | ( | const std::string & | strName, |
const cStructureType & | oTypeDefinition, | ||
size_t | nArrayCount = 1 , |
||
size_t | nAlignment = 0 , |
||
int32_t | nBytePosition = -1 , |
||
bool | bLittleEndian = true |
||
) |
Adds a new member of a structure type.
[in] | strName | The name of the member. |
[in] | oTypeDefinition | The structure type definition. |
[in] | nArrayCount | The array size of the member. |
[in] | nAlignment | The Alignment of the member. 0 => alignment is taken from the type. |
[in] | nBytePosition | The byte position in the serialized representation. |
[in] | bLittleEndian | Whether the value in the serialized representation is little endian or not. |
|
inline |
Adds a new member of arithmetic type (POD)
[in] | strName | The name of the member. |
[in] | nArrayCount | The array size of the member. |
[in] | nAlignment | The Alignment of the member. 0 => alignment is taken from the type. |
[in] | nBytePosition | The byte position in the serialized representation. |
[in] | bLittleEndian | Whether the value in the serialized representation is little endian or not. |
Definition at line 487 of file type_reflection_legacy.h.
References structure< T >::Add().
|
overridevirtual |
Reimplemented from cStructureType.
|
overridevirtual |
Reimplemented from cStructureType.