IceSharedMemoryConsumer< MemoryObject, MemoryObjectMetaInfo > Class Template Reference

The IceSharedMemoryConsumer reads data via Ice or shared memory. More...

#include <ArmarXCore/core/services/sharedmemory/IceSharedMemoryConsumer.h>

+ Inheritance diagram for IceSharedMemoryConsumer< MemoryObject, MemoryObjectMetaInfo >:

Public Types

using pointer_type
 pointer type for convenience.
 

Public Member Functions

void getData (std::vector< MemoryObject > &data)
 
void getData (std::vector< MemoryObject > &data, typename MemoryObjectMetaInfo::PointerType &info)
 Retrieve the data provided by the IceSharedMemoryProvider.
 
const std::string & getMemoryName () const
 
MemoryObjectMetaInfo::PointerType getMetaInfo () const
 
int getSize () const
 Retrieve size of the data.
 
TransferMode getTransferMode ()
 Retrieve transfer mode.
 
 IceSharedMemoryConsumer (ManagedIceObject *object, std::string providerName, std::string nameSuffix="")
 Creates an ice shared memory consumer which transparentely communicates using shared memory on local machines and using Ice on remote machines.
 
void setTransferMode (TransferMode mode)
 Change the transfer mode.
 
void start ()
 Starts the memory consumer.
 

Additional Inherited Members

- Protected Member Functions inherited from HardwareIdentifierProvider
std::string getHardwareId (const Ice::Current &c=Ice::emptyCurrent) override
 Retrieve machine's hardware Id string.
 

Detailed Description

template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
class armarx::IceSharedMemoryConsumer< MemoryObject, MemoryObjectMetaInfo >

The IceSharedMemoryConsumer reads 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 consumer should be constructed in the onInit method and started in the onStart method. The correct initialization of the provider is guaranteed by the component dependency mechanism. If shared memory consumers are constructed elsewhere, the user has to assure, that the remote component is already running.

Member Typedef Documentation

◆ pointer_type

template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
using pointer_type
Initial value:

pointer type for convenience.

Constructor & Destructor Documentation

◆ IceSharedMemoryConsumer()

template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
IceSharedMemoryConsumer ( ManagedIceObject * object,
std::string providerName,
std::string nameSuffix = "" )
inline

Creates an ice shared memory consumer which transparentely communicates using shared memory on local machines and using Ice on remote machines.

Parameters
componentpointer to component
providerNamename of ice object that provides that owns the IceSharedMemoryProvider
Exceptions
SharedMemoryException

Member Function Documentation

◆ getData() [1/2]

template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
void getData ( std::vector< MemoryObject > & data)
inline

◆ getData() [2/2]

template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
void getData ( std::vector< MemoryObject > & data,
typename MemoryObjectMetaInfo::PointerType & info )
inline

Retrieve the data provided by the IceSharedMemoryProvider.

Exceptions
SharedMemoryException

◆ getMemoryName()

template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
const std::string & getMemoryName ( ) const
inline

◆ getMetaInfo()

template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
MemoryObjectMetaInfo::PointerType getMetaInfo ( ) const
inline

◆ getSize()

template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
int getSize ( ) const
inline

Retrieve size of the data.

Returns
size of the memory in bytes

◆ getTransferMode()

template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
TransferMode getTransferMode ( )
inline

Retrieve transfer mode.

Returns
transfer mode

◆ setTransferMode()

template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
void setTransferMode ( TransferMode mode)
inline

Change the transfer mode.

Parameters
modethe new transfer mode

◆ start()

template<class MemoryObject, class MemoryObjectMetaInfo = MetaInfoSizeBase>
void start ( )
inline

Starts the memory consumer.

The component needs to be connected, otherwise method will fail.

Exceptions
SharedMemoryException

The documentation for this class was generated from the following file: