ADTF
3.14.3
|
Creating a valid Structure Data Definition by a existing type and its member types. More...
Public Member Functions | |
DDStructureGenerator (const std::string &name, uint32_t struct_version=1) | |
CTOR to create a structure type based on a type. More... | |
template<typename MemberType > | |
DDStructureGenerator & | addElement (const std::string &name, MemberType T::*member_offset) |
Adds a new member of data type (POD) by member reference pointer. More... | |
template<typename MemberType > | |
DDStructureGenerator & | addElement (const std::string &name, MemberType T::*member_offset, const DDEnum &enum_type) |
Adds a new member of an enumeration type by member reference pointer. More... | |
template<typename MemberType > | |
DDStructureGenerator & | addElement (const std::string &name, MemberType T::*member_offset, const DDStructure &struct_type) |
Adds a new member of an structure type by member reference pointer. More... | |
std::string | getStructDescription () const |
Gets the Struct Data Description as XML String. More... | |
std::string | getStructName () const |
Gets the Struct Name. More... | |
const dd::DataDefinition & | getDD () const |
returns a valid DDL. More... | |
const dd::StructType & | getStructType () const |
Get the Struct Type object. More... | |
const DDStructure & | getStructure () const |
Get the current valid DDStructure object. More... | |
size_t | getSize () const |
Retrieves the current evaluated size of the structure. More... | |
size_t | getAlignment () const |
Retrieves the current evaluated alignment of the structure. More... | |
operator const DDStructure & () const | |
Get the current valid DDStructure object. More... | |
Private Member Functions | |
void | pushAlignment () |
void | popAlignment () |
void | validate () const |
dd::OptionalSize | evaluateAlignment (const std::string &element_name, size_t member_offset, size_t member_type_alignment) |
Private Attributes | |
DDStructure | _structure |
bool | _padded_final = false |
Creating a valid Structure Data Definition by a existing type and its member types.
T | The Struct type to use. |
align_with_padding | Set to true to align the structure and structure members with padding bytes to reach expected size of T. |
Definition at line 593 of file ddstructure.h.
|
inlineexplicit |
CTOR to create a structure type based on a type.
name | The name of the type. |
struct_version | the version of the type. |
Definition at line 605 of file ddstructure.h.
|
inline |
Adds a new member of data type (POD) by member reference pointer.
[in] | name | The name of the member. |
[in] | member_offset | The pointer to the member. |
Definition at line 616 of file ddstructure.h.
References DDStructure::addElement().
Referenced by structure< T >::Add().
|
inline |
Adds a new member of an enumeration type by member reference pointer.
[in] | name | The name of the member. |
[in] | member_offset | The pointer to the member. |
[in] | enum_type | The enumeration type. |
Definition at line 637 of file ddstructure.h.
References DDStructure::addElement(), and enum_type.
|
inline |
Adds a new member of an structure type by member reference pointer.
[in] | name | The name of the member. |
[in] | member_offset | The pointer to the member. |
[in] | struct_type | The structure type. |
Definition at line 659 of file ddstructure.h.
References DDStructure::addElement(), and struct_type.
|
inline |
Retrieves the current evaluated alignment of the structure.
Definition at line 745 of file ddstructure.h.
References DDStructure::getAlignment().
|
inline |
returns a valid DDL.
ddl::dd::Error | Throws if the evaluated size is not sizeof(T). Check if there may be missed elements. |
Definition at line 701 of file ddstructure.h.
References DDStructure::getDD().
Referenced by structure< T >::GetSize().
|
inline |
Retrieves the current evaluated size of the structure.
Definition at line 736 of file ddstructure.h.
References DDStructure::getSize().
|
inline |
Gets the Struct Data Description as XML String.
Definition at line 679 of file ddstructure.h.
References DDStructure::getStructDescription().
|
inline |
Gets the Struct Name.
Definition at line 689 of file ddstructure.h.
References DDStructure::getStructName().
Referenced by structure< T >::GetSize().
|
inline |
Get the Struct Type object.
ddl::dd::Error | Throws if the evaluated size is not sizeof(T). Check if there may be missed elements. |
Definition at line 714 of file ddstructure.h.
References DDStructure::getStructType().
Referenced by structure< T >::GetAlignment().
|
inline |
Get the current valid DDStructure object.
ddl::dd::Error | Throws if the evaluated size is not sizeof(T). Check if there may be missed elements. |
Definition at line 726 of file ddstructure.h.
Referenced by structure< T >::GetStructure(), and DDStructureGenerator< T, align_with_padding >::operator const DDStructure &().
|
inline |
Get the current valid DDStructure object.
ddl::dd::Error | Throws if the evaluated size is not sizeof(T). Check if there may be missed elements. |
Definition at line 757 of file ddstructure.h.
References DDStructureGenerator< T, align_with_padding >::getStructure().