ADTF  3.18.2
cCodecFactory

Factory class for ddl codecs. More...

Public Member Functions

 cCodecFactory ()
 Empty constructor. More...
 
 cCodecFactory (const char *strStructName, const char *strMediaDescription)
 Constructor that take a DDL string for initialization. More...
 
 cCodecFactory (const cDDLComplex *pStruct)
 Constructor that uses an OO-DDL struct for initialization. More...
 
 cCodecFactory (cCodecFactory &)=default
 Copy constructor.
 
 cCodecFactory (const cCodecFactory &)=default
 Copy constructor.
 
 cCodecFactory (cCodecFactory &&)=default
 Move constructor.
 
cCodecFactoryoperator= (cCodecFactory &)=default
 Assignment operator.
 
cCodecFactoryoperator= (cCodecFactory &&)=default
 Move assignment operator.
 
tResult IsValid () const
 Check if the factory is in a valid state. More...
 
cStaticDecoder MakeStaticDecoderFor (const void *pData, size_t nDataSize, tDataRepresentation eRep=tDataRepresentation::Deserialized) const
 Creates a static decoder for the given data. More...
 
cStaticCodec MakeStaticCodecFor (void *pData, size_t nDataSize, tDataRepresentation eRep=tDataRepresentation::Deserialized) const
 Creates a static codec for the given data. More...
 
cDecoder MakeDecoderFor (const void *pData, size_t nDataSize, tDataRepresentation eRep=tDataRepresentation::Deserialized) const
 Creates a decoder for the given data. More...
 
cCodec MakeCodecFor (void *pData, size_t nDataSize, tDataRepresentation eRep=tDataRepresentation::Deserialized) const
 Creates a codec for the given data. More...
 
size_t GetStaticElementCount () const
 
tResult GetStaticElement (size_t nIndex, const tStructElement *&pElement) const
 Access information about an element. More...
 
size_t GetStaticBufferSize (tDataRepresentation eRep=tDataRepresentation::Deserialized) const
 

Static Public Member Functions

static const char * GetStaticStructElementName (const tStructElement *pElement)
 Access information about an element. More...
 

Private Attributes

std::shared_ptr< const cStructLayout > m_pLayout
 For internal use only.
 
tResult m_oConstructorResult
 For internal use only.
 

Detailed Description

Constructor & Destructor Documentation

◆ cCodecFactory() [1/3]

Empty constructor.

This exists to enable uninitialized member variables of this type that are move-assigned later on.

◆ cCodecFactory() [2/3]

cCodecFactory ( const char *  strStructName,
const char *  strMediaDescription 
)

Constructor that take a DDL string for initialization.

Parameters
[in]strStructNameThe name of the struct for which codecs should be generated.
[in]strMediaDescriptionThe DDL description.

◆ cCodecFactory() [3/3]

cCodecFactory ( const cDDLComplex pStruct)

Constructor that uses an OO-DDL struct for initialization.

Parameters
[in]pStructThe struct definition.

Member Function Documentation

◆ GetStaticBufferSize()

size_t GetStaticBufferSize ( tDataRepresentation  eRep = tDataRepresentation::Deserialized) const
Parameters
[in]eRepThe data representation for which the buffer size should be returned.
Returns
The size of the structure in the requested data representation.

◆ GetStaticElement()

tResult GetStaticElement ( size_t  nIndex,
const tStructElement *&  pElement 
) const

Access information about an element.

Parameters
[in]nIndexThe index of the element.
[out]pElementPointer that will be updated to point to the element information.
Return values
ERR_INVALID_INDEXInvalid index.

◆ GetStaticElementCount()

size_t GetStaticElementCount ( ) const
Returns
The amount of static elements contained in the handled structure.

◆ GetStaticStructElementName()

static const char* GetStaticStructElementName ( const tStructElement pElement)
static

Access information about an element.

Parameters
[out]pElementPointer that will be updated to point to the element information.
Return values
ERR_INVALID_INDEXInvalid index.

◆ IsValid()

tResult IsValid ( ) const

Check if the factory is in a valid state.

Returns
Any errors during construction.

◆ MakeCodecFor()

cCodec MakeCodecFor ( void *  pData,
size_t  nDataSize,
tDataRepresentation  eRep = tDataRepresentation::Deserialized 
) const
inline

Creates a codec for the given data.

Parameters
[in]pDataThe pointer to the raw data.
[in]nDataSizeThe size of the raw data.
[in]eRepThe representation that the data is encoded in.
Returns
a codec.

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

◆ MakeDecoderFor()

cDecoder MakeDecoderFor ( const void *  pData,
size_t  nDataSize,
tDataRepresentation  eRep = tDataRepresentation::Deserialized 
) const
inline

Creates a decoder for the given data.

Parameters
[in]pDataThe pointer to the raw data.
[in]nDataSizeThe size of the raw data.
[in]eRepThe representation that the data is encoded in.
Returns
a decoder.

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

◆ MakeStaticCodecFor()

cStaticCodec MakeStaticCodecFor ( void *  pData,
size_t  nDataSize,
tDataRepresentation  eRep = tDataRepresentation::Deserialized 
) const
inline

Creates a static codec for the given data.

Parameters
[in]pDataThe pointer to the raw data.
[in]nDataSizeThe size of the raw data.
[in]eRepThe representation that the data is encoded in.
Returns
a static codec.

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

◆ MakeStaticDecoderFor()

cStaticDecoder MakeStaticDecoderFor ( const void *  pData,
size_t  nDataSize,
tDataRepresentation  eRep = tDataRepresentation::Deserialized 
) const
inline

Creates a static decoder for the given data.

Parameters
[in]pDataThe pointer to the raw data.
[in]nDataSizeThe size of the raw data.
[in]eRepThe representation that the data is encoded in.
Returns
a static decoder.

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