|
#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 88 of file SharedMemoryProvider.h.
using pointer_type = std::shared_ptr<SharedMemoryProvider<MemoryObject, MemoryObjectMetaInfo> > |
Pointer type for convenience.
Definition at line 335 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 106 of file SharedMemoryProvider.h.
|
inline |
Destructs the shared memory provider.
Removes the shared memory object of not used by another process.
Definition at line 195 of file SharedMemoryProvider.h.
|
inline |
Retrieve size of usable shared memory.
Definition at line 270 of file SharedMemoryProvider.h.
|
inline |
Retrieve pointer to shared memory.
Use getScopedWriteLock() or lock() / unlock() before writing to the memory.
Definition at line 206 of file SharedMemoryProvider.h.
|
inline |
Definition at line 211 of file SharedMemoryProvider.h.
|
inline |
Retrieve scoped lock to the shared memory for reading.
Definition at line 298 of file SharedMemoryProvider.h.
|
inline |
Retrieve scoped lock to the shared memory for writing.
Definition at line 281 of file SharedMemoryProvider.h.
|
inline |
Retrieve size of actual used shared memory.
Definition at line 259 of file SharedMemoryProvider.h.
|
inline |
Lock shared memory for writing.
Definition at line 313 of file SharedMemoryProvider.h.
|
inline |
Definition at line 217 of file SharedMemoryProvider.h.
|
inline |
Unlock shared memory after writing.
Definition at line 324 of file SharedMemoryProvider.h.