ADTF
Loading...
Searching...
No Matches
adtf::mediadescription::osborn::cSampleCodecFactory Class Reference

#include <sample_codec.h>

Inherits adtf::mediadescription::osborn::adtf_ddl_access::cCodecFactoryLegacy.

Inherited by adtf::mediadescription::osborn::decoding_sample_reader< ReaderImplementation >, and adtf::mediadescription::osborn::encoding_sample_writer< WriterImplementation >.

Public Types

typedef ddl::codec::FactoryElement< sample_codec_factory_access< const cSampleCodecFactory > > tElement
 
typedef ddl::codec::ChildElements< sample_codec_factory_access< const cSampleCodecFactory > > tElements
 
- Public Types inherited from adtf::mediadescription::osborn::adtf_ddl_access::cCodecFactoryLegacy
typedef ddl::StructElement DefinedStructElementType
 type definition for the old access_element API.
 

Public Member Functions

 cSampleCodecFactory ()
 
 cSampleCodecFactory (const char *strStructName, const char *strMediaDescription, ddl::tDataRepresentation eDefaultDataRepresentation=ddl::tDataRepresentation::Deserialized)
 
 cSampleCodecFactory (const ddl::dd::StructType &oStruct, const ddl::dd::DataDefinition &oParentDD, ddl::tDataRepresentation eDefaultDataRepresentation=ddl::tDataRepresentation::Deserialized)
 
 cSampleCodecFactory (const std::pair< std::string, std::string > &oMDDescription, ddl::tDataRepresentation eDefaultDataRepresentation=ddl::tDataRepresentation::Deserialized)
 Construct a new c Sample Codec Factory.
 
 cSampleCodecFactory (const ddl::DDStructure &oTypeDefinition, ddl::tDataRepresentation eDefaultDataRepresentation=ddl::tDataRepresentation::Deserialized)
 Construct a new c Sample Codec Factory.
 
 cSampleCodecFactory (const streaming::ant::IStreamType &oStreamType)
 Construct a new c Sample Codec Factory.
 
 cSampleCodecFactory (const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pStreamType)
 Construct a new c Sample Codec Factory.
 
 cSampleCodecFactory (const cSampleCodecFactory &)
 
 cSampleCodecFactory (cSampleCodecFactory &&)
 
cSampleCodecFactoryoperator= (const cSampleCodecFactory &)
 
cSampleCodecFactoryoperator= (cSampleCodecFactory &&)
 
tResult IsValid () const
 
cStaticSampleDecoder MakeStaticDecoderFor (const adtf::streaming::ISample &oSample, ddl::tDataRepresentation eDataRepresentation) const
 
cStaticSampleCodec MakeStaticCodecFor (adtf::streaming::ISample &oSample, ddl::tDataRepresentation eDataRepresentation) const
 
cSampleDecoder MakeDecoderFor (const adtf::streaming::ISample &oSample, ddl::tDataRepresentation eDataRepresentation) const
 
cSampleCodec MakeCodecFor (adtf::streaming::ISample &oSample, ddl::tDataRepresentation eDataRepresentation) const
 
tElement GetElement (const tCodecIndex &oCodecIndex) const
 
tElement GetElement (std::string_view strElementFullName) const
 
tElement GetChildElement (const tCodecIndex &oCodecIndex, std::string_view strElementPath)
 
const tElementsGetElements () const
 
size_t GetElementChildCount (const tCodecIndex &oCodecIndex) const
 
std::string GetElementFullName (const tCodecIndex &oCodecIndex) const
 Retrieves the full name of the element within its main structure.
 
std::string GetElementName (const tCodecIndex &oCodecIndex) const
 Retrieves the name of the element within its structured element.
 
const std::string & GetElementBaseName (const tCodecIndex &oCodecIndex) const
 Retrieves the base name of the element within its structured element.
 
size_t GetStaticBufferSize (ddl::tDataRepresentation eRep=ddl::tDataRepresentation::Deserialized) const
 Gets the static buffer size in bytes for the structure.
 
ddl::tDataRepresentation GetDefaultDataRepresentation () const
 
cStaticSampleDecoder MakeStaticDecoderFor (const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > &pSample, ddl::tDataRepresentation eDataRepresentation) const
 
cSampleDecoder MakeDecoderFor (const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > &pSample, ddl::tDataRepresentation eDataRepresentation) const
 
cStaticSampleCodec MakeStaticCodecFor (const adtf::ucom::iobject_ptr< adtf::streaming::ISample > &pSample, ddl::tDataRepresentation eDataRepresentation) const
 
cSampleCodec MakeCodecFor (const adtf::ucom::iobject_ptr< adtf::streaming::ISample > &pSample, ddl::tDataRepresentation eDataRepresentation) const
 
cStaticSampleDecoder MakeStaticDecoderFor (const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > &pSample) const
 
cSampleDecoder MakeDecoderFor (const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > &pSample) const
 
cStaticSampleCodec MakeStaticCodecFor (const adtf::ucom::iobject_ptr< adtf::streaming::ISample > &pSample) const
 
cSampleCodec MakeCodecFor (const adtf::ucom::iobject_ptr< adtf::streaming::ISample > &pSample) const
 
cStaticSampleDecoder MakeStaticDecoderFor (const adtf::streaming::ISample &oSample) const
 
cSampleDecoder MakeDecoderFor (const adtf::streaming::ISample &oSample) const
 
cStaticSampleCodec MakeStaticCodecFor (adtf::streaming::ISample &oSample) const
 
cSampleCodec MakeCodecFor (adtf::streaming::ISample &oSample) const
 
void Resolve (tCodecIndex &oCodecIndex) const
 
tCodecIndex Resolve (tCodecLeafIndex nElementLeafIndex) const
 
- Public Member Functions inherited from adtf::mediadescription::osborn::adtf_ddl_access::cCodecFactoryLegacy
tCodecIndex Resolve (tCodecLeafIndex nElementLeafIndex) const
 
size_t GetStaticElementCount () const
 Legacy: Gets the leaf count.
 
tResult GetStaticElement (tCodecLeafIndex nElementLeafIndex, const ddl::StructElement *&pElement) const
 
tCodecLeafIndex FindIndex (const char *strElementName) const
 Legacy: Retrieves the leaf index of the first element in the given element path.
 
tCodecLeafIndex FindArrayIndex (const char *strArrayName) const
 Legacy: Retrieves the leaf index of the first element in the given element path.
 
tCodecLeafIndex FindStructIndex (const char *strStructName) const
 Legacy: Retrieves the leaf index of the first element in the given element path.
 

Additional Inherited Members

- Static Public Member Functions inherited from adtf::mediadescription::osborn::adtf_ddl_access::cCodecFactoryLegacy
static const char * GetStaticStructElementName (const ddl::StructElement *pElement)
 

Detailed Description

Factory class for ddl codecs for samples.

Member Typedef Documentation

◆ tElement

◆ tElements

Constructor & Destructor Documentation

◆ cSampleCodecFactory() [1/9]

adtf::mediadescription::osborn::cSampleCodecFactory::cSampleCodecFactory ( )

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

◆ cSampleCodecFactory() [2/9]

adtf::mediadescription::osborn::cSampleCodecFactory::cSampleCodecFactory ( const char * strStructName,
const char * strMediaDescription,
ddl::tDataRepresentation eDefaultDataRepresentation = 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/9]

adtf::mediadescription::osborn::cSampleCodecFactory::cSampleCodecFactory ( const ddl::dd::StructType & oStruct,
const ddl::dd::DataDefinition & oParentDD,
ddl::tDataRepresentation eDefaultDataRepresentation = ddl::tDataRepresentation::Deserialized )

Constructor that uses an OO-DDL struct for initialization.

Parameters
[in]oStructThe struct definition.
[in]oParentDDThe parent data definition for the struct definition, used to resolve referenced types.
[in]eDefaultDataRepresentationThe representation used for the Make* factory methods without an parameter for the data representation.

◆ cSampleCodecFactory() [4/9]

adtf::mediadescription::osborn::cSampleCodecFactory::cSampleCodecFactory ( const std::pair< std::string, std::string > & oMDDescription,
ddl::tDataRepresentation eDefaultDataRepresentation = ddl::tDataRepresentation::Deserialized )

Construct a new c Sample Codec Factory.

Parameters
oMDDescriptionString pair of "struct_name", "data_description".
eDefaultDataRepresentationDefault data representation if creting a codec without representation value

◆ cSampleCodecFactory() [5/9]

adtf::mediadescription::osborn::cSampleCodecFactory::cSampleCodecFactory ( const ddl::DDStructure & oTypeDefinition,
ddl::tDataRepresentation eDefaultDataRepresentation = ddl::tDataRepresentation::Deserialized )

Construct a new c Sample Codec Factory.

Parameters
oTypeDefinitionData definition defined within a DDStructure.
eDefaultDataRepresentationDefault data representation if creting a codec without representation value

◆ cSampleCodecFactory() [6/9]

adtf::mediadescription::osborn::cSampleCodecFactory::cSampleCodecFactory ( const streaming::ant::IStreamType & oStreamType)

Construct a new c Sample Codec Factory.

Parameters
oStreamTypeStreamtype with set properties "md_struct" and "md_description".

◆ cSampleCodecFactory() [7/9]

adtf::mediadescription::osborn::cSampleCodecFactory::cSampleCodecFactory ( const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > & pStreamType)

Construct a new c Sample Codec Factory.

Parameters
pStreamTypeStreamtype with set properties "md_struct" and "md_description".

◆ cSampleCodecFactory() [8/9]

adtf::mediadescription::osborn::cSampleCodecFactory::cSampleCodecFactory ( const cSampleCodecFactory & )

Copy constructor

◆ cSampleCodecFactory() [9/9]

adtf::mediadescription::osborn::cSampleCodecFactory::cSampleCodecFactory ( cSampleCodecFactory && )

Move constructor

Member Function Documentation

◆ GetChildElement()

tElement adtf::mediadescription::osborn::cSampleCodecFactory::GetChildElement ( const tCodecIndex & oCodecIndex,
std::string_view strElementPath )

Retrieves an element for the given name.

Parameters
[in]oCodecIndexThe codec index of the parent element.
[in]strElementPathThe full name of the element in point notation (i.e. "element1.child_element[4].element_value").
Returns
tElement the child element found
Remarks
The element is only valid as long as the codec exists.
Exceptions
throwstResult if not found.

◆ GetDefaultDataRepresentation()

ddl::tDataRepresentation adtf::mediadescription::osborn::cSampleCodecFactory::GetDefaultDataRepresentation ( ) const

Returns the current default data representation whuke creating codec or decoder.

Returns
The default data representation.

◆ GetElement() [1/2]

tElement adtf::mediadescription::osborn::cSampleCodecFactory::GetElement ( const tCodecIndex & oCodecIndex) const

Retrieves an element for the codec index.

Parameters
[in]oCodecIndexThe codec index.
Returns
tElement the element
Remarks
The element is only valid as long as the factory exists.
Exceptions
throwstResult if not found.

◆ GetElement() [2/2]

tElement adtf::mediadescription::osborn::cSampleCodecFactory::GetElement ( std::string_view strElementFullName) const

Retrieves an element for the given name.

Parameters
[in]strElementFullNameThe full name of the element in point notation (i.e. "element1.child_element[4].element_value").
Returns
tElement the element
Remarks
The element is only valid as long as the factory exists.
Exceptions
throwstResult if not found.

◆ GetElementBaseName()

const std::string & adtf::mediadescription::osborn::cSampleCodecFactory::GetElementBaseName ( const tCodecIndex & oCodecIndex) const

Retrieves the base name of the element within its structured element.

If the element is an array you get the elements base name respresentation : "element_name" for each array element. If the element is not an array you get the elements name respresentation is also the base name respresentation: "element_name" .

Parameters
[in]oCodecIndexThe codec index of the element.
Returns
The base name of the element.
Exceptions
throwstResult if not found.

◆ GetElementChildCount()

size_t adtf::mediadescription::osborn::cSampleCodecFactory::GetElementChildCount ( const tCodecIndex & oCodecIndex) const

Retrieves the amount of child elements for the given codec index.

Parameters
[in]oCodecIndexThe codec index of the element.
Return values
0has no children. May be a leaf element.
>0has children. May be a structured element.
Exceptions
throwstResult if not found.

◆ GetElementFullName()

std::string adtf::mediadescription::osborn::cSampleCodecFactory::GetElementFullName ( const tCodecIndex & oCodecIndex) const

Retrieves the full name of the element within its main structure.

If the element is an array you get the elements array name respresentation: "main_element.element_name[0]" or main_element.element_name[1] ... etc. If the element is not an array you get the elements name respresentation: "main_element.element_name".

Parameters
[in]oCodecIndexThe codec index of the element.
Returns
The full name of the element in array representation depending on array size.
Exceptions
throwstResult if not found.

◆ GetElementName()

std::string adtf::mediadescription::osborn::cSampleCodecFactory::GetElementName ( const tCodecIndex & oCodecIndex) const

Retrieves the name of the element within its structured element.

If the element is an array you get the elements array name respresentation: "element_name[0]" or element_name[1] ... etc. If the element is not an array you get the elements name respresentation: "element_name".

Parameters
[in]oCodecIndexThe codec index of the element.
Returns
The name of the element in array representation depending on array size.
Exceptions
throwstResult if not found.

◆ GetElements()

const tElements & adtf::mediadescription::osborn::cSampleCodecFactory::GetElements ( ) const

Retrieves the elements of the factory to get element information.

Returns
tElements The elements iterator container.
See also
for_each_leaf_element
cSampleCodecFactory::tElement

◆ GetStaticBufferSize()

size_t adtf::mediadescription::osborn::cSampleCodecFactory::GetStaticBufferSize ( ddl::tDataRepresentation eRep = ddl::tDataRepresentation::Deserialized) const

Gets the static buffer size in bytes for the structure.

Parameters
eRepoption to retrieve size in bytes for the deserialized or serialized representation.
Return values
size_tsize in bytes of the structure depending on the given representation eRep

◆ IsValid()

tResult adtf::mediadescription::osborn::cSampleCodecFactory::IsValid ( ) const

Check if the factory is in a valid state.

Returns
Any errors during construction.

◆ MakeCodecFor() [1/4]

cSampleCodec adtf::mediadescription::osborn::cSampleCodecFactory::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.

◆ MakeCodecFor() [2/4]

cSampleCodec adtf::mediadescription::osborn::cSampleCodecFactory::MakeCodecFor ( adtf::streaming::ISample & oSample,
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.

◆ MakeCodecFor() [3/4]

cSampleCodec adtf::mediadescription::osborn::cSampleCodecFactory::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.

◆ MakeCodecFor() [4/4]

cSampleCodec adtf::mediadescription::osborn::cSampleCodecFactory::MakeCodecFor ( const adtf::ucom::iobject_ptr< adtf::streaming::ISample > & pSample,
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.

◆ MakeDecoderFor() [1/4]

cSampleDecoder adtf::mediadescription::osborn::cSampleCodecFactory::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.

◆ MakeDecoderFor() [2/4]

cSampleDecoder adtf::mediadescription::osborn::cSampleCodecFactory::MakeDecoderFor ( const adtf::streaming::ISample & oSample,
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.

◆ MakeDecoderFor() [3/4]

cSampleDecoder adtf::mediadescription::osborn::cSampleCodecFactory::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.

◆ MakeDecoderFor() [4/4]

cSampleDecoder adtf::mediadescription::osborn::cSampleCodecFactory::MakeDecoderFor ( const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > & pSample,
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.

◆ MakeStaticCodecFor() [1/4]

cStaticSampleCodec adtf::mediadescription::osborn::cSampleCodecFactory::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.

◆ MakeStaticCodecFor() [2/4]

cStaticSampleCodec adtf::mediadescription::osborn::cSampleCodecFactory::MakeStaticCodecFor ( adtf::streaming::ISample & oSample,
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.

◆ MakeStaticCodecFor() [3/4]

cStaticSampleCodec adtf::mediadescription::osborn::cSampleCodecFactory::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.

◆ MakeStaticCodecFor() [4/4]

cStaticSampleCodec adtf::mediadescription::osborn::cSampleCodecFactory::MakeStaticCodecFor ( const adtf::ucom::iobject_ptr< adtf::streaming::ISample > & pSample,
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.

◆ MakeStaticDecoderFor() [1/4]

cStaticSampleDecoder adtf::mediadescription::osborn::cSampleCodecFactory::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.

◆ MakeStaticDecoderFor() [2/4]

cStaticSampleDecoder adtf::mediadescription::osborn::cSampleCodecFactory::MakeStaticDecoderFor ( const adtf::streaming::ISample & oSample,
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.

◆ MakeStaticDecoderFor() [3/4]

cStaticSampleDecoder adtf::mediadescription::osborn::cSampleCodecFactory::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.

◆ MakeStaticDecoderFor() [4/4]

cStaticSampleDecoder adtf::mediadescription::osborn::cSampleCodecFactory::MakeStaticDecoderFor ( const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > & pSample,
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.

◆ operator=() [1/2]

cSampleCodecFactory & adtf::mediadescription::osborn::cSampleCodecFactory::operator= ( const cSampleCodecFactory & )

assignment operator

◆ operator=() [2/2]

cSampleCodecFactory & adtf::mediadescription::osborn::cSampleCodecFactory::operator= ( cSampleCodecFactory && )

Move assignment operator

◆ Resolve() [1/2]

void adtf::mediadescription::osborn::cSampleCodecFactory::Resolve ( tCodecIndex & oCodecIndex) const

retrieves the lyoutinformation for the given codec index.

Parameters
[in]oCodecIndexThe codec index of the element to retrieve.

◆ Resolve() [2/2]

tCodecIndex adtf::mediadescription::osborn::adtf_ddl_access::cCodecFactoryLegacy::Resolve ( tCodecLeafIndex nElementLeafIndex) const

Legacy: Retrieves a codec index with element information for the given leaf index.

Parameters
nElementLeafIndexThe leaf index (between 0 and GetElementCount())
Returns
The codec index for this element.
Exceptions
throwstResult if not found.
Deprecated
This is only provided for legacy reason. Use adtf::mediadescription::cSampleDecoder::GetElement instead

The documentation for this class was generated from the following file: