ADTF  3.14.3
adtf::mediadescription::osborn Namespace Reference

Namespace for all functionality provided since v3.14. More...

Classes

class  decoding_sample_reader
 This reader uses the media description to decode sample data. More...
 
class  cSampleWithCodec
 Helper class that combines a Sample Codec with a Sample instance. More...
 
class  encoding_sample_writer
 Sample Writer that provides samples that can be updated via a Codec. More...
 
class  cDumper
 Dumps a structure definition to an output stream. More...
 
class  cDDLPrinter
 Generates a DDL description from a structure definition. More...
 
struct  description
 Template to provide struct name and definition for a generated struct. More...
 
struct  indices
 Internal helper class. More...
 
class  md_sample_data
 Template to provide media description based access to Sample data. More...
 
class  md_array
 This class is used to wrap access to arrays of plain and enum types. More...
 
class  md_struct_array
 This class is used to wrap access to arrays of struct types. More...
 
class  md_sample_data_factory
 This factory provides instances of md_sample_data for incoming samples. More...
 
class  cSampleDecoderBase
 Decoder Base Class. More...
 
class  cStaticSampleDecoder
 Decoder for samples with static data content. More...
 
class  cStaticSampleCodec
 Codec for samples with static data content. More...
 
class  cSampleDecoder
 Decoder for samples with static and/or dynamic data. More...
 
class  cSampleCodec
 Codec for samples with static and/or dynamic data. More...
 
class  cSampleCodecFactory
 Factory class for ddl codecs for samples. More...
 
class  sample_decoder_access
 Implementation for decoder access concept (ddl::codec::DecoderElementAccess). More...
 
class  sample_codec_access
 Implementation for codec access concept (ddl::codec::CodecElementAccess). More...
 
class  sample_codec_factory_access
 Implementation for codec access concept (ddl::codec::FactoryElementAccess). More...
 
class  enumeration
 This is used to create an enumeration ytpe from an existing c++ enum. More...
 
class  structure
 This is used to create a structure type from an existing c++ struct definition. More...
 
class  structure< void >
 This is used to create a structure type independently. More...
 

Typedefs

using tCodecLeafIndex = size_t
 Leaf Index Type for the coders (is between 0 and getElementCount()). More...
 
using tCodecIndex = ddl::codec::CodecIndex
 Fast Access Index Type for the coders. More...
 

Functions

std::ostream & operator<< (std::ostream &oStream, const cDumper &oDumper)
 
std::ostream & operator<< (std::ostream &oStream, const cDDLPrinter &oPrinter)
 
template<typename ElementsType >
void for_each_leaf_element (ElementsType &oElements, const std::function< void(std::conditional_t< std::is_const< ElementsType >::value, const typename ElementsType::element_type, typename ElementsType::element_type > &)> &fnCallback)
 Iterates ALL leaf elements within ALL array elements. More...
 
template<typename T >
std::vector< tCodecIndexget_codec_indices (const T &oDecoderOrFactory)
 Get the codec indices object. More...
 
template<typename ElementsType >
void for_each_element (ElementsType &oElements, const std::function< void(std::conditional_t< std::is_const< ElementsType >::value, const typename ElementsType::element_type, typename ElementsType::element_type > &)> &fnCallback)
 Iterates elements without array elements (also structures). More...
 
template<typename T >
adtf_util::cVariant get_value_as_variant (const T &oDecoder, const tCodecIndex &oCodecIndex)
 Get value as variant. More...
 

Detailed Description

Namespace for all functionality provided since v3.14.

Typedef Documentation

◆ tCodecIndex

Fast Access Index Type for the coders.

The Codec Index ist a vector of element indexes {{[element_index=0][array_pos]},{[element_sub_index][array_pos]}} pairs to access the elements of one level in a fast way. You can access leafs and elements at each level.

See also
for_each_leaf_element, for_each_element, or the GetElements() of each codec or decoder.
The Codec Index and the Element Iterator

Definition at line 35 of file sample_codec_access_types.h.

◆ tCodecLeafIndex

using tCodecLeafIndex = size_t

Leaf Index Type for the coders (is between 0 and getElementCount()).

This leaf index includes all leafs (known ddl::dd::PrefefinedDataTypes and UserTypes). If the leaf is an array the i.e. of 5 x uint8_t Value there are 5 Leafs.

See also
The Codec Leaf Index

Definition at line 25 of file sample_codec_access_types.h.

Function Documentation

◆ for_each_element()

void adtf::mediadescription::osborn::for_each_element ( ElementsType &  oElements,
const std::function< void(std::conditional_t< std::is_const< ElementsType >::value, const typename ElementsType::element_type, typename ElementsType::element_type > &)> &  fnCallback 
)

Iterates elements without array elements (also structures).

Usage:

//strDescription contains a data description where "my_struct" is defined
struct my_sub_struct
{
uint32_t sub_element[3];
uint32_t sub_element_after;
}
struct my_struct
{
my_sub_struct element[2];
}
cSampleCodecFactory oFactory("my_struct", strDescription);
for_each_element(oFactory.GetElements(),
[](const auto& oElement) {
std::cout << oElement.getFullName() << std::endl;
std::cout << oElement.getName() << std::endl;
std::cout << oElement.getBaseName() << std::endl;
std::cout << oElement.getArraySize() << std::endl;
});
//following output:
//"element[0]"
//"element[0]"
//"element"
//"2"
//"element[0].sub_element[0]"
//"sub_element[0]"
//"sub_element"
//"3"
//"element[0].sub_element_after"
//"sub_element_after"
//"sub_element_after"
//"1"
void for_each_element(ElementsType &oElements, const std::function< void(std::conditional_t< std::is_const< ElementsType >::value, const typename ElementsType::element_type, typename ElementsType::element_type > &)> &fnCallback)
Iterates elements without array elements (also structures).
Template Parameters
ElementsTypeThe type of elements.
Parameters
elementsThe elements
funcThe function to call per leaf element
See also
cSampleCodecFactory::GetElements, cSampleCodec::GetElements, cSampleDecoder::GetElements, cStaticSampleCodec::GetElements, cStaticSampleDecoder::GetElements
The Codec Index and the Element Iterator

Definition at line 1226 of file sample_codec.h.

◆ for_each_leaf_element()

void adtf::mediadescription::osborn::for_each_leaf_element ( ElementsType &  oElements,
const std::function< void(std::conditional_t< std::is_const< ElementsType >::value, const typename ElementsType::element_type, typename ElementsType::element_type > &)> &  fnCallback 
)

Iterates ALL leaf elements within ALL array elements.

Usage:

//strDescription contains a data description where "my_struct" is defined
struct my_sub_struct
{
uint32_t sub_element[3];
uint32_t sub_element_after;
}
struct my_struct
{
my_sub_struct element[2];
}
cSampleCodecFactory oFactory("my_struct", strDescription);
for_each_leaf_element(oFactory.GetElements(),
[](const auto& oElement) {
std::cout << oElement.getFullName() << std::endl;
});
//following output:
//"element[0].sub_element[0]"
//"element[0].sub_element[1]"
//"element[0].sub_element[2]"
//"element[0].sub_element_after"
//"element[1].sub_element[0]"
//"element[1].sub_element[1]"
//"element[1].sub_element[2]"
//"element[1].sub_element_after"
void for_each_leaf_element(ElementsType &oElements, const std::function< void(std::conditional_t< std::is_const< ElementsType >::value, const typename ElementsType::element_type, typename ElementsType::element_type > &)> &fnCallback)
Iterates ALL leaf elements within ALL array elements.
Template Parameters
ElementsTypeThe type of elements.
Parameters
oElementsThe elements
fnCallbackThe function to call per leaf element
See also
cSampleCodecFactory::GetElements, cSampleCodec::GetElements, cSampleDecoder::GetElements, cStaticSampleCodec::GetElements, cStaticSampleDecoder::GetElements
The Codec Index and the Element Iterator

Definition at line 1121 of file sample_codec.h.

Referenced by get_codec_indices().

◆ get_codec_indices()

std::vector<tCodecIndex> adtf::mediadescription::osborn::get_codec_indices ( const T &  oDecoderOrFactory)

Get the codec indices object.

Template Parameters
TThe type of the decoder or factory to retrieve all indices from.
Parameters
oDecoderOrFactoryThe decoder or factory to retrieve all indices from.
Returns
std::vector<tCodecIndex>

Definition at line 1170 of file sample_codec.h.

References for_each_leaf_element().

◆ get_value_as_variant()

adtf_util::cVariant adtf::mediadescription::osborn::get_value_as_variant ( const T &  oDecoder,
const tCodecIndex oCodecIndex 
)

Get value as variant.

This is for your convenience!

Template Parameters
TThe decoder type
Parameters
oDecoderThe decoder to retrieve the value from
oCodecIndexthe codec index for the value
Returns
adtf_util::cVariant

Definition at line 1251 of file sample_codec.h.

References ddl::codec::cet_bool, ddl::codec::cet_double, ddl::codec::cet_float, ddl::codec::cet_int16, ddl::codec::cet_int32, ddl::codec::cet_int64, ddl::codec::cet_int8, ddl::codec::cet_uint16, ddl::codec::cet_uint32, ddl::codec::cet_uint64, ddl::codec::cet_uint8, and CodecIndex::getType().


Copyright © Audi Electronics Venture GmbH. All rights reserved. (Generated on Thu Jun 9 2022 by doxygen 1.9.1)