libimgdoc2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
imgdoc2::DataObjectOnHeap Class Reference

An implementation of the IDataObjBase interface. This class allocates and owns memory on the heap. More...

#include <DataObjectImplementations.h>

Inheritance diagram for imgdoc2::DataObjectOnHeap:
imgdoc2::IDataObjBase

Public Member Functions

 DataObjectOnHeap (size_t size)
 
void GetData (const void **p, size_t *s) const override
 
const std::uint8_t * GetDataC () const
 Gets a const pointer to the data. The size of this buffer is given by "GetSizeOfData".
 
std::uint8_t * GetData ()
 Gets a pointer to the data. The size of this buffer is given by "GetSizeOfData".
 
size_t GetSizeOfData () const
 
 DataObjectOnHeap (const DataObjectOnHeap &)=delete
 
DataObjectOnHeapoperator= (const DataObjectOnHeap &)=delete
 
 DataObjectOnHeap (DataObjectOnHeap &&)=delete
 
DataObjectOnHeapoperator= (DataObjectOnHeap &&)=delete
 
virtual void GetData (const void **p, size_t *s) const =0
 

Detailed Description

An implementation of the IDataObjBase interface. This class allocates and owns memory on the heap.

Constructor & Destructor Documentation

◆ DataObjectOnHeap()

imgdoc2::DataObjectOnHeap::DataObjectOnHeap ( size_t  size)
inlineexplicit

Constructor which allocates the specified amount of data on the heap.

Parameters
sizeThe size of the buffer to allocate (in bytes).

Member Function Documentation

◆ GetData()

void imgdoc2::DataObjectOnHeap::GetData ( const void **  p,
size_t *  s 
) const
inlineoverridevirtual

Gets pointer to the data and its size. Passing in nullptr is valid if not interested in the respective return value.

Parameters
pIf non-null, the address of the data is put here.
[in,out]sIf non-null, the size of the data is put here.

Implements imgdoc2::IDataObjBase.

◆ GetSizeOfData()

size_t imgdoc2::DataObjectOnHeap::GetSizeOfData ( ) const
inline

Gets size of data in bytes.

Returns
The size of the data in bytes.

The documentation for this class was generated from the following file: