The SharedMemoryProvider creates a shared memory segment for writing.
More...
#include <ArmarXCore/core/services/sharedmemory/SharedMemoryProvider.h>
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
class armarx::SharedMemoryProvider< MemoryObject, MemoryObjectMetaInfo >
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.
◆ pointer_type
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
Initial value:
std::shared_ptr<SharedMemoryProvider<MemoryObject, MemoryObjectMetaInfo>>
Pointer type for convenience.
◆ SharedMemoryProvider()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
| SharedMemoryProvider |
( |
const std::string & | newMemoryName, |
|
|
typename MemoryObjectMetaInfo::PointerType | info ) |
|
inline |
Creates a shared memory provider.
- Parameters
-
| memoryName | name of the memory for identification in the SharedMemoryConsumer |
| numberElements | number of elements of type MemoryObject stored in the memory |
- Exceptions
-
◆ ~SharedMemoryProvider()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
Destructs the shared memory provider.
Removes the shared memory object of not used by another process.
◆ getCapacity()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
| int getCapacity |
( |
| ) |
const |
|
inline |
Retrieve size of usable shared memory.
- Returns
- size in bytes
◆ getMemory()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
| MemoryObject * getMemory |
( |
| ) |
const |
|
inline |
◆ getMetaInfo()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
| MemoryObjectMetaInfo * getMetaInfo |
( |
| ) |
const |
|
inline |
◆ getScopedReadLock()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
Retrieve scoped lock to the shared memory for reading.
- Returns
- shared scoped lock to shared memory
◆ getScopedWriteLock()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
Retrieve scoped lock to the shared memory for writing.
- Returns
- scoped lock to shared memory
◆ getSize()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
Retrieve size of actual used shared memory.
- Returns
- size in bytes
◆ lock()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
Lock shared memory for writing.
◆ setMetaInfo()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
| void setMetaInfo |
( |
const typename MemoryObjectMetaInfo::PointerType & | info, |
|
|
bool | threadSafe = false ) |
|
inline |
◆ unlock()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
Unlock shared memory after writing.
The documentation for this class was generated from the following file: