ADTF
Loading...
Searching...
No Matches
cStructureType

Type implementation for structures. More...

#include <type_reflection_legacy.h>

Inheritance diagram for cStructureType:
[legend]

Classes

struct  member
 All information about a structure member. More...
 

Public Member Functions

 cStructureType (const std::string &strName, size_t nSize, size_t nAlignment)
 Initializes the structure type.
 
 cStructureType (const cStructureType &oOther)
 
std::string GetName () const override
 
size_t GetSize () const override
 
size_t GetAlignment () 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.
 
 operator std::pair< std::string, std::string > () const
 Legacy conversion operator to a pair of (first) md_struct and (second)md_description.
 

Protected Member Functions

void Add (member &&sNewMember)
 Adds a new member to the structure.
 

Private Attributes

std::string m_strName
 
size_t m_nSize
 
size_t m_nAlignment
 
std::vector< memberm_oMembers
 

Detailed Description

Type implementation for structures.

Do not use this class directly, but use structure instead.

Definition at line 267 of file type_reflection_legacy.h.

Constructor & Destructor Documentation

◆ cStructureType()

cStructureType ( const std::string & strName,
size_t nSize,
size_t nAlignment )

Initializes the structure type.

Parameters
[in]strNameThe name.
[in]nSizeThe size in bytes.
[in]nAlignmentThe default alignment.

References cStructureType().

Referenced by cStructureType(), structure< T >::structure(), structure< T >::Add(), and structure< void >::Add().

Member Function Documentation

◆ Add()

void Add ( member && sNewMember)
protected

Adds a new member to the structure.

Parameters
[in]sNewMemberThe new member.

Referenced by structure< T >::Add(), structure< T >::Add(), and structure< T >::Add().

◆ GetAlignment()

size_t GetAlignment ( ) const
overridevirtual
Returns
The default alignment of the type.

Implements cType.

Reimplemented in structure< void >.

◆ GetAsStringPair()

std::pair< std::string, std::string > GetAsStringPair ( ) const

Legacy conversion to a pair of (first) md_struct and (second)md_description.

Returns
A list of all members of the structure.

Referenced by operator std::pair< std::string, std::string >().

◆ GetMembers()

const std::vector< member > & GetMembers ( ) const
Returns
A list of all members of the structure.

◆ GetName()

std::string GetName ( ) const
overridevirtual
Returns
The name of the type.

Implements cType.

◆ GetSize()

size_t GetSize ( ) const
overridevirtual
Returns
The size of the type.

Implements cType.

Reimplemented in structure< void >.

◆ operator std::pair< std::string, std::string >()

operator std::pair< std::string, std::string > ( ) const
inline

Legacy conversion operator to a pair of (first) md_struct and (second)md_description.

Returns
A list of all members of the structure.

Definition at line 316 of file type_reflection_legacy.h.

References GetAsStringPair().

Member Data Documentation

◆ m_nAlignment

size_t m_nAlignment
private

Definition at line 331 of file type_reflection_legacy.h.

◆ m_nSize

size_t m_nSize
private

Definition at line 330 of file type_reflection_legacy.h.

◆ m_oMembers

std::vector<member> m_oMembers
private

Definition at line 332 of file type_reflection_legacy.h.

◆ m_strName

std::string m_strName
private

Definition at line 329 of file type_reflection_legacy.h.