soma-io  5.0.5
soma::LowLevelAllocator Class Referenceabstract

Abstract base class for actual allocators types. More...

#include <soma-io/allocator/allocator.h>

Inheritance diagram for soma::LowLevelAllocator:

Public Member Functions

virtual ~LowLevelAllocator ()
 
virtual char * allocate (size_t n, size_t elemsize, DataSource *datasource) const =0
 
virtual void deallocate (char *ptr, size_t n, size_t elemsize) const =0
 
virtual bool canDuplicate () const
 

Protected Member Functions

 LowLevelAllocator ()
 

Detailed Description

Abstract base class for actual allocators types.

All subclasses of LowLevelAllocator are singletons, which each provide a singleton() static method to access their unique instance.

Todo:
The LowLevelAllocator API should use pointers of type void* instead of char*, because the type of contained objects is not specified. This would remove the need to reinterpret_cast, which is prone to error.

Definition at line 62 of file allocator.h.

Constructor & Destructor Documentation

◆ ~LowLevelAllocator()

virtual soma::LowLevelAllocator::~LowLevelAllocator ( )
virtual

◆ LowLevelAllocator()

soma::LowLevelAllocator::LowLevelAllocator ( )
inlineprotected

Definition at line 74 of file allocator.h.

Referenced by soma::MappingRWAllocator::canDuplicate().

Member Function Documentation

◆ allocate()

virtual char* soma::LowLevelAllocator::allocate ( size_t  n,
size_t  elemsize,
DataSource datasource 
) const
pure virtual

◆ canDuplicate()

virtual bool soma::LowLevelAllocator::canDuplicate ( ) const
inlinevirtual

Reimplemented in soma::MappingRWAllocator.

Definition at line 71 of file allocator.h.

◆ deallocate()

virtual void soma::LowLevelAllocator::deallocate ( char *  ptr,
size_t  n,
size_t  elemsize 
) const
pure virtual

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