The SharedMemoryConsumer opens an existing shared memory segment for reading.
More...
#include <ArmarXCore/core/services/sharedmemory/SharedMemoryConsumer.h>
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
class armarx::SharedMemoryConsumer< MemoryObject, MemoryObjectMetaInfo >
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.
◆ pointer_type
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
Initial value:
std::shared_ptr<SharedMemoryConsumer<MemoryObject, MemoryObjectMetaInfo>>
Pointer type for convenience.
◆ SharedMemoryConsumer()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
Creates a shared memory consumer.
- Parameters
-
- Exceptions
-
◆ ~SharedMemoryConsumer()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
Destructs the shared memory consumer.
◆ getMemory()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
| MemoryObject * getMemory |
( |
| ) |
|
|
inline |
Retrieve pointer to shared memory.
Use getScopedReadLock() or lock() / unlock() before reading from the memory.
- Returns
- pointer to the shared memory with type MemoryObject
◆ getMetaInfo()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
| MemoryObjectMetaInfo::PointerType getMetaInfo |
( |
bool | threadSafe = true | ) |
const |
|
inline |
◆ getScopedReadLock()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
Retrieve scoped lock to the shared memory for reading.
- Returns
- scoped lock to shared memory
◆ getSize()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
Retrieve size of usable shared memory.
- Returns
- size in bytes
◆ lock()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
Lock shared memory for reading.
◆ unlock()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
Unlock shared memory after reading.
The documentation for this class was generated from the following file: