Raytrix Light Field SDK  5.0
Rx::IAllocator Class Referenceabstract

Detailed Description

A memory allocator.

Public Member Functions

 IAllocator ()=default
 Default constructor. More...
 
virtual ~IAllocator ()=default
 Destructor. More...
 
virtual void * Allocate (std::size_t nSizeInBytes)=0
 Allocates nSizeInBytes of raw memory. More...
 
virtual void Deallocate (void *pvPtr, std::size_t nSizeInBytes)=0
 Deallocates nSizeInBytes of raw memory starting at pPtr. More...
 

Protected Member Functions

 IAllocator (const IAllocator &)=default
 Copy constructor. More...
 
 IAllocator (IAllocator &&) noexcept=default
 Move constructor. More...
 
IAllocatoroperator= (const IAllocator &)=default
 Assignment operator. More...
 
IAllocatoroperator= (IAllocator &&) noexcept=default
 Assignment operator. More...
 

Constructor & Destructor Documentation

◆ IAllocator() [1/3]

Rx::IAllocator::IAllocator ( )
default

Default constructor.

◆ ~IAllocator()

virtual Rx::IAllocator::~IAllocator ( )
virtualdefault

Destructor.

◆ IAllocator() [2/3]

Rx::IAllocator::IAllocator ( const IAllocator )
protecteddefault

Copy constructor.

Parameters
parameter1The first parameter.

◆ IAllocator() [3/3]

Rx::IAllocator::IAllocator ( IAllocator &&  )
protecteddefaultnoexcept

Move constructor.

Parameters
parameter1[in,out] The first parameter.

Member Function Documentation

◆ Allocate()

virtual void* Rx::IAllocator::Allocate ( std::size_t  nSizeInBytes)
pure virtual

Allocates nSizeInBytes of raw memory.

Parameters
nSizeInBytesThe size of the allocation in bytes.
Returns
Null if it fails, else the pointer at which the allocation starts.

◆ Deallocate()

virtual void Rx::IAllocator::Deallocate ( void *  pvPtr,
std::size_t  nSizeInBytes 
)
pure virtual

Deallocates nSizeInBytes of raw memory starting at pPtr.

If the pointer is null, this operation is a noop.

Parameters
pvPtr[in,out] If non-null, the pointer at which the allocation starts.
nSizeInBytesThe size of the allocation in bytes.

◆ operator=() [1/2]

IAllocator& Rx::IAllocator::operator= ( const IAllocator )
protecteddefault

Assignment operator.

Parameters
parameter1The first parameter.
Returns
A shallow copy of this object.

◆ operator=() [2/2]

IAllocator& Rx::IAllocator::operator= ( IAllocator &&  )
protecteddefaultnoexcept

Assignment operator.

Parameters
parameter1[in,out] The first parameter.
Returns
A shallow copy of this object.