|
#include <ArmarXCore/core/services/sharedmemory/SharedMemoryProvider.h>
Classes | |
class | Wrapper |
Public Types | |
using | pointer_type = std::shared_ptr< SharedMemoryProvider< MemoryObject, MemoryObjectMetaInfo > > |
Pointer type for convenience. More... | |
Public Member Functions | |
int | getCapacity () const |
Retrieve size of usable shared memory. More... | |
MemoryObject * | getMemory () const |
Retrieve pointer to shared memory. More... | |
MemoryObjectMetaInfo * | getMetaInfo () const |
SharedMemoryScopedReadLockPtr | getScopedReadLock () const |
Retrieve scoped lock to the shared memory for reading. More... | |
SharedMemoryScopedWriteLockPtr | getScopedWriteLock () const |
Retrieve scoped lock to the shared memory for writing. More... | |
int | getSize () const |
Retrieve size of actual used shared memory. More... | |
void | lock () |
Lock shared memory for writing. More... | |
void | setMetaInfo (const typename MemoryObjectMetaInfo::PointerType &info, bool threadSafe=false) |
SharedMemoryProvider (const std::string &newMemoryName, typename MemoryObjectMetaInfo::PointerType info) | |
Creates a shared memory provider. More... | |
void | unlock () |
Unlock shared memory after writing. More... | |
~SharedMemoryProvider () | |
Destructs the shared memory provider. More... | |
The SharedMemoryProvider creates a shared memory segment for writing. It provides synchronized write access to the shared data. The memory content is an array of objects, where the object type is specified as template parameter. The SharedMemoryProvider needs to be constructed, before a SharedMemoryConsumer can be created.
Definition at line 90 of file SharedMemoryProvider.h.
using pointer_type = std::shared_ptr<SharedMemoryProvider<MemoryObject, MemoryObjectMetaInfo> > |
Pointer type for convenience.
Definition at line 365 of file SharedMemoryProvider.h.
|
inline |
Creates a shared memory provider.
memoryName | name of the memory for identification in the SharedMemoryConsumer |
numberElements | number of elements of type MemoryObject stored in the memory |
SharedMemoryException |
Definition at line 113 of file SharedMemoryProvider.h.
|
inline |
Destructs the shared memory provider.
Removes the shared memory object of not used by another process.
Definition at line 215 of file SharedMemoryProvider.h.
|
inline |
Retrieve size of usable shared memory.
Definition at line 296 of file SharedMemoryProvider.h.
|
inline |
Retrieve pointer to shared memory.
Use getScopedWriteLock() or lock() / unlock() before writing to the memory.
Definition at line 227 of file SharedMemoryProvider.h.
|
inline |
Definition at line 233 of file SharedMemoryProvider.h.
|
inline |
Retrieve scoped lock to the shared memory for reading.
Definition at line 325 of file SharedMemoryProvider.h.
|
inline |
Retrieve scoped lock to the shared memory for writing.
Definition at line 307 of file SharedMemoryProvider.h.
|
inline |
Retrieve size of actual used shared memory.
Definition at line 285 of file SharedMemoryProvider.h.
|
inline |
Lock shared memory for writing.
Definition at line 341 of file SharedMemoryProvider.h.
|
inline |
Definition at line 239 of file SharedMemoryProvider.h.
|
inline |
Unlock shared memory after writing.
Definition at line 353 of file SharedMemoryProvider.h.