|
lintel 0.2.0
|
#include <SharedMemoryService.h>
Additional Inherited Members | |
Protected Member Functions inherited from lintel::PropertyRegistration< SharedMemoryService > | |
| std::shared_ptr< Property< type > > | registerProperty (std::string name, type defaultValue, std::string description, bool runtime, const std::string &fileName, int32_t position) |
Protected Attributes inherited from lintel::AbstractService< T > | |
| std::vector< std::shared_ptr< PropertyBase > > | m_properties |
Service for managing shared memory segments and constructing data structures within them.
The service itself is boost free: everything that needs the boost interprocess types lives in ShmConstructors.h (free functions taking the service as first argument) and in ShmSegmentAccessor.h.
| lintel::SharedMemoryService::SharedMemoryService | ( | const std::shared_ptr< SharedMemorySegmentManager > & | sharedMemorySegmentManager, |
| std::shared_ptr< SchedulerService > | schedulerService, | ||
| const std::shared_ptr< ProcessName > & | processName | ||
| ) |
Construct a SharedMemoryService.
| sharedMemorySegmentManager | the segment manager providing segment definitions |
| schedulerService | the scheduler for periodic maintenance tasks |
| processName | the process name |
|
overridedefault |
| std::size_t lintel::SharedMemoryService::getGeneration | ( | ) | const |
Generation counter incremented on every grow/shrink. Repositories use it to detect that a segment was remapped and re-fetch their references.
| ShmSegmentAccessor lintel::SharedMemoryService::getSegmentAccessor | ( | const std::shared_ptr< SharedMemorySegment > & | segment | ) |
Get an accessor to allocate from the given shared memory segment. The returned accessor is a value type and stays valid as long as the segment is mapped by this service.
| segment | the shared memory segment |
| ShmSegmentNotFound | if the segment does not exist |
|
overridevirtual |
grows the size of the mentioned shared memory block
Implements lintel::ISharedMemoryService.
|
overridevirtual |
Initialize all shared memory segments by opening or creating them.
Reimplemented from lintel::AbstractService< T >.
| SharedMemorySegmentHandle & lintel::SharedMemoryService::segmentOf | ( | const std::string & | name | ) |
Get the allocated state of the named shared memory segment. Internal: the caller has to hold segmentsMutexOf().
| name | the name of the segment |
| ShmSegmentNotFound | if the segment does not exist |
|
inline |
|
inline |
|
overridevirtual |
shows state of the mentioned shared memory segment
| segment |
Implements lintel::ISharedMemoryService.
|
overridevirtual |
shrinks the shared memory size to the minimum
Implements lintel::ISharedMemoryService.