ADTF  3.18.2
cSampleCodecFactory

Factory class for ddl codecs for samples. More...

Inheritance diagram for cSampleCodecFactory:
[legend]

Public Member Functions

 cSampleCodecFactory ()=default
 Empty constructor. More...
 
 cSampleCodecFactory (const char *strStructName, const char *strMediaDescription, adtf_ddl::tDataRepresentation eDefaultDataRepresentation=adtf_ddl::tDataRepresentation::Deserialized)
 Constructor that take a DDL string for initialization. More...
 
 cSampleCodecFactory (const adtf_ddl::cDDLComplex *pStruct, adtf_ddl::tDataRepresentation eDefaultDataRepresentation=adtf_ddl::tDataRepresentation::Deserialized)
 Constructor that uses an OO-DDL struct for initialization. More...
 
 cSampleCodecFactory (cSampleCodecFactory &)=default
 Copy constructor.
 
 cSampleCodecFactory (const cSampleCodecFactory &)=default
 Copy constructor.
 
 cSampleCodecFactory (cSampleCodecFactory &&)=default
 Move constructor.
 
cSampleCodecFactoryoperator= (cSampleCodecFactory &)=default
 assignment operator
 
cSampleCodecFactoryoperator= (cSampleCodecFactory &&)=default
 Move assignment operator.
 
tResult IsValid () const
 Check if the factory is in a valid state. More...
 
