fesa-core  5.0.1
fesa::SharedMemoryAllocator Class Referenceabstract

#include <SharedMemoryAllocator.h>

Inherited by fesa::HeapAllocator, and fesa::MemoryMappedFileAllocator.

Public Member Functions

virtual void * allocate (const std::string &name, std::size_t size)=0
 
virtual void * map (const std::string &name, std::size_t size)=0
 
virtual void unmap (const std::string &name, void *buffer, std::size_t size)=0
 
virtual void destroy (const std::string &name)=0
 
virtual bool exists (const std::string &name) const =0
 

Detailed Description

Interface for shared memory allocators. A shared memory allocator is an object able to allocate memory which can be shared between processes (server/RT part of the framework).

Member Function Documentation

virtual void* fesa::SharedMemoryAllocator::allocate ( const std::string &  name,
std::size_t  size 
)
pure virtual

Allocates a named block of size bytes.

Parameters
namename of the block to allocate
sizesize, in bytes, of the block to allocate
Returns
pointer to the allocated block
virtual void fesa::SharedMemoryAllocator::destroy ( const std::string &  name)
pure virtual

De-allocates a named block and destroy it.

Parameters
namename of the block
virtual bool fesa::SharedMemoryAllocator::exists ( const std::string &  name) const
pure virtual
Returns
true if a block with such a name exists.
virtual void* fesa::SharedMemoryAllocator::map ( const std::string &  name,
std::size_t  size 
)
pure virtual

Maps size bytes of memory to a named block.

Parameters
\throwFesaException if no block with such a name exists
Exceptions
FesaExceptionif the mapping operation fails
Returns
pointer to the mapped block
virtual void fesa::SharedMemoryAllocator::unmap ( const std::string &  name,
void *  buffer,
std::size_t  size 
)
pure virtual

Removes an existing mapping on a named block.

Parameters
namename of the block
bufferpointer to the block
sizesize of the mapping

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