ADTF  3.18.2
adtf_memory_trivial_type< T, Enable >

Template class implementation for the IRawMemory interface for trivial types. More...

Inheritance diagram for adtf_memory_trivial_type< T, Enable >:
[legend]

Public Member Functions

 adtf_memory_trivial_type (T *pValuePointer)
 
tResult Set (const void *pValue, size_t szSize) override
 Sets the Raw pointer memory. More...
 
size_t GetSize () const override
 Returns the size in bytes of the memory. More...
 
const void * Get () const override
 Returns the raw memory pointer. More...
 

Private Attributes

T * m_pAssignedValue = nullptr
 

Detailed Description

template<typename T, typename Enable = void>
class adtf::base::penguin::adtf_memory_trivial_type< T, Enable >

Template class implementation for the IRawMemory interface for trivial types.

If the given type T is const the IRawMemory::Set call will fail! The IRawMemory interface is designed to exists only on stack as rvalue reference.

See Supported types for adtf_memory<T> for writing and reading Samples for supported trivial types

Template Parameters
Tthe Type of the memory implementation which can provide raw memory.
EnableEnabled if is a const layout type.
Remarks
The template will not detect the usage of pointers like i.e. uint8_t* since this type is trivial, too. So do not use it with pointers!

Definition at line 292 of file rawmemory_base.h.

Member Function Documentation

◆ Get()

const void* Get ( ) const
inlineoverridevirtual

Returns the raw memory pointer.

Returns
the pointer to the raw memory.

Implements IRawMemory.

Definition at line 337 of file rawmemory_base.h.

◆ GetSize()

size_t GetSize ( ) const
inlineoverridevirtual

Returns the size in bytes of the memory.

Returns
The size in bytes.

Implements IRawMemory.

Definition at line 325 of file rawmemory_base.h.

◆ Set()

tResult Set ( const void *  pValue,
size_t  szSize 
)
inlineoverridevirtual

Sets the Raw pointer memory.

Copy the content.

Parameters
[in]pValueraw memory pointer.
[in]szSizesize of memory to copy in bytes.
Returns
Standard Result Code.
Return values
ERR_MEMORYThe Memory does not fit.
ERR_POINTERInternal implementation error.

Implements IRawMemory.

Definition at line 307 of file rawmemory_base.h.

References RETURN_ERROR, RETURN_IF_POINTER_NULL, and RETURN_NOERROR.