|
#include <ArmarXCore/core/services/sharedmemory/IceSharedMemoryProvider.h>
Public Types | |
using | pointer_type = IceUtil::Handle< IceSharedMemoryProvider< MemoryObject, MemoryObjectMetaInfo > > |
pointer type for convenience. More... | |
Public Member Functions | |
MemoryObject * | getBuffer () |
Retrieve pointer to buffer. More... | |
Blob | getData () |
Blob | getData (MetaInfoSizeBasePtr &info, const Ice::Current &c=Ice::emptyCurrent) override |
return data via ice. More... | |
MemoryObjectMetaInfo::PointerType | getMetaInfo (bool threadSafe=true) const |
getMetaInfo returns a copy of the memory object information More... | |
MetaInfoSizeBasePtr | getMetaInfo (const Ice::Current &c) const override |
getMetaInfo returns a copy of the memory object information More... | |
SharedMemoryScopedReadLockPtr | getScopedReadLock () const |
SharedMemoryScopedWriteLockPtr | getScopedWriteLock () const |
Retrieve scoped lock for writing to the memory. More... | |
int | getSize (const Ice::Current &c=Ice::emptyCurrent) override |
return memory size via ice. More... | |
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. More... | |
IceSharedMemoryProvider (ManagedIceObject *object, typename MemoryObjectMetaInfo::PointerType info, std::string nameSuffix="") | |
void | lock () |
lock memory for writing More... | |
void | setMetaInfo (const typename MemoryObjectMetaInfo::PointerType &info, bool threadSafe=true) |
void | start () |
Starts the memory provider. More... | |
void | stop () |
Removes this object from Ice. More... | |
void | unlock () |
unlock memory after writing More... | |
Protected Member Functions | |
~IceSharedMemoryProvider () override | |
Protected Member Functions inherited from HardwareIdentifierProvider | |
std::string | getHardwareId (const Ice::Current &c=Ice::emptyCurrent) override |
Retrieve machine's hardware Id string. More... | |
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 50 of file IceSharedMemoryProvider.h.
using pointer_type = IceUtil::Handle<IceSharedMemoryProvider<MemoryObject, MemoryObjectMetaInfo> > |
pointer type for convenience.
Definition at line 273 of file IceSharedMemoryProvider.h.
|
inline |
Creates an ice shared memory provider which transparentely communicates using shared memory on local machines and using Ice on remote machines.
component | pointer to component |
numberElements | number of elements of type MemoryObject stored in the memory |
SharedMemoryException |
Definition at line 64 of file IceSharedMemoryProvider.h.
|
inline |
Definition at line 88 of file IceSharedMemoryProvider.h.
|
inlineoverrideprotected |
Definition at line 99 of file IceSharedMemoryProvider.h.
|
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()
Definition at line 144 of file IceSharedMemoryProvider.h.
|
inline |
Definition at line 215 of file IceSharedMemoryProvider.h.
|
inlineoverride |
return data via ice.
Definition at line 201 of file IceSharedMemoryProvider.h.
|
inline |
getMetaInfo returns a copy of the memory object information
Definition at line 243 of file IceSharedMemoryProvider.h.
|
inlineoverride |
getMetaInfo returns a copy of the memory object information
Definition at line 256 of file IceSharedMemoryProvider.h.
|
inline |
Definition at line 169 of file IceSharedMemoryProvider.h.
|
inline |
Retrieve scoped lock for writing to the memory.
Definition at line 156 of file IceSharedMemoryProvider.h.
|
inlineoverride |
return memory size via ice.
Definition at line 264 of file IceSharedMemoryProvider.h.
|
inline |
lock memory for writing
Definition at line 185 of file IceSharedMemoryProvider.h.
|
inline |
Definition at line 228 of file IceSharedMemoryProvider.h.
|
inline |
Starts the memory provider.
The component needs to be connected, otherwise method will fail.
SharedMemoryException |
Definition at line 112 of file IceSharedMemoryProvider.h.
|
inline |
Removes this object from Ice.
Call this if you want to use a sharedmemory with the same name again.
Definition at line 124 of file IceSharedMemoryProvider.h.
|
inline |
unlock memory after writing
Definition at line 193 of file IceSharedMemoryProvider.h.