The IceSharedMemoryProvider provides data via Ice or shared memory.
More...
#include <ArmarXCore/core/services/sharedmemory/IceSharedMemoryProvider.h>
|
| MemoryObject * | getBuffer () |
| | Retrieve pointer to buffer.
|
| |
| Blob | getData () |
| |
| Blob | getData (MetaInfoSizeBasePtr &info, const Ice::Current &c=Ice::emptyCurrent) override |
| | return data via ice.
|
| |
| MemoryObjectMetaInfo::PointerType | getMetaInfo (bool threadSafe=true) const |
| | getMetaInfo returns a copy of the memory object information
|
| |
| MetaInfoSizeBasePtr | getMetaInfo (const Ice::Current &c) const override |
| | getMetaInfo returns a copy of the memory object information
|
| |
| SharedMemoryScopedReadLockPtr | getScopedReadLock () const |
| |
| SharedMemoryScopedWriteLockPtr | getScopedWriteLock () const |
| | Retrieve scoped lock for writing to the memory.
|
| |
| int | getSize (const Ice::Current &c=Ice::emptyCurrent) override |
| | return memory size via ice.
|
| |
| | IceSharedMemoryProvider (ManagedIceObject *object, int size, int capacity=0, std::string nameSuffix="") |
| | Creates an ice shared memory provider which transparentely communicates using shared memory on local machines and using Ice on remote machines.
|
| |
| | IceSharedMemoryProvider (ManagedIceObject *object, typename MemoryObjectMetaInfo::PointerType info, std::string nameSuffix="") |
| |
| void | lock () |
| | lock memory for writing
|
| |
| void | setMetaInfo (const typename MemoryObjectMetaInfo::PointerType &info, bool threadSafe=true) |
| |
| void | start () |
| | Starts the memory provider.
|
| |
| void | stop () |
| | Removes this object from Ice.
|
| |
| void | unlock () |
| | unlock memory after writing
|
| |
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
class armarx::IceSharedMemoryProvider< MemoryObject, MemoryObjectMetaInfo >
The IceSharedMemoryProvider provides data via Ice or shared memory.
Whether Ice or shared memory is used for data transfer is determined based on the hardware id of the machine. The provider should be constructed in the onInit method and started in the onStart method.
Use the getScopedWriteLock() or lock() / unlock() methods before writing to the memory.
Definition at line 51 of file IceSharedMemoryProvider.h.
◆ pointer_type
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
◆ IceSharedMemoryProvider() [1/2]
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
Creates an ice shared memory provider which transparentely communicates using shared memory on local machines and using Ice on remote machines.
- Parameters
-
| component | pointer to component |
| numberElements | number of elements of type MemoryObject stored in the memory |
- Exceptions
-
Definition at line 65 of file IceSharedMemoryProvider.h.
◆ IceSharedMemoryProvider() [2/2]
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
◆ ~IceSharedMemoryProvider()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
◆ getBuffer()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
| MemoryObject * getBuffer |
( |
| ) |
|
|
inline |
Retrieve pointer to buffer.
This buffer should only be used for writing. Before writing do not forget to lock the provider using either lock() and unlock() or getScopedLock()
- Returns
- pointer to the shared memory segment
Definition at line 155 of file IceSharedMemoryProvider.h.
◆ getData() [1/2]
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
◆ getData() [2/2]
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
| Blob getData |
( |
MetaInfoSizeBasePtr & | info, |
|
|
const Ice::Current & | c = Ice::emptyCurrent ) |
|
inlineoverride |
◆ getMetaInfo() [1/2]
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
| MemoryObjectMetaInfo::PointerType getMetaInfo |
( |
bool | threadSafe = true | ) |
const |
|
inline |
◆ getMetaInfo() [2/2]
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
| MetaInfoSizeBasePtr getMetaInfo |
( |
const Ice::Current & | c | ) |
const |
|
inlineoverride |
◆ getScopedReadLock()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
◆ getScopedWriteLock()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
◆ getSize()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
| int getSize |
( |
const Ice::Current & | c = Ice::emptyCurrent | ) |
|
|
inlineoverride |
◆ lock()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
◆ setMetaInfo()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
| void setMetaInfo |
( |
const typename MemoryObjectMetaInfo::PointerType & | info, |
|
|
bool | threadSafe = true ) |
|
inline |
◆ start()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
Starts the memory provider.
The component needs to be connected, otherwise method will fail.
- Exceptions
-
Definition at line 118 of file IceSharedMemoryProvider.h.
◆ stop()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
Removes this object from Ice.
Call this if you want to use a sharedmemory with the same name again.
Definition at line 134 of file IceSharedMemoryProvider.h.
◆ unlock()
template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
The documentation for this class was generated from the following file: