IceSharedMemoryConsumer< MemoryObject, MemoryObjectMetaInfo > Class Template Reference

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

+ Inheritance diagram for IceSharedMemoryConsumer< MemoryObject, MemoryObjectMetaInfo >:

Public Types

using pointer_type = IceUtil::Handle< IceSharedMemoryConsumer< MemoryObject, MemoryObjectMetaInfo > >
 pointer type for convenience. More...
 

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. More...
 
const std::string & getMemoryName () const
 
MemoryObjectMetaInfo::PointerType getMetaInfo () const
 
int getSize () const
 Retrieve size of the data. More...
 
TransferMode getTransferMode ()
 Retrieve transfer mode. More...
 
 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. More...
 
void setTransferMode (TransferMode mode)
 Change the transfer mode. More...
 
void start ()
 Starts the memory consumer. More...
 

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. More...
 

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.

Definition at line 50 of file IceSharedMemoryConsumer.h.

Member Typedef Documentation

◆ pointer_type

using pointer_type = IceUtil::Handle<IceSharedMemoryConsumer<MemoryObject, MemoryObjectMetaInfo> >

pointer type for convenience.

Definition at line 209 of file IceSharedMemoryConsumer.h.

Constructor & Destructor Documentation

◆ IceSharedMemoryConsumer()

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

Definition at line 64 of file IceSharedMemoryConsumer.h.

Member Function Documentation

◆ getData() [1/2]

void getData ( std::vector< MemoryObject > &  data)
inline

Definition at line 130 of file IceSharedMemoryConsumer.h.

◆ getData() [2/2]

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

Retrieve the data provided by the IceSharedMemoryProvider.

Exceptions
SharedMemoryException

Definition at line 142 of file IceSharedMemoryConsumer.h.

◆ getMemoryName()

const std::string& getMemoryName ( ) const
inline

Definition at line 76 of file IceSharedMemoryConsumer.h.

◆ getMetaInfo()

MemoryObjectMetaInfo::PointerType getMetaInfo ( ) const
inline

Definition at line 154 of file IceSharedMemoryConsumer.h.

◆ getSize()

int getSize ( ) const
inline

Retrieve size of the data.

Returns
size of the memory in bytes

Definition at line 173 of file IceSharedMemoryConsumer.h.

◆ getTransferMode()

TransferMode getTransferMode ( )
inline

Retrieve transfer mode.

Returns
transfer mode

Definition at line 201 of file IceSharedMemoryConsumer.h.

◆ setTransferMode()

void setTransferMode ( TransferMode  mode)
inline

Change the transfer mode.

Parameters
modethe new transfer mode

Definition at line 191 of file IceSharedMemoryConsumer.h.

◆ start()

void start ( )
inline

Starts the memory consumer.

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

Exceptions
SharedMemoryException

Definition at line 86 of file IceSharedMemoryConsumer.h.

+ Here is the call graph for this function:

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