ADTF  3.18.2
cStaticCodec

Codec for static structures defined by a DDL definition. More...

Inheritance diagram for cStaticCodec:
[legend]

Public Types

typedef adtf_ddl::tStructElement DefinedStructElementType
 
- Public Types inherited from cStaticDecoder
typedef adtf_ddl::tStructElement DefinedStructElementType
 

Public Member Functions

 cStaticCodec ()=default
 Default constructor.
 
 cStaticCodec (cStaticCodec &&)=default
 Move constructor.
 
cStaticCodecoperator= (cStaticCodec &&)=default
 Move assignment operator.
 
tResult SetElementValue (size_t nIndex, const void *pValue)
 Sets the current value of the given element by copying its data from the passed-in location. More...
 
tResult SetElementValue (size_t nIndex, const A_UTILS_NS::cVariant &oValue)
 Sets the current value of the given element to the given value. More...
 
void * GetElementAddress (size_t nIndex)
 
tResult SetConstants ()
 Sets all elements to their constant values defined in the DDL. More...
 
const void * GetElementAddress (size_t nIndex) const
 
- Public Member Functions inherited from cStaticDecoder
 cStaticDecoder ()
 Default constructor.
 
 cStaticDecoder (cStaticDecoder &&)=default
 Move constructor.
 
cStaticDecoderoperator= (cStaticDecoder &&)=default
 Move assignment operator.
 
virtual tResult IsValid () const
 
virtual size_t GetElementCount () const
 
tResult GetElement (size_t nIndex, const tStructElement *&pElement) const
 Access information about an element. More...
 
tResult GetElementValue (size_t nIndex, void *pValue) const
 Returns the current value of the given element by copying its data to the passed-in location. More...
 
tResult GetElementValue (size_t nIndex, A_UTILS_NS::cVariant &oValue) const
 Returns the current value of the given element as a variant. More...
 
const void * GetElementAddress (size_t nIndex) const
 
size_t GetStaticBufferSize (tDataRepresentation eRep=tDataRepresentation::Deserialized) const
 
tDataRepresentation GetRepresentation () const
 
A_UTILS_NS::cString GetElementValueString (size_t nIndex) const
 Returns the current value of the given element as a string. More...
 

Private Member Functions

 cStaticCodec (std::shared_ptr< const cStructLayout > pLayout, void *pData, size_t nDataSize, tDataRepresentation eRep)
 For internal use only.
 

Additional Inherited Members

- Static Public Member Functions inherited from cStaticDecoder
static const char * GetStructElementName (const tStructElement *pElement)
 Access information about an element. More...
 
- Protected Member Functions inherited from cStaticDecoder
 cStaticDecoder (std::shared_ptr< const cStructLayout > pLayout, const void *pData, size_t nDataSize, tDataRepresentation eRep)
 For internal use only.
 
virtual const tStructLayoutElement * GetLayoutElement (size_t nIndex) const
 For internal use only.
 
- Protected Attributes inherited from cStaticDecoder
std::shared_ptr< const cStructLayout > m_pLayout
 For internal use only.
 
const void * m_pData
 For internal use only.
 
size_t m_nDataSize
 For internal use only.
 
const cElementAccessor * m_pElementAccessor
 For internal use only.
 

Detailed Description

Codec for static structures defined by a DDL definition.

Definition at line 130 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/extern/pkg_ddl/include/adtfddl/codec/static_codec.h.

Member Function Documentation

◆ GetElementAddress() [1/2]

void* GetElementAddress ( size_t  nIndex)
Parameters
[in]nIndexThe index of the element.
Returns
A pointer to the element or nullptr in case of an error.

◆ GetElementAddress() [2/2]

const void* GetElementAddress
Parameters
[in]nIndexThe index of the element.
Returns
A pointer to the element or nullptr in case of an error.

◆ SetConstants()

tResult SetConstants ( )

Sets all elements to their constant values defined in the DDL.

Returns
Standard result.

◆ SetElementValue() [1/2]

tResult SetElementValue ( size_t  nIndex,
const A_UTILS_NS::cVariant oValue 
)

Sets the current value of the given element to the given value.

Parameters
[in]nIndexThe index of the element.
[in]oValueThe value.
Return values
ERR_INVALID_INDEXInvalid element index.

◆ SetElementValue() [2/2]

tResult SetElementValue ( size_t  nIndex,
const void *  pValue 
)

Sets the current value of the given element by copying its data from the passed-in location.

Parameters
[in]nIndexThe index of the element.
[in]pValueThe location where the data should be copied from.
Return values
ERR_INVALID_INDEXInvalid element index.