ADTF
StructType::SerializedInfo

class to describe the serialized information of a StructType::Element. More...

Inheritance diagram for StructType::SerializedInfo:
[legend]

Public Member Functions

 SerializedInfo ()
 default CTOR.
 
 SerializedInfo (const SerializedInfo &)=default
 copy CTOR
 
 SerializedInfo (SerializedInfo &&)=default
 move CTOR
 
SerializedInfooperator= (const SerializedInfo &)=default
 copy assignment operator More...
 
SerializedInfooperator= (SerializedInfo &&)=default
 move assignment operator More...
 
virtual ~SerializedInfo ()=default
 DTOR.
 
 SerializedInfo (OptionalSize byte_pos, ByteOrder byte_order=ByteOrderDefault::getPlatformDefault(), OptionalSize bit_pos={}, OptionalSize num_bits={})
 CTOR. More...
 
 SerializedInfo (const std::initializer_list< size_t > &intializer)
 CTOR with string list initializing. More...
 
bool operator== (const SerializedInfo &other) const
 equality operator. More...
 
OptionalSize getBytePos () const
 Get the Byte Pos. More...
 
void setBytePos (OptionalSize byte_pos, bool prevent_notification=false)
 Set the Byte Pos. More...
 
OptionalSize getBitPos () const
 Get the Bit Pos (if set) More...
 
void setBitPos (OptionalSize bit_pos, bool prevent_notification=false)
 Sets the Bit Pos. More...
 
OptionalSize getNumBits () const
 Get the Num Bits (if set) More...
 
void setNumBits (OptionalSize num_bits)
 Set the Num Bits. More...
 
ByteOrder getByteOrder () const
 Get the Byte Order. More...
 
void setByteOrder (ByteOrder byte_order)
 Set the Byte Order. More...
 

Protected Member Functions

virtual void notifyChangeSerialized (const std::string &)
 notification forwarding of serialized information to the StructType::Element object. More...
 

Private Attributes

OptionalSize _byte_pos = {}
 
OptionalSize _bit_pos = {}
 
OptionalSize _num_bits = {}
 
ByteOrder _byte_order = e_le
 

Detailed Description

class to describe the serialized information of a StructType::Element.

Definition at line 494 of file datamodel_types.h.

Constructor & Destructor Documentation

◆ SerializedInfo() [1/2]

SerializedInfo ( OptionalSize  byte_pos,
ByteOrder  byte_order = ByteOrderDefault::getPlatformDefault(),
OptionalSize  bit_pos = {},
OptionalSize  num_bits = {} 
)

CTOR.

Parameters
byte_posthe byte position
byte_orderthe byte order
bit_posthe bit position (optional)
num_bitsthe number of bits used (optional)

◆ SerializedInfo() [2/2]

SerializedInfo ( const std::initializer_list< size_t > &  intializer)

CTOR with string list initializing.

Parameters
intializerthe initializer with strings. Valid in this order:
  • 0 - byte_pos
  • 1 - byte_order
  • 2 - bit_pos
  • 3 - num_bits
Example usage:
StructType my_struct_type;
//the {"24", "LE", "8", "5"} is the SerializedInfo
my_tsruct_type.addElement({ "bit_usage_5", "int32_t", { 0 }, {"24", "LE", "8", "5"});
StructType()=delete
no default CTOR

Member Function Documentation

◆ getBitPos()

OptionalSize getBitPos ( ) const

Get the Bit Pos (if set)

Remarks
If not valid returned it will be set automatically while typeinfo model is created if necessary!
Returns
OptionalSize valid bitpos or invalid if not set

Referenced by DDToXMLFactory< DOM_NODE_TYPE >::createNode().

◆ getByteOrder()

ByteOrder getByteOrder ( ) const

Get the Byte Order.

Returns
ByteOrder

Referenced by DDToXMLFactory< DOM_NODE_TYPE >::createNode().

◆ getBytePos()

OptionalSize getBytePos ( ) const

Get the Byte Pos.

Remarks
If not valid returned it will be set automatically while typeinfo model is created!
Returns
OptionalSize a valid byte pos (if invalid it will be set)

Referenced by DDToXMLFactory< DOM_NODE_TYPE >::createNode().

◆ getNumBits()

OptionalSize getNumBits ( ) const

Get the Num Bits (if set)

Returns
OptionalSize

Referenced by DDToXMLFactory< DOM_NODE_TYPE >::createNode().

◆ notifyChangeSerialized()

virtual void notifyChangeSerialized ( const std::string &  )
inlineprotectedvirtual

notification forwarding of serialized information to the StructType::Element object.

param std::string string additional_info - The name of the additional info in the notification to forward.

Reimplemented in StructType::Element.

Definition at line 633 of file datamodel_types.h.

◆ operator=() [1/2]

SerializedInfo& operator= ( const SerializedInfo )
default

copy assignment operator

Returns
SerializedInfo&

◆ operator=() [2/2]

SerializedInfo& operator= ( SerializedInfo &&  )
default

move assignment operator

Returns
SerializedInfo&

◆ operator==()

bool operator== ( const SerializedInfo other) const

equality operator.

Parameters
otherthe other serialized info to compare to.
Returns
true the serialized info is equal
false the serialized info is not equal

◆ setBitPos()

void setBitPos ( OptionalSize  bit_pos,
bool  prevent_notification = false 
)

Sets the Bit Pos.

Parameters
bit_posthe bit pos if it is valid
prevent_notificationif set to true this change is not observable.

◆ setByteOrder()

void setByteOrder ( ByteOrder  byte_order)

Set the Byte Order.

Parameters
byte_orderthe byte order to set

◆ setBytePos()

void setBytePos ( OptionalSize  byte_pos,
bool  prevent_notification = false 
)

Set the Byte Pos.

Parameters
byte_posthe bytepos to set
prevent_notificationif set to true this change is not observable.

◆ setNumBits()

void setNumBits ( OptionalSize  num_bits)

Set the Num Bits.

Parameters
num_bitsthe num bits to set.