cStaticSampleDecoder MakeStaticDecoderFor (const adtf::streaming::ISample &oSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
 Creates a static decoder for the given sample. More...
 
cStaticSampleCodec MakeStaticCodecFor (adtf::streaming::ISample &oSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
 Creates a static codec for the given sample. More...
 
cSampleDecoder MakeDecoderFor (const adtf::streaming::ISample &oSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
 Creates a decoder for the given sample. More...
 
cSampleCodec MakeCodecFor (adtf::streaming::ISample &oSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
 Creates a codec for the given sample. More...
 
size_t GetStaticElementCount () const
 
tResult GetStaticElement (size_t nIndex, const adtf_ddl::tStructElement *&pElement) const
 Access information about an element. More...
 
size_t GetStaticBufferSize (adtf_ddl::tDataRepresentation eRep=adtf_ddl::tDataRepresentation::Deserialized) const
 
adtf_ddl::tDataRepresentation GetDefaultDataRepresentation () const
 
cStaticSampleDecoder MakeStaticDecoderFor (const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > &pSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
 Creates a static decoder for the given sample. More...
 
cSampleDecoder MakeDecoderFor (const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > &pSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
 Creates a decoder for the given sample. More...
 
cStaticSampleCodec MakeStaticCodecFor (const adtf::ucom::iobject_ptr< adtf::streaming::ISample > &pSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
 Creates a static codec for the given sample. More...
 
cSampleCodec MakeCodecFor (const adtf::ucom::iobject_ptr< adtf::streaming::ISample > &pSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
 Creates a codec for the given sample. More...
 
cStaticSampleDecoder MakeStaticDecoderFor (const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > &pSample) const
 Creates a static decoder for the given sample using the default data representation. More...
 
cSampleDecoder MakeDecoderFor (const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > &pSample) const
 Creates a decoder for the given sample using the default data representation. More...
 
cStaticSampleCodec MakeStaticCodecFor (const adtf::ucom::iobject_ptr< adtf::streaming::ISample > &pSample) const
 Creates a static codec for the given sample using the default data representation. More...
 
cSampleCodec MakeCodecFor (const adtf::ucom::iobject_ptr< adtf::streaming::ISample > &pSample) const
 Creates a codec for the given sample using the default data representation. More...
 
cStaticSampleDecoder MakeStaticDecoderFor (const adtf::streaming::ISample &oSample) const
 Creates a static decoder for the given sample using the default data representation. More...
 
cSampleDecoder MakeDecoderFor (const adtf::streaming::ISample &oSample) const
 Creates a decoder for the given sample using the default data representation. More...
 
cStaticSampleCodec MakeStaticCodecFor (adtf::streaming::ISample &oSample) const
 Creates a static codec for the given sample using the default data representation. More...
 
cSampleCodec MakeCodecFor (adtf::streaming::ISample &oSample) const
 Creates a codec for the given sample using the default data representation. More...
 

Private Attributes

adtf_ddl::cCodecFactory m_oFactory
 For internal use only.
 
adtf_ddl::tDataRepresentation m_eDefaultDataRepresentation
 For internal use only.
 

Detailed Description

Factory class for ddl codecs for samples.

Definition at line 179 of file sample_codec_legacy.h.

Constructor & Destructor Documentation

◆ cSampleCodecFactory() [1/3]

cSampleCodecFactory ( )
default

Empty constructor.

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

◆ cSampleCodecFactory() [2/3]

cSampleCodecFactory ( const char *  strStructName,
const char *  strMediaDescription,
adtf_ddl::tDataRepresentation  eDefaultDataRepresentation = adtf_ddl::tDataRepresentation::Deserialized 
)

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.
[in]eDefaultDataRepresentationThe representation used for the Make* factory methods without an parameter for the data representation.

◆ cSampleCodecFactory() [3/3]

cSampleCodecFactory ( const adtf_ddl::cDDLComplex pStruct,
adtf_ddl::tDataRepresentation  eDefaultDataRepresentation = adtf_ddl::tDataRepresentation::Deserialized 
)

Constructor that uses an OO-DDL struct for initialization.

Parameters
[in]pStructThe struct definition.
[in]eDefaultDataRepresentationThe representation used for the Make* factory methods without an parameter for the data representation.

Member Function Documentation

◆ GetDefaultDataRepresentation()

adtf_ddl::tDataRepresentation GetDefaultDataRepresentation ( ) const
Returns
The default data representation used when creating codecs/decoders.

◆ GetStaticBufferSize()

size_t GetStaticBufferSize ( adtf_ddl::tDataRepresentation  eRep = adtf_ddl::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 adtf_ddl::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.

◆ IsValid()

tResult IsValid ( ) const

Check if the factory is in a valid state.

Returns
Any errors during construction.

Referenced by md_sample_data_factory< T >::md_sample_data_factory().

◆ MakeCodecFor() [1/4]

cSampleCodec MakeCodecFor ( adtf::streaming::ISample oSample) const
inline

Creates a codec for the given sample using the default data representation.

Parameters
[in]oSampleThe sample.
Returns
a codec.

Definition at line 444 of file sample_codec_legacy.h.

References cSampleCodecFactory::m_eDefaultDataRepresentation, and cSampleCodecFactory::MakeCodecFor().

◆ MakeCodecFor() [2/4]

cSampleCodec MakeCodecFor ( adtf::streaming::ISample oSample,
adtf_ddl::tDataRepresentation  eDataRepresentation 
) const

Creates a codec for the given sample.

Parameters
[out]oSampleThe sample.
[in]eDataRepresentationThe data representation that the sample is in.
Returns
a codec.

Referenced by cSampleCodecFactory::MakeCodecFor(), and encoding_sample_writer< WriterImplementation >::MakeSample().

◆ MakeCodecFor() [3/4]

cSampleCodec MakeCodecFor ( const adtf::ucom::iobject_ptr< adtf::streaming::ISample > &  pSample) const
inline

Creates a codec for the given sample using the default data representation.

Parameters
[in]pSampleThe sample.
Returns
a codec.

Definition at line 400 of file sample_codec_legacy.h.

References iobject_ptr_base< T >::Get(), cSampleCodecFactory::m_eDefaultDataRepresentation, and cSampleCodecFactory::MakeCodecFor().

◆ MakeCodecFor() [4/4]

cSampleCodec MakeCodecFor ( const adtf::ucom::iobject_ptr< adtf::streaming::ISample > &  pSample,
adtf_ddl::tDataRepresentation  eDataRepresentation 
) const
inline

Creates a codec for the given sample.

Parameters
[out]pSampleThe sample.
[in]eDataRepresentationThe data representation that the sample is in.
Returns
a codec.

Definition at line 355 of file sample_codec_legacy.h.

References iobject_ptr_base< T >::Get(), and cSampleCodecFactory::MakeCodecFor().

◆ MakeDecoderFor() [1/4]

cSampleDecoder MakeDecoderFor ( const adtf::streaming::ISample oSample) const
inline

Creates a decoder for the given sample using the default data representation.

Parameters
[in]oSampleThe sample.
Returns
a decoder.

Definition at line 422 of file sample_codec_legacy.h.

References cSampleCodecFactory::m_eDefaultDataRepresentation, and cSampleCodecFactory::MakeDecoderFor().

◆ MakeDecoderFor() [2/4]

cSampleDecoder MakeDecoderFor ( const adtf::streaming::ISample oSample,
adtf_ddl::tDataRepresentation  eDataRepresentation 
) const

Creates a decoder for the given sample.

Parameters
[in]oSampleThe sample.
[in]eDataRepresentationThe data representation that the sample is in.
Returns
a decoder.

Referenced by decoding_sample_reader< ReaderImplementation >::GetLastDecoder(), decoding_sample_reader< ReaderImplementation >::GetNextDecoder(), md_sample_data_factory< T >::Make(), and cSampleCodecFactory::MakeDecoderFor().

◆ MakeDecoderFor() [3/4]

cSampleDecoder MakeDecoderFor ( const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > &  pSample) const
inline

Creates a decoder for the given sample using the default data representation.

Parameters
[in]pSampleThe sample.
Returns
a decoder.

Definition at line 378 of file sample_codec_legacy.h.

References iobject_ptr_base< T >::Get(), cSampleCodecFactory::m_eDefaultDataRepresentation, and cSampleCodecFactory::MakeDecoderFor().

◆ MakeDecoderFor() [4/4]

cSampleDecoder MakeDecoderFor ( const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > &  pSample,
adtf_ddl::tDataRepresentation  eDataRepresentation 
) const
inline

Creates a decoder for the given sample.

Parameters
[in]pSampleThe sample.
[in]eDataRepresentationThe data representation that the sample is in.
Returns
a decoder.

Definition at line 329 of file sample_codec_legacy.h.

References iobject_ptr_base< T >::Get(), and cSampleCodecFactory::MakeDecoderFor().

◆ MakeStaticCodecFor() [1/4]

cStaticSampleCodec MakeStaticCodecFor ( adtf::streaming::ISample oSample) const
inline

Creates a static codec for the given sample using the default data representation.

Parameters
[in]oSampleThe sample.
Returns
a static codec.

Definition at line 433 of file sample_codec_legacy.h.

References cSampleCodecFactory::m_eDefaultDataRepresentation, and cSampleCodecFactory::MakeStaticCodecFor().

◆ MakeStaticCodecFor() [2/4]

cStaticSampleCodec MakeStaticCodecFor ( adtf::streaming::ISample oSample,
adtf_ddl::tDataRepresentation  eDataRepresentation 
) const

Creates a static codec for the given sample.

Parameters
[out]oSampleThe sample.
[in]eDataRepresentationThe data representation that the sample is in.
Returns
a static codec.

Referenced by cSampleCodecFactory::MakeStaticCodecFor().

◆ MakeStaticCodecFor() [3/4]

cStaticSampleCodec MakeStaticCodecFor ( const adtf::ucom::iobject_ptr< adtf::streaming::ISample > &  pSample) const
inline

Creates a static codec for the given sample using the default data representation.

Parameters
[in]pSampleThe sample.
Returns
a static codec.

Definition at line 389 of file sample_codec_legacy.h.

References iobject_ptr_base< T >::Get(), cSampleCodecFactory::m_eDefaultDataRepresentation, and cSampleCodecFactory::MakeStaticCodecFor().

◆ MakeStaticCodecFor() [4/4]

cStaticSampleCodec MakeStaticCodecFor ( const adtf::ucom::iobject_ptr< adtf::streaming::ISample > &  pSample,
adtf_ddl::tDataRepresentation  eDataRepresentation 
) const
inline

Creates a static codec for the given sample.

Parameters
[out]pSampleThe sample.
[in]eDataRepresentationThe data representation that the sample is in.
Returns
a static codec.

Definition at line 342 of file sample_codec_legacy.h.

References iobject_ptr_base< T >::Get(), and cSampleCodecFactory::MakeStaticCodecFor().

◆ MakeStaticDecoderFor() [1/4]

cStaticSampleDecoder MakeStaticDecoderFor ( const adtf::streaming::ISample oSample) const
inline

Creates a static decoder for the given sample using the default data representation.

Parameters
[in]oSampleThe sample.
Returns
a static decoder.

Definition at line 411 of file sample_codec_legacy.h.

References cSampleCodecFactory::m_eDefaultDataRepresentation, and cSampleCodecFactory::MakeStaticDecoderFor().

◆ MakeStaticDecoderFor() [2/4]

cStaticSampleDecoder MakeStaticDecoderFor ( const adtf::streaming::ISample oSample,
adtf_ddl::tDataRepresentation  eDataRepresentation 
) const

Creates a static decoder for the given sample.

Parameters
[in]oSampleThe sample.
[in]eDataRepresentationThe data representation that the sample is in.
Returns
a static decoder.

Referenced by cSampleCodecFactory::MakeStaticDecoderFor().

◆ MakeStaticDecoderFor() [3/4]

cStaticSampleDecoder MakeStaticDecoderFor ( const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > &  pSample) const
inline

Creates a static decoder for the given sample using the default data representation.

Parameters
[in]pSampleThe sample.
Returns
a static decoder.

Definition at line 367 of file sample_codec_legacy.h.

References iobject_ptr_base< T >::Get(), cSampleCodecFactory::m_eDefaultDataRepresentation, and cSampleCodecFactory::MakeStaticDecoderFor().

◆ MakeStaticDecoderFor() [4/4]

cStaticSampleDecoder MakeStaticDecoderFor ( const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > &  pSample,
adtf_ddl::tDataRepresentation  eDataRepresentation 
) const
inline

Creates a static decoder for the given sample.

Parameters
[in]pSampleThe sample.
[in]eDataRepresentationThe data representation that the sample is in.
Returns
a static decoder.

Definition at line 316 of file sample_codec_legacy.h.

References iobject_ptr_base< T >::Get(), and cSampleCodecFactory::MakeStaticDecoderFor().