|
#include <ArmarXCore/core/services/sharedmemory/SharedMemoryConsumer.h>
Classes | |
class | Wrapper |
Public Types | |
using | pointer_type = std::shared_ptr< SharedMemoryConsumer< MemoryObject, MemoryObjectMetaInfo > > |
Pointer type for convenience. More... | |
Public Member Functions | |
MemoryObject * | getMemory () |
Retrieve pointer to shared memory. More... | |
MemoryObjectMetaInfo::PointerType | getMetaInfo (bool threadSafe=true) const |
SharedMemoryScopedReadLockPtr | getScopedReadLock () const |
Retrieve scoped lock to the shared memory for reading. More... | |
int | getSize () const |
Retrieve size of usable shared memory. More... | |
void | lock () |
Lock shared memory for reading. More... | |
SharedMemoryConsumer (std::string newMemoryName) | |
Creates a shared memory consumer. More... | |
void | unlock () |
Unlock shared memory after reading. More... | |
~SharedMemoryConsumer () | |
Destructs the shared memory consumer. More... | |
The SharedMemoryConsumer opens an existing shared memory segment for reading. It provides synchronized read access to the shared data. The memory content is an array of objects, where the object type is specified as template parameter. The SharedMemoryConsumer needs to be constructed, after a SharedMemoryProvider has been created.
Definition at line 55 of file SharedMemoryConsumer.h.
using pointer_type = std::shared_ptr<SharedMemoryConsumer<MemoryObject, MemoryObjectMetaInfo> > |
Pointer type for convenience.
Definition at line 245 of file SharedMemoryConsumer.h.
|
inline |
Creates a shared memory consumer.
memoryName | name of the memory as set in the SharedMemoryProvider |
SharedMemoryConnectionFailure |
Definition at line 77 of file SharedMemoryConsumer.h.
|
inline |
Destructs the shared memory consumer.
Definition at line 146 of file SharedMemoryConsumer.h.
|
inline |
Retrieve pointer to shared memory.
Use getScopedReadLock() or lock() / unlock() before reading from the memory.
Definition at line 194 of file SharedMemoryConsumer.h.
|
inline |
|
inline |
Retrieve scoped lock to the shared memory for reading.
Definition at line 205 of file SharedMemoryConsumer.h.
|
inline |
Retrieve size of usable shared memory.
Definition at line 158 of file SharedMemoryConsumer.h.
|
inline |
Lock shared memory for reading.
Definition at line 221 of file SharedMemoryConsumer.h.
|
inline |
Unlock shared memory after reading.
Definition at line 233 of file SharedMemoryConsumer.h.