ADTF  3.18.2
builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/extern/pkg_ddl/include/adtfddl/serialization/serialization.h
Go to the documentation of this file.
1 
7 #ifndef _DDL_SERIALIZER_CLASS_HEADER_
8 #define _DDL_SERIALIZER_CLASS_HEADER_
9 
11 
12 namespace adtf_ddl
13 {
14 
15 namespace serialization
16 {
17 
24 template <typename Decoder, typename Encoder>
25 tResult transform(const Decoder& oDecoder, Encoder& oEncoder)
26 {
27  size_t nElementCount = oDecoder.GetElementCount();
28  assert(nElementCount == oEncoder.GetElementCount());
29  for (size_t nElement = 0; nElement < nElementCount; ++nElement)
30  {
31  uint64_t nBuffer = 0;
32  RETURN_IF_FAILED(oDecoder.GetElementValue(nElement, &nBuffer));
33  RETURN_IF_FAILED(oEncoder.SetElementValue(nElement, &nBuffer));
34  }
35 
37 }
38 
47 PKG_ADTF_DDL_DEPRECATED("Use ddl::serialization::transformToBuffer instead.")
48 tResult transform_to_buffer(const cDecoder& oDecoder, A_UTILS_NS::cMemoryBlock& oBuffer, bool bZero = false);
49 
50 }
51 
52 }
53 
54 #endif
#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.
ADTF A_UTIL Namespace - Within adtf this is used as adtf::util or adtf_util.
Definition: d_ptr.h:11
tResult transform_to_buffer(const cDecoder &oDecoder, A_UTILS_NS::cMemoryBlock &oBuffer, bool bZero=false)
Tranforms the data from a given decoder into the opposite data representation.
tResult transform(const Decoder &oDecoder, Encoder &oEncoder)
Copies all elements from a decoder to a codec.
Namespace for the mainpage_pkg_ddl.
Copyright © Audi Electronics Venture GmbH.
#define PKG_ADTF_DDL_DEPRECATED(_depr_message_)
Mark a function or variable as deprecated.