31 static constexpr const tChar *
const MetaTypeName =
"adtf/plaintype";
81 RETURN_IF_FAILED(oTypeToCheck.
GetConfig(pCheckProperties));
83 RETURN_IF_FAILED(oTypeExpected.
GetConfig(pExpectedProperties));
88 if (strCheckPlainType != strExpectedPlainType)
91 "The destination plain type '%s' differs from the source plain type '%s'",
92 strCheckPlainType.GetPtr(),
93 strExpectedPlainType.GetPtr());
113 "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");
122#define ADTF_DEFINE_STREAM_TYPE_PLAIN_FOR( _thetype_ , _propval_ ) \
124class stream_type_plain<_thetype_> : public cStreamType \
127 static constexpr const char *const PlainTypeValue = _propval_; \
128 static constexpr const char* const PlainTypeName = #_thetype_; \
129 stream_type_plain() : cStreamType(stream_meta_type_plain()) \
131 adtf::ucom::object_ptr<adtf::base::ant::IProperties> pProperties; \
132 THROW_IF_FAILED(GetConfig(pProperties)); \
133 pProperties->SetProperty(adtf::base::property<adtf_util::cString>(stream_meta_type_plain::PlainTypeProperty, PlainTypeValue)); \
134 pProperties->SetProperty(adtf::base::property<adtf_util::cString>("md_definitions",\
135 adtf_util::cString::Format(R"(<struct name=")" _propval_ R"(" alignment="1" version="1">)" \
136 R"(<element name="value" arraysize="1" type=")" #_thetype_ R"(">)" \
137 R"(<deserialized alignment="1"/>)" \
138 R"(<serialized bytepos="0" byteorder="%s"/>)" \
141 PLATFORM_BYTEORDER == PLATFORM_BIG_ENDIAN_8 ? "BE" : "LE"))); \
142 pProperties->SetProperty(adtf::base::property<adtf_util::cString>("md_struct", _propval_));\
204ADTF3_DEPRECATED(
"Use adtf::ucom::make_object_ptr<stream_type_plain<T>>() instead.")
228 static constexpr const char*
const ArraySize =
"array_size";
243 const auto ui8CurrentPlatformOrder = PLATFORM_BYTEORDER;
244 if (ui8CurrentPlatformOrder != PLATFORM_LITTLE_ENDIAN_8)
265 RETURN_IF_FAILED(oTypeToCheck.
GetConfig(pCheckProperties));
267 RETURN_IF_FAILED(oTypeExpected.
GetConfig(pExpectedProperties));
272 if (strCheckPlainType != strExpectedPlainType)
275 "The checked plain type '%s' differs from the expected plain type '%s'",
276 strCheckPlainType.GetPtr(),
277 strExpectedPlainType.GetPtr());
280 const auto uiExpectedDataEndianess
282 if (uiCheckDataEndianess != uiExpectedDataEndianess)
284 if (strCheckPlainType !=
"UINT8" && strCheckPlainType !=
"INT8" && strCheckPlainType !=
"BOOL" && strCheckPlainType !=
"UINT8_ARRAY" && strCheckPlainType !=
"INT8_ARRAY" && strCheckPlainType !=
"BOOL_ARRAY")
287 "The checked plain type '%s' differs from the expected plain type '%s' in endianess",
288 strCheckPlainType.GetPtr(),
289 strExpectedPlainType.GetPtr());
295 if (uiCheckArraySize < uiExpectedArraySize)
299 "The checked plain type '%s' array size (%zu) is lower than the expected plain type '%s' array size (%zu)",
300 strCheckPlainType.GetPtr(), uiCheckArraySize, strExpectedPlainType.GetPtr(), uiExpectedArraySize);
324 const auto ui8CurrentPlatformOrder = PLATFORM_BYTEORDER;
325 if (ui8CurrentPlatformOrder != PLATFORM_LITTLE_ENDIAN_8)
327 pProperties->SetProperty(
340template<
typename ValueType,
size_t szArraySize,
template<
typename,
size_t>
class T>
341class stream_type_plain<T<ValueType, szArraySize>> :
public cStreamType
343 static_assert(std::is_arithmetic_v<typename T<ValueType, szArraySize>::value_type>,
344 "std::array can only be used for arithmetic types");
353 const adtf_util::cString strPropValue = adtf_util::cString::Format(
355 const adtf_util::cString strPropTypeName(
ant::stream_type_plain<
typename T<ValueType, szArraySize>::value_type>::PlainTypeName);
360 const adtf_util::cString strMDDefValue = adtf_util::cString::Format(R
"(<struct name="%s" alignment="1" version="1">
361 <element name="value" arraysize="%zu" type="%s">
362 <deserialized alignment="1"/>
363 <serialized bytepos="0" byteorder="%s"/>
365</struct>)", strPropValue.GetPtr(), szArraySize,
366 strPropTypeName.GetPtr(),
367 PLATFORM_BYTEORDER == PLATFORM_BIG_ENDIAN_8 ? "BE" :
"LE");
381template<
class ValueType,
size_t szArraySize>
393ADTF3_DEPRECATED(
"Use adtf::ucom::make_object_ptr<stream_type_plain<T>>() instead.")
402using penguin::stream_meta_type_plain;
405using penguin::stream_type_plain;
#define ADTF3_DEPRECATED(_depr_message_)
Definition adtf_base_deprecated.h:27
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
Definition result.h:736
#define RETURN_ERROR_DESC(_code,...)
Same as RETURN_ERROR(_error) using a printf like parameter list for detailed error description.
Definition result.h:44
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
Definition result.h:29
#define THROW_IF_FAILED(s)
throws if the expression returns a failed tResult
Definition result.h:88
Definition properties_v2.h:283
Defines access methods for the interface of a Stream Type.
Definition streamtype_intf.h:96
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)
Generator template to create an instance of a ant::IStreamType class for ant::stream_meta_type_plain ...
Definition streammetatypeplain.h:111
stream_type_plain()
CTOR.
Definition streammetatypeplain.h:318
stream_type_plain()
Definition streammetatypeplain.h:318
Definition object_ptr.h:384
constexpr bool always_false
helper template to get a always false expression.
Definition adtf_base_type_traits.h:23
VALUETYPE get_property(const IConfiguration &oConfiguration, const char *strNameOfValue, VALUETYPE oDefaultValue)
Get the property content converted to the VALUETYPE.
Definition configuration.h:291
Namespace for all functionality of the ADTF Streaming SDK provided since v3.0.
Definition bindingproxyoutport.h:16
Namespace for all functionality of the ADTF Streaming SDK provided since v3.11.
Definition streammetatypeaudio.h:76
ucom::ant::object_ptr< ant::IStreamType > create_adtf_plain_stream_type()
Definition streammetatypeplain.h:205
ucom::ant::object_ptr< ant::IStreamType > create_adtf_plain_stream_type()
Definition streammetatypeplain.h:394
Namespace for the ADTF Streaming SDK.
Definition bindingproxyinport.h:14
object_ptr< Implementation > make_object_ptr(Args &&... args)
Create an instance of type object_ptr with Implementation as the shared resource.
Definition object_ptr_utilities.h:129
Namespace for the ADTF uCOM SDK.
Definition adtf_system.h:324
ant::iobject_ptr< T > iobject_ptr
Alias always bringing the latest version of ant::iobject_ptr into scope.
Definition object_ptr_intf.h:437
Namespace for all functionality provided by ADTF and its SDKs.
Definition adtf_client_connector.h:14