ArmarXManager Class Reference

Main class of an ArmarX process. More...

#include <ArmarXCore/core/ArmarXManager.h>

+ Inheritance diagram for ArmarXManager:

Public Member Functions

void addObject (const ManagedIceObjectPtr &object, bool addWithOwnAdapter=true, const std::string &objectName="", bool useOwnScheduleThread=true) override
 Add a ManagedIceObject to the manager.
 
virtual void addObject (const ManagedIceObjectPtr &object, const std::string &objectName, bool addWithOwnAdapter=true, bool useOwnScheduleThread=true)
 
virtual void addObject (const ManagedIceObjectPtr &object, Ice::ObjectAdapterPtr objectAdapterToAddTo, const std::string &objectName="", bool useOwnScheduleThread=true)
 
virtual void addObjectAsync (const ManagedIceObjectPtr &object, const std::string &objectName, bool addWithOwnAdapter=true, bool useOwnScheduleThread=true)
 
 ArmarXManager (std::string applicationName, const Ice::CommunicatorPtr &communicator)
 Constructs an ArmarXManager by passing a communicator.
 
 ArmarXManager (std::string applicationName, int port=4061, std::string host="localhost", std::string locatorName="IceGrid/Locator", Ice::StringSeq args=Ice::StringSeq())
 ArmarXManager constructor.
 
void asyncShutdown (std::size_t timeoutMs=0)
 Calls shutdown() after a timeout.
 
bool checkIceConnection (bool printHint=true) const
 
template<class Function>
RemoteReferenceCountControlBlockPtr< Function > createRemoteReferenceCount (Function f, const std::string &id="", IceUtil::Time deletionDelay=IceUtil::Time::seconds(3), IceUtil::Time orphantDeletionDelay=IceUtil::Time::seconds(6), long heartBeatMs=1000)
 
template<class Function, class Data>
RemoteReferenceCountControlBlockPtr< Function, Data > createRemoteReferenceCount (Function f, Data d, const std::string &id="", IceUtil::Time deletionDelay=IceUtil::Time::seconds(3), IceUtil::Time orphantDeletionDelay=IceUtil::Time::seconds(6), long heartBeatMs=1000)
 
template<class Function>
SimpleRemoteReferenceCountControlBlockPtr< Function > createSimpleRemoteReferenceCount (Function f, const std::string &id="", IceUtil::Time deletionDelay=IceUtil::Time::seconds(3))
 
template<class Function, class Data>
SimpleRemoteReferenceCountControlBlockPtr< Function, Data > createSimpleRemoteReferenceCount (Function f, Data d, const std::string &id="", IceUtil::Time deletionDelay=IceUtil::Time::seconds(3))
 
void enableLogging (bool enable)
 Enable or disable logging.
 
void enableProfiling (bool enable)
 Enable or disable profiling of CPU Usage.
 
const Ice::ObjectAdapterPtr & getAdapter () const
 
ObjectPropertyInfos getApplicationPropertyInfos (const ::Ice::Current &) override
 
const Ice::CommunicatorPtr & getCommunicator () const
 
std::string getHostname (const Ice::Current &c=Ice::emptyCurrent) override
 Gets the hostname of the host running the manager.
 
const IceManagerPtr & getIceManager () const
 Retrieve the instance of the icemanager.
 
Ice::StringSeq getManagedObjectNames (const Ice::Current &c=Ice::emptyCurrent) override
 Retrieve the names of all ManagedIceObject.
 
std::vector< ManagedIceObjectPtr > getManagedObjects () override
 Retrieve pointers to all ManagedIceObject.
 
StringVariantBaseMap getMetaInfo (const std::string &, const Ice::Current &) override
 
IceMX::MetricsAdminPrx getMetricsAdmin (const Ice::Current &=Ice::emptyCurrent) override
 
mice::MiceObjectConnectivity getMiceObjectConnectivity (const std::string &objectName, const Ice::Current &c=Ice::emptyCurrent) override
 Retrieve connectivity of a ManagedIceObject.
 
ManagedIceObjectConnectivity getObjectConnectivity (const std::string &objectName, const Ice::Current &c=Ice::emptyCurrent) override
 Retrieve connectivity of a ManagedIceObject.
 
Ice::StringSeq getObjectNames (const Ice::Current &c=Ice::emptyCurrent) override
 Retrieve the names of all ManagedIceObject.
 
::armarx::StringStringDictionary getObjectProperties (const ::std::string &objectName, const ::Ice::Current &=Ice::emptyCurrent) override
 getObjectProperties is used to retrieve the properties of an object
 
ObjectPropertyInfos getObjectPropertyInfos (const ::std::string &objectName, const ::Ice::Current &) override
 
ManagedIceObjectState getObjectState (const std::string &objectName, const Ice::Current &c=Ice::emptyCurrent) override
 Retrieve state of a ManagedIceObject.
 
Ice::PropertiesAdminPrx getPropertiesAdmin (const Ice::Current &=Ice::emptyCurrent) override
 
const std::shared_ptr< SharedRemoteHandleState > & getSharedRemoteHandleState () const
 
void increaseSchedulers (int increaseBy)
 increased the number of single threaded schedulers.
 
bool isShutdown ()
 Whether ArmarXManager shutdown has been finished.
 
void registerKnownObjectFactoriesWithIce ()
 non static convenience version of ArmarXManager::RegisterKnownObjectFactoriesWithIce()
 
void removeObjectBlocking (const ManagedIceObjectPtr &object) override
 Removes an object from the manager.
 
void removeObjectBlocking (const std::string &objectName) override
 Removes an object from the manager.
 
void removeObjectNonBlocking (const ManagedIceObjectPtr &object) override
 Removes an object from the manager.
 
void removeObjectNonBlocking (const std::string &objectName) override
 Removes an object from the manager.
 
void setComponentIceProperties (const Ice::PropertiesPtr &properties)
 Calls Component::setIceProperties() on all components assigend to this ArmarXManager Instance.
 
void setDataPaths (std::string dataPaths)
 Set data paths used to search for datafiles.
 
void setGlobalMinimumLoggingLevel (MessageTypeT minimumLoggingLevel)
 Set minimum logging level to output in log stream.
 
void shutdown ()
 Shuts down the ArmarXManager.
 
void updateComponentIceProperties (const Ice::PropertyDict &properties)
 
void waitForShutdown ()
 Wait for shutdown.
 
 ~ArmarXManager () override
 
- Public Member Functions inherited from Logging
SpamFilterDataPtr deactivateSpam (float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const
 disables the logging for the current line for the given amount of seconds.
 
MessageTypeT getEffectiveLoggingLevel () const
 
 Logging ()
 
void setLocalMinimumLoggingLevel (MessageTypeT level)
 With setLocalMinimumLoggingLevel the minimum verbosity-level of log-messages can be set.
 
void setTag (const LogTag &tag)
 
void setTag (const std::string &tagName)
 
virtual ~Logging ()
 

Static Public Member Functions

static bool CheckIceConnection (const Ice::CommunicatorPtr &communicator, bool printHint)
 
static void RegisterKnownObjectFactoriesWithIce (const Ice::CommunicatorPtr &ic)
 Registers all object factories that are known with Ice.
 

Friends

class ArmarXObjectObserver
 
class PeriodicTask< ArmarXManager >
 

Additional Inherited Members

- Protected Member Functions inherited from Logging
bool checkLogLevel (MessageTypeT level) const
 
const LogSenderPtr & getLogSender () const
 Retrieve log sender.
 
LogSenderPtr loghelper (const char *file, int line, const char *function) const
 
- Protected Attributes inherited from Logging
MessageTypeT minimumLoggingLevel
 
SpamFilterDataPtr spamFilter
 
LogTag tag
 

Detailed Description

Main class of an ArmarX process.

The ArmarXManager is the main class for writing distributed applications in the ArmarX framework. The ArmarXManager takes care of handling ManagedIceObjects. ManagedIceObjects are the core elements of ArmarX distributed applications.

Usually, each process creates one ArmarXManager and adds the required ManagedIceObjects to this manager.

The ArmarXManager provides and Ice interface which allows retrieving the state and network connectivity of all ManagedIceObject within the Manager. To provide this functionality it holds one instance of Ice::Communicator

Finally it also does shutdown handling

Constructor & Destructor Documentation

◆ ArmarXManager() [1/2]

ArmarXManager ( std::string applicationName,
int port = 4061,
std::string host = "localhost",
std::string locatorName = "IceGrid/Locator",
Ice::StringSeq args = Ice::StringSeq() )

ArmarXManager constructor.

With this constructor, the ArmarXManager builds its own communicator using the specified port, host and locatorName (default: –Ice.Default.Locator= IceGrid/Locator:tcp -p 4061 -h localhost)

Parameters
applicationNamename of the application used for registering the manager to Ice and for logging
portthe port of the Ice locator service
hostthe host of the Ice locator service
locatorNamethe name of the Ice locator service
argslist of arguments for Ice (e.g. "--Ice.ThreadPool.Server.SizeMax=10")

◆ ArmarXManager() [2/2]

ArmarXManager ( std::string applicationName,
const Ice::CommunicatorPtr & communicator )

Constructs an ArmarXManager by passing a communicator.

This can be used if communicator has already been constructed e.g in Ice::Application.

Parameters
applicationNamename of the application used for registering the manager to Ice and for logging
communicatorconfigured Ice::Communicator

◆ ~ArmarXManager()

~ArmarXManager ( )
override

Member Function Documentation

◆ addObject() [1/3]

void addObject ( const ManagedIceObjectPtr & object,
bool addWithOwnAdapter = true,
const std::string & objectName = "",
bool useOwnScheduleThread = true )
overridevirtual

Add a ManagedIceObject to the manager.

Takes care of the IceManagedObject lifcycle using and ArmarXObjectScheduler. addObject is thread-safe and can be called from any method in order to dynamically add ManagedIceObjects (as e.g. required for GUI).

Parameters
objectobject to add
addWithOwnAdapterIf true this object will have it's own adapter
objectNameName that the object should have. if not empty overrides the currently set name.

Implements ManagedIceObjectRegistryInterface.

◆ addObject() [2/3]

void addObject ( const ManagedIceObjectPtr & object,
const std::string & objectName,
bool addWithOwnAdapter = true,
bool useOwnScheduleThread = true )
virtual

◆ addObject() [3/3]

void addObject ( const ManagedIceObjectPtr & object,
Ice::ObjectAdapterPtr objectAdapterToAddTo,
const std::string & objectName = "",
bool useOwnScheduleThread = true )
virtual

◆ addObjectAsync()

void addObjectAsync ( const ManagedIceObjectPtr & object,
const std::string & objectName,
bool addWithOwnAdapter = true,
bool useOwnScheduleThread = true )
virtual

◆ asyncShutdown()

void asyncShutdown ( std::size_t timeoutMs = 0)

Calls shutdown() after a timeout.

Parameters
timeoutMsThe timeout to wait. (unit ms)

◆ CheckIceConnection()

bool CheckIceConnection ( const Ice::CommunicatorPtr & communicator,
bool printHint )
static

◆ checkIceConnection()

bool checkIceConnection ( bool printHint = true) const

◆ createRemoteReferenceCount() [1/2]

template<class Function>
RemoteReferenceCountControlBlockPtr< Function > createRemoteReferenceCount ( Function f,
const std::string & id = "",
IceUtil::Time deletionDelay = IceUtil::Time::seconds(3),
IceUtil::Time orphantDeletionDelay = IceUtil::Time::seconds(6),
long heartBeatMs = 1000 )
inline

◆ createRemoteReferenceCount() [2/2]

template<class Function, class Data>
RemoteReferenceCountControlBlockPtr< Function, Data > createRemoteReferenceCount ( Function f,
Data d,
const std::string & id = "",
IceUtil::Time deletionDelay = IceUtil::Time::seconds(3),
IceUtil::Time orphantDeletionDelay = IceUtil::Time::seconds(6),
long heartBeatMs = 1000 )
inline

◆ createSimpleRemoteReferenceCount() [1/2]

template<class Function>
SimpleRemoteReferenceCountControlBlockPtr< Function > createSimpleRemoteReferenceCount ( Function f,
const std::string & id = "",
IceUtil::Time deletionDelay = IceUtil::Time::seconds(3) )
inline

◆ createSimpleRemoteReferenceCount() [2/2]

template<class Function, class Data>
SimpleRemoteReferenceCountControlBlockPtr< Function, Data > createSimpleRemoteReferenceCount ( Function f,
Data d,
const std::string & id = "",
IceUtil::Time deletionDelay = IceUtil::Time::seconds(3) )
inline

◆ enableLogging()

void enableLogging ( bool enable)

Enable or disable logging.

Parameters
enablewhether to enable logging

◆ enableProfiling()

void enableProfiling ( bool enable)

Enable or disable profiling of CPU Usage.

◆ getAdapter()

const Ice::ObjectAdapterPtr & getAdapter ( ) const

◆ getApplicationPropertyInfos()

ObjectPropertyInfos getApplicationPropertyInfos ( const ::Ice::Current & )
override

◆ getCommunicator()

const Ice::CommunicatorPtr & getCommunicator ( ) const

◆ getHostname()

std::string getHostname ( const Ice::Current & c = Ice::emptyCurrent)
override

Gets the hostname of the host running the manager.

Part of the Ice MiceManagerInsightProvider interface.

Parameters
cIce context
Returns
hostname

◆ getIceManager()

const IceManagerPtr & getIceManager ( ) const

Retrieve the instance of the icemanager.

Returns
Pointer to the iceManager
See also
ManagedIceObject::getIceManager()

◆ getManagedObjectNames()

Ice::StringSeq getManagedObjectNames ( const Ice::Current & c = Ice::emptyCurrent)
override

Retrieve the names of all ManagedIceObject.

Part of the Ice interface.

Parameters
cIce context
Returns
vector of names

◆ getManagedObjects()

std::vector< ManagedIceObjectPtr > getManagedObjects ( )
overridevirtual

Retrieve pointers to all ManagedIceObject.

Returns
vector of pointers

Implements ManagedIceObjectRegistryInterface.

◆ getMetaInfo()

StringVariantBaseMap getMetaInfo ( const std::string & objectName,
const Ice::Current &  )
override

◆ getMetricsAdmin()

IceMX::MetricsAdminPrx getMetricsAdmin ( const Ice::Current & = Ice::emptyCurrent)
override

◆ getMiceObjectConnectivity()

mice::MiceObjectConnectivity getMiceObjectConnectivity ( const std::string & objectName,
const Ice::Current & c = Ice::emptyCurrent )
override

Retrieve connectivity of a ManagedIceObject.

Part of the Ice MiceManagerInsightProvider interface.

Parameters
objectNamename of the object
cIce context
Returns
connectivity of the ManagedIceObject

◆ getObjectConnectivity()

ManagedIceObjectConnectivity getObjectConnectivity ( const std::string & objectName,
const Ice::Current & c = Ice::emptyCurrent )
override

Retrieve connectivity of a ManagedIceObject.

Part of the Ice interface.

Parameters
objectNamename of the object
cIce context
Returns
connectivity of the ManagedIceObject

◆ getObjectNames()

Ice::StringSeq getObjectNames ( const Ice::Current & c = Ice::emptyCurrent)
override

Retrieve the names of all ManagedIceObject.

Part of the Ice MiceManagerInsightProvider interface.

Parameters
cIce context
Returns
vector of names

◆ getObjectProperties()

StringStringDictionary getObjectProperties ( const ::std::string & objectName,
const ::Ice::Current & = Ice::emptyCurrent )
override

getObjectProperties is used to retrieve the properties of an object

Returns

◆ getObjectPropertyInfos()

ObjectPropertyInfos getObjectPropertyInfos ( const ::std::string & objectName,
const ::Ice::Current &  )
override

◆ getObjectState()

ManagedIceObjectState getObjectState ( const std::string & objectName,
const Ice::Current & c = Ice::emptyCurrent )
override

Retrieve state of a ManagedIceObject.

Part of the Ice interface.

Parameters
objectNamename of the object
cIce context
Returns
state of the ManagedIceObject

◆ getPropertiesAdmin()

Ice::PropertiesAdminPrx getPropertiesAdmin ( const Ice::Current & = Ice::emptyCurrent)
override

◆ getSharedRemoteHandleState()

const std::shared_ptr< SharedRemoteHandleState > & getSharedRemoteHandleState ( ) const

◆ increaseSchedulers()

void increaseSchedulers ( int increaseBy)

increased the number of single threaded schedulers.

Decrease is not possible, since the link to objects is fixed.

Parameters
increasyByIncreases the number of single threaded schedulers by this amount.

◆ isShutdown()

bool isShutdown ( )

Whether ArmarXManager shutdown has been finished.

Returns
shutdown finished

◆ RegisterKnownObjectFactoriesWithIce()

void RegisterKnownObjectFactoriesWithIce ( const Ice::CommunicatorPtr & ic)
static

Registers all object factories that are known with Ice.

Object factories are automatically preregistered when their library is linked. Function is idempotent. This function is called in init() of ArmarXManager and needs only be called, if no ArmarXManager is used or libraries are loaded at runtime.

See also
FactoryCollectionBase

◆ registerKnownObjectFactoriesWithIce()

void registerKnownObjectFactoriesWithIce ( )

◆ removeObjectBlocking() [1/2]

void removeObjectBlocking ( const ManagedIceObjectPtr & object)
overridevirtual

Removes an object from the manager.

This version waits until all calls to this component are finished and the has been completely removed.

Parameters
objectobject to remove

Implements ManagedIceObjectRegistryInterface.

◆ removeObjectBlocking() [2/2]

void removeObjectBlocking ( const std::string & objectName)
overridevirtual

Removes an object from the manager.

This version waits until all calls to this component are finished and the has been completely removed.

Parameters
objectNamename of the object to remove

Implements ManagedIceObjectRegistryInterface.

◆ removeObjectNonBlocking() [1/2]

void removeObjectNonBlocking ( const ManagedIceObjectPtr & object)
overridevirtual

Removes an object from the manager.

This version returns immediatly and does not wait for all call to this to finish.

Parameters
objectobject to remove

Implements ManagedIceObjectRegistryInterface.

◆ removeObjectNonBlocking() [2/2]

void removeObjectNonBlocking ( const std::string & objectName)
overridevirtual

Removes an object from the manager.

This version returns immediatly and does not wait for all call to this to finish.

Parameters
objectNamename of the object to remove

Implements ManagedIceObjectRegistryInterface.

◆ setComponentIceProperties()

void setComponentIceProperties ( const Ice::PropertiesPtr & properties)

Calls Component::setIceProperties() on all components assigend to this ArmarXManager Instance.

◆ setDataPaths()

void setDataPaths ( std::string dataPaths)

Set data paths used to search for datafiles.

Parameters
dataPathssemicolon seperated list of paths

◆ setGlobalMinimumLoggingLevel()

void setGlobalMinimumLoggingLevel ( MessageTypeT minimumLoggingLevel)

Set minimum logging level to output in log stream.

Parameters
applicationNamename of the application used for registering the manager to Ice and for logging
communicatorconfigured Ice::Communicator

◆ shutdown()

void shutdown ( )

Shuts down the ArmarXManager.

If a thread is waiting in waitForShutdown, the thread is activated after shutdown has been completed.

◆ updateComponentIceProperties()

void updateComponentIceProperties ( const Ice::PropertyDict & properties)

◆ waitForShutdown()

void waitForShutdown ( )

Wait for shutdown.

Shutdown is initialized once shutdown() is called on ArmarXManager e.g. from a signal handler.

Friends And Related Symbol Documentation

◆ ArmarXObjectObserver

friend class ArmarXObjectObserver
friend

◆ PeriodicTask< ArmarXManager >

friend class PeriodicTask< ArmarXManager >
friend

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