29 const void* pValueToSet,
30 const size_t szSizeToSet)
32 return pAssignValue->Set(pValueToSet, szSizeToSet);
35 static const void*
GetPtr(
const adtf_util::cMemoryBlock* pAssignValue)
37 return pAssignValue->GetPtr();
35 static const void*
GetPtr(
const adtf_util::cMemoryBlock* pAssignValue) {
…}
40 static size_t GetSize(
const adtf_util::cMemoryBlock* pAssignValue,
const size_t )
42 return static_cast<tSize>(pAssignValue->GetSize());
40 static size_t GetSize(
const adtf_util::cMemoryBlock* pAssignValue,
const size_t ) {
…}
54 const void* pValueToSet,
55 const size_t szSizeToSet)
57 return pAssignValue->Assign(pValueToSet, szSizeToSet);
59 static const void*
GetPtr(
const adtf_util::cMemoryPtr* pAssignValue)
61 return pAssignValue->GetPtr();
63 static size_t GetSize(
const adtf_util::cMemoryPtr* pAssignValue,
const size_t )
65 return static_cast<tSize>(pAssignValue->GetSize());
83 static const void*
GetPtr(
const void* pAssignValue)
87 static size_t GetSize(
const void* ,
const size_t szStaticSize)
99 size_t m_szCurrentSize =
g_npos;
103 const size_t szStaticSize,
104 const void* pValueToSet,
105 const size_t szSizeToSet)
107 if (szSizeToSet <= szStaticSize)
109 adtf_util::cMemoryBlock::MemCopy(pAssignValue, pValueToSet, szSizeToSet);
110 m_szCurrentSize = szSizeToSet;
118 static const void*
GetPtr(
const void* pAssignValue)
122 size_t GetSize(
const void* ,
const size_t szStaticSize)
const
124 if (m_szCurrentSize !=
g_npos)
126 return m_szCurrentSize;
146 static const void*
GetPtr(
const std::string* pAssignValue)
148 return static_cast<const void*
>(pAssignValue->data());
150 static size_t GetSize(
const std::string* pAssignValue,
const size_t )
153 return pAssignValue->size();
171 static const void*
GetPtr(
const std::u16string* pAssignValue)
173 return static_cast<const void*
>(pAssignValue->data());
175 static size_t GetSize(
const std::u16string* pAssignValue,
const size_t )
177 return pAssignValue->size() *
sizeof(
typename std::u16string::value_type);
189 const void* pValueToSet,
190 const size_t szSizeToSet)
194 const auto pValuePtr =
static_cast<const typename std::string::value_type*
>(pValueToSet);
195 pAssignValue->reserve(szSizeToSet);
196 pAssignValue->assign(pValuePtr, szSizeToSet);
200 static const void*
GetPtr(
const std::string* pAssignValue)
202 return static_cast<const void*
>(pAssignValue->data());
204 static size_t GetSize(
const std::string* pAssignValue,
const size_t )
207 return pAssignValue->size();
219 const void* pValueToSet,
220 const size_t szSizeToSet)
224 const auto pValuePtr =
static_cast<const typename std::u16string::value_type*
>(pValueToSet);
225 pAssignValue->reserve(szSizeToSet /
sizeof(
typename std::u16string::value_type));
226 pAssignValue->assign(pValuePtr, szSizeToSet /
sizeof(
typename std::u16string::value_type));
230 static const void*
GetPtr(
const std::u16string* pAssignValue)
232 return static_cast<const void*
>(pAssignValue->data());
234 static size_t GetSize(
const std::u16string* pAssignValue,
const size_t )
237 return pAssignValue->size() *
sizeof(
typename std::u16string::value_type);
243template<
typename... Args>
249 const void* pValueToSet,
250 const size_t szSizeToSet)
252 static_assert(std::is_trivially_copyable<
typename std::vector<Args...>::value_type>::value,
253 "only trivial types are allowed for adtf_memory_forward with vector");
254 pAssignValue->resize(szSizeToSet /
sizeof(
typename std::vector<Args...>::value_type));
255 if (pAssignValue->size() *
sizeof(
typename std::vector<Args...>::value_type) == szSizeToSet)
257 adtf_util::cMemoryBlock::MemCopy(pAssignValue->data(), pValueToSet, szSizeToSet);
265 static const void*
GetPtr(
const std::vector<Args...>* pAssignValue)
267 return pAssignValue->data();
269 static size_t GetSize(
const std::vector<Args...>* pAssignValue,
const size_t )
271 return pAssignValue->size() *
sizeof(
typename std::vector<Args...>::value_type);
278template<
typename... Args>
289 static const void*
GetPtr(
const std::vector<Args...>* pAssignValue)
291 static_assert(std::is_trivially_copyable<
typename std::vector<Args...>::value_type>::value,
292 "only trivial types are allowed for adtf_memory_forward with vector");
293 return static_cast<const void*
>(pAssignValue->data());
295 static size_t GetSize(
const std::vector<Args...>* pAssignValue,
const size_t )
297 return pAssignValue->size() *
sizeof(
typename std::vector<Args...>::value_type);
310 m_fnForward(std::move(fnForward))
324 const void*
Get()
const override
324 const void*
Get()
const override {
…}
335using spider::cRawMemoryRedirect;
346#define adtf_memory_intf(__utils_memblock__) adtf::base::adtf_memory<adtf_util::cMemoryBlock>(& (__utils_memblock__))
size_t tSize
type definition for a array size values, map size values etc.
constexpr tSize g_npos
npos size declaration
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
#define RETURN_ERROR(code)
Return specific error code, which requires the calling function's return type to be tResult.
The IRawMemory interface provides methods for getting and setting memory values through abstract inte...
tResult Set(const void *pValue, size_t szSize) override
Sets the Raw pointer memory.
size_t GetSize() const override
Returns the size in bytes of the memory.
const void * Get() const override
Returns the raw memory pointer.
Namespace for all functionality of the ADTF Base SDK provided since v3.0.
Namespace for all functionality of the ADTF Base SDK provided since v3.18.
Namespace for the ADTF Base SDK.
ADTF adtf_util Namespace - Within adtf this is used as util or adtf_util and also defined as A_UTILS_...
Namespace for entire ADTF SDK.
Copyright © Audi Electronics Venture GmbH.
static tResult Assign(adtf_util::cMemoryBlock *pAssignValue, const size_t, const void *pValueToSet, const size_t szSizeToSet)
Sets (copy) the memory value pValueToSet of size in bytes szSizeToSet to the of container class T in ...
static size_t GetSize(const adtf_util::cMemoryBlock *pAssignValue, const size_t)
Gets size in bytes of the memory pointer of container class T in parameter pAssignValue.
static const void * GetPtr(const adtf_util::cMemoryBlock *pAssignValue)
Gets the memory pointer to the of container class T in parameter pAssignValue.
Concept template class for non trivial adtf_memory types of type T to specialize the usage of adtf_me...
static tResult Assign(T *pAssignValue, const size_t szStaticSize, const void *pValueToSet, const size_t szSizeToSet)
Sets (copy) the memory value pValueToSet of size in bytes szSizeToSet to the of container class T in ...
static size_t GetSize(const T *pAssignValue, const size_t szStaticSize)
Gets size in bytes of the memory pointer of container class T in parameter pAssignValue.
static const void * GetPtr(const T *pAssignValue)
Gets the memory pointer to the of container class T in parameter pAssignValue.