lintel 0.2.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
lintel::BoostSegmentAllocator Class Referencefinal

#include <BoostSegmentAllocator.h>

Inheritance diagram for lintel::BoostSegmentAllocator:
lintel::ShmSegmentAccessor::Allocator

Public Member Functions

 BoostSegmentAllocator (boost::interprocess::managed_mapped_file::segment_manager &segment)
 
void * allocate (std::size_t bytes) override
 
void deallocate (void *pointer) override
 
- Public Member Functions inherited from lintel::ShmSegmentAccessor::Allocator
virtual ~Allocator ()=default
 

Detailed Description

Allocator adapter that binds ShmSegmentAccessor to the boost interprocess segment manager. This is the only translation unit boundary where the two meet; SharedMemoryService.cpp and the examples keep the boost includes, all other users of ShmSegmentAccessor stay boost free.

The allocator has to outlive every accessor created from it, because accessors stored in shared memory objects dereference it lazily.

Constructor & Destructor Documentation

◆ BoostSegmentAllocator()

lintel::BoostSegmentAllocator::BoostSegmentAllocator ( boost::interprocess::managed_mapped_file::segment_manager &  segment)
inlineexplicit
Parameters
segmentsegment manager of the mapped shared memory file

Member Function Documentation

◆ allocate()

void * lintel::BoostSegmentAllocator::allocate ( std::size_t  bytes)
inlineoverridevirtual
Parameters
bytesto allocate
Returns
pointer to the allocated block

Implements lintel::ShmSegmentAccessor::Allocator.

◆ deallocate()

void lintel::BoostSegmentAllocator::deallocate ( void *  pointer)
inlineoverridevirtual
Parameters
pointerblock previously returned by allocate

Implements lintel::ShmSegmentAccessor::Allocator.


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