ADTF
Loading...
Searching...
No Matches
adtf_memory_trivial_type< T, Enable >

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

#include <rawmemory_base.h>

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.
 
size_t GetSize () const override
 Returns the size in bytes of the memory.
 
const void * Get () const override
 Returns the raw memory pointer.
 

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.

Constructor & Destructor Documentation

◆ adtf_memory_trivial_type()

template<typename T, typename Enable = void>
adtf_memory_trivial_type ( T * pValuePointer)
inlineexplicit

Definition at line 295 of file rawmemory_base.h.

Member Function Documentation

◆ Get()

template<typename T, typename Enable = void>
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()

template<typename T, typename Enable = void>
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()

template<typename T, typename Enable = void>
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.

Member Data Documentation

◆ m_pAssignedValue

template<typename T, typename Enable = void>
T* m_pAssignedValue = nullptr
private

Definition at line 343 of file rawmemory_base.h.