96 if (strCheckPlainType != strExpectedPlainType)
99 "The destination plain type '%s' differs from the source plain type '%s'",
100 strCheckPlainType.GetPtr(),
101 strExpectedPlainType.GetPtr());
121 "Use bool, uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double or plain array T[], std::array, std::vector of them");
130#define ADTF_DEFINE_STREAM_TYPE_PLAIN_FOR( _thetype_ , _propval_ ) \
132class stream_type_plain<_thetype_> : public cStreamType \
135 static constexpr const char *const PlainTypeValue = _propval_; \
136 static constexpr const char* const PlainTypeName = #_thetype_; \
137 stream_type_plain() : cStreamType(stream_meta_type_plain()) \
139 adtf::ucom::object_ptr<adtf::base::ant::IProperties> pProperties; \
140 THROW_IF_FAILED(GetConfig(pProperties)); \
141 pProperties->SetProperty(adtf::base::property<adtf_util::cString>(stream_meta_type_plain::PlainTypeProperty, PlainTypeValue)); \
142 pProperties->SetProperty(adtf::base::property<adtf_util::cString>("md_definitions",\
143 adtf_util::cString::Format(R"(<struct name=")" _propval_ R"(" alignment="1" version="1">)" \
144 R"(<element name="value" arraysize="1" type=")" #_thetype_ R"(">)" \
145 R"(<deserialized alignment="1"/>)" \
146 R"(<serialized bytepos="0" byteorder="%s"/>)" \
149 PLATFORM_BYTEORDER == PLATFORM_BIG_ENDIAN_8 ? "BE" : "LE"))); \
150 pProperties->SetProperty(adtf::base::property<adtf_util::cString>("md_struct", _propval_));\
130#define ADTF_DEFINE_STREAM_TYPE_PLAIN_FOR( _thetype_ , _propval_ ) \ …
211ADTF3_DEPRECATED(
"Use adtf::ucom::make_object_ptr<stream_type_plain<T>>() instead!")
237 static constexpr const char*
const ArraySize =
"array_size";
287 if (strCheckPlainType != strExpectedPlainType)
290 "The checked plain type '%s' differs from the expected plain type '%s'",
291 strCheckPlainType.GetPtr(),
292 strExpectedPlainType.GetPtr());
295 const auto uiExpectedDataEndianess
297 if (uiCheckDataEndianess != uiExpectedDataEndianess)
299 if (strCheckPlainType !=
"UINT8" && strCheckPlainType !=
"INT8" && strCheckPlainType !=
"BOOL" && strCheckPlainType !=
"UINT8_ARRAY" && strCheckPlainType !=
"INT8_ARRAY" && strCheckPlainType !=
"BOOL_ARRAY")
302 "The checked plain type '%s' differs from the expected plain type '%s' in endianess",
303 strCheckPlainType.GetPtr(),
304 strExpectedPlainType.GetPtr());
310 if (uiCheckArraySize < uiExpectedArraySize)
314 "The checked plain type '%s' array size (%zu) is lower than the expected plain type '%s' array size (%zu)",
315 strCheckPlainType.GetPtr(), uiCheckArraySize, strExpectedPlainType.GetPtr(), uiExpectedArraySize);
344 pProperties->SetProperty(
357template<
typename ValueType,
size_t szArraySize,
template<
typename,
size_t>
class T>
358class stream_type_plain<T<ValueType, szArraySize>> :
public cStreamType
360 static_assert(std::is_arithmetic_v<typename T<ValueType, szArraySize>::value_type>,
361 "std::array can only be used for arithmetic types");
370 const adtf_util::cString strPropValue = adtf_util::cString::Format(
372 const adtf_util::cString strPropTypeName(
ant::stream_type_plain<
typename T<ValueType, szArraySize>::value_type>::PlainTypeName);
377 const adtf_util::cString strMDDefValue = adtf_util::cString::Format(R
"(<struct name="%s" alignment="1" version="1">
378 <element name="value" arraysize="%zu" type="%s">
379 <deserialized alignment="1"/>
380 <serialized bytepos="0" byteorder="%s"/>
382</struct>)", strPropValue.GetPtr(), szArraySize,
383 strPropTypeName.GetPtr(),
358class stream_type_plain<T<ValueType, szArraySize>> :
public cStreamType {
…};
398template<
class ValueType,
size_t szArraySize>
409ADTF3_DEPRECATED(
"Use adtf::ucom::make_object_ptr<stream_type_plain<T>>() instead!")
418using penguin::stream_meta_type_plain;
421using penguin::stream_type_plain;
unsigned long tUInt32
type definition for unsigned integer values (32bit) (platform and compiler independent type).
unsigned char tUInt8
type definition for unsigned integer values (8bit) (platform and compiler independent type).
unsigned int tUInt16
type definition for unsigned integer values (16bit) (platform and compiler independent type).
signed int tInt16
type definition for signed integer values (16bit) (platform and compiler independent type).
signed char tInt8
type definition for signed integer values (8bit) (platform and compiler independent type).
signed long tInt32
type definition for signed integer values (32bit) (platform and compiler independent type).
Copyright © Audi Electronics Venture GmbH.
#define ADTF3_DEPRECATED(_depr_message_)
Mark a function or variable as deprecated.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.
char tChar
The tChar defines the type for platform character set (platform and compiler dependent type).
int64_t tInt64
type definition for signed integer values (64bit) (platform and compiler independent type).
float tFloat32
type definition for Float32 (32bit float values) (platform and compiler independent type).
double tFloat64
type definition for Float64 (64bit double values) (platform and compiler independent type).
bool tBool
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent).
uint64_t tUInt64
type definition for unsigned integer values (64bit) (platform and compiler independent type).
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
#define RETURN_ERROR_DESC(_code,...)
Same as RETURN_ERROR(_error) using a printf like parameter list for detailed error description.
#define RETURN_IF_FAILED(s)
Return if expression is failed, which requires the calling function's return type to be tResult.
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
Defines access methods for the interface of a Stream Type - see also Stream Type and Stream Meta Type...
virtual tResult GetConfig(ucom::ant::iobject_ptr< base::ant::IProperties > &pProperties)=0
Get all properties of a Stream Type (read/write)
tResult GetConfig(adtf::ucom::iobject_ptr< base::ant::IProperties > &pProperties) override
Get all properties of a Stream Type (read/write)
cStreamType()
Default CTOR.
Generator template to create an instance of a IStreamType class for stream_meta_type_plain ("adtf/pla...
#define PLATFORM_BIG_ENDIAN_8
defines the big endianess value, that will be retrieved by
#define PLATFORM_BYTEORDER
defines a link to __get_platform_byteorder.
#define PLATFORM_LITTLE_ENDIAN_8
defines the little endianess value, that will be retrieved by
constexpr bool always_false
helper template to get a always false expression.
VALUETYPE get_property(const IConfiguration &oConfiguration, const char *strNameOfValue, VALUETYPE oDefaultValue)
Get the property content converted to the VALUETYPE.
Namespace for all functionality of the ADTF Streaming SDK provided since v3.0.
Namespace for all functionality of the ADTF Streaming SDK provided since v3.11.
ucom::ant::object_ptr< ant::IStreamType > create_adtf_plain_stream_type()
Convenience functionality to create a stream type plain - see Stream Meta Type "adtf/plaintype".
ucom::ant::object_ptr< ant::IStreamType > create_adtf_plain_stream_type()
Convenience functionality to create a stream type plain - see Stream Meta Type "adtf/plaintype".
Namespace for the ADTF Streaming SDK.
object_ptr< Implementation > make_object_ptr(Args &&... args)
Create an instance of type object_ptr with Implementation as the shared resource.
Namespace for the ADTF uCOM3 SDK.
ant::iobject_ptr< T > iobject_ptr
Alias always bringing the latest version of ant::iobject_ptr into scope.
Namespace for entire ADTF SDK.
Copyright © Audi Electronics Venture GmbH.
#define THROW_IF_FAILED(s)
throws if the expression returns a failed tResult