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. More...
 
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. More...
 
 ArmarXManager (std::string applicationName, int port=4061, std::string host="localhost", std::string locatorName="IceGrid/Locator", Ice::StringSeq args=Ice::StringSeq())
 ArmarXManager constructor. More...
 
void asyncShutdown (std::size_t timeoutMs=0)
 Calls shutdown() after a timeout. More...
 
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. More...
 
void enableProfiling (bool enable)
 Enable or disable profiling of CPU Usage. More...
 
const Ice::ObjectAdapterPtrgetAdapter () const
 
ObjectPropertyInfos getApplicationPropertyInfos (const ::Ice::Current &) override
 
const Ice::CommunicatorPtrgetCommunicator () const
 
std::string getHostname (const Ice::Current &c=Ice::emptyCurrent) override
 Gets the hostname of the host running the manager. More...
 
const IceManagerPtrgetIceManager () const
 Retrieve the instance of the icemanager. More...
 
Ice::StringSeq getManagedObjectNames (const Ice::Current &c=Ice::emptyCurrent) override
 Retrieve the names of all ManagedIceObject. More...
 
std::vector< ManagedIceObjectPtrgetManagedObjects () override
 Retrieve pointers to all ManagedIceObject. More...
 
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. More...
 
ManagedIceObjectConnectivity getObjectConnectivity (const std::string &objectName, const Ice::Current &c=Ice::emptyCurrent) override
 Retrieve connectivity of a ManagedIceObject. More...
 
Ice::StringSeq getObjectNames (const Ice::Current &c=Ice::emptyCurrent) override
 Retrieve the names of all ManagedIceObject. More...
 
::armarx::StringStringDictionary getObjectProperties (const ::std::string &objectName, const ::Ice::Current &=Ice::emptyCurrent) override
 getObjectProperties is used to retrieve the properties of an object More...
 
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. More...
 
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. More...
 
bool isShutdown ()
 Whether ArmarXManager shutdown has been finished. More...
 
void registerKnownObjectFactoriesWithIce ()
 non static convenience version of ArmarXManager::RegisterKnownObjectFactoriesWithIce() More...
 
void removeObjectBlocking (const ManagedIceObjectPtr &object) override
 Removes an object from the manager. More...
 
void removeObjectBlocking (const std::string &objectName) override
 Removes an object from the manager. More...
 
void removeObjectNonBlocking (const ManagedIceObjectPtr &object) override
 Removes an object from the manager. More...
 
void removeObjectNonBlocking (const std::string &objectName) override
 Removes an object from the manager. More...
 
void setComponentIceProperties (const Ice::PropertiesPtr &properties)
 Calls Component::setIceProperties() on all components assigend to this ArmarXManager Instance. More...
 
void setDataPaths (std::string dataPaths)
 Set data paths used to search for datafiles. More...
 
void setGlobalMinimumLoggingLevel (MessageTypeT minimumLoggingLevel)
 Set minimum logging level to output in log stream. More...
 
void shutdown ()
 Shuts down the ArmarXManager. More...
 
void updateComponentIceProperties (const Ice::PropertyDict &properties)
 
void waitForShutdown ()
 Wait for shutdown. More...
 
 ~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. More...
 
MessageTypeT getEffectiveLoggingLevel () const
 
 Logging ()
 
void setLocalMinimumLoggingLevel (MessageTypeT level)
 With setLocalMinimumLoggingLevel the minimum verbosity-level of log-messages can be set. More...
 
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. More...
 

Friends

class ArmarXObjectObserver
 
class PeriodicTask< ArmarXManager >
 

Additional Inherited Members

- Protected Member Functions inherited from Logging
bool checkLogLevel (MessageTypeT level) const
 
const LogSenderPtrgetLogSender () const
 Retrieve log sender. More...
 
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

Definition at line 97 of file ArmarXManager.h.

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")

Definition at line 98 of file ArmarXManager.cpp.

◆ 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

Definition at line 112 of file ArmarXManager.cpp.

◆ ~ArmarXManager()

~ArmarXManager ( )
override

Definition at line 121 of file ArmarXManager.cpp.

+ Here is the call graph for this function:

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.

Definition at line 233 of file ArmarXManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addObject() [2/3]

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

Definition at line 238 of file ArmarXManager.cpp.

+ Here is the call graph for this function:

◆ addObject() [3/3]

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

Definition at line 243 of file ArmarXManager.cpp.

+ Here is the call graph for this function:

◆ addObjectAsync()

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

Definition at line 315 of file ArmarXManager.cpp.

+ Here is the call graph for this function:

◆ asyncShutdown()

void asyncShutdown ( std::size_t  timeoutMs = 0)

Calls shutdown() after a timeout.

Parameters
timeoutMsThe timeout to wait. (unit ms)

Definition at line 507 of file ArmarXManager.cpp.

+ Here is the call graph for this function:

◆ checkIceConnection()

bool checkIceConnection ( bool  printHint = true) const

Definition at line 127 of file ArmarXManager.cpp.

+ Here is the call graph for this function:

◆ CheckIceConnection()

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

Definition at line 132 of file ArmarXManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createRemoteReferenceCount() [1/2]

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

Definition at line 387 of file ArmarXManager.h.

◆ createRemoteReferenceCount() [2/2]

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

Definition at line 371 of file ArmarXManager.h.

◆ createSimpleRemoteReferenceCount() [1/2]

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

Definition at line 418 of file ArmarXManager.h.

◆ createSimpleRemoteReferenceCount() [2/2]

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

Definition at line 405 of file ArmarXManager.h.

◆ enableLogging()

void enableLogging ( bool  enable)

Enable or disable logging.

Parameters
enablewhether to enable logging

Definition at line 206 of file ArmarXManager.cpp.

+ Here is the call graph for this function:

◆ enableProfiling()

void enableProfiling ( bool  enable)

Enable or disable profiling of CPU Usage.

Definition at line 212 of file ArmarXManager.cpp.

+ Here is the call graph for this function:

◆ getAdapter()

const Ice::ObjectAdapterPtr & getAdapter ( ) const

Definition at line 1228 of file ArmarXManager.cpp.

+ Here is the caller graph for this function:

◆ getApplicationPropertyInfos()

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

Definition at line 695 of file ArmarXManager.cpp.

+ Here is the call graph for this function:

◆ getCommunicator()

const Ice::CommunicatorPtr & getCommunicator ( ) const

Definition at line 532 of file ArmarXManager.cpp.

+ Here is the caller graph for this function:

◆ 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

Definition at line 565 of file ArmarXManager.cpp.

◆ getIceManager()

const IceManagerPtr & getIceManager ( ) const

Retrieve the instance of the icemanager.

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

Definition at line 527 of file ArmarXManager.cpp.

+ Here is the caller graph for this function:

◆ 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

Definition at line 745 of file ArmarXManager.cpp.

+ Here is the caller graph for this function:

◆ getManagedObjects()

std::vector< ManagedIceObjectPtr > getManagedObjects ( )
overridevirtual

Retrieve pointers to all ManagedIceObject.

Returns
vector of pointers

Implements ManagedIceObjectRegistryInterface.

Definition at line 537 of file ArmarXManager.cpp.

+ Here is the caller graph for this function:

◆ getMetaInfo()

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

Definition at line 1322 of file ArmarXManager.cpp.

◆ getMetricsAdmin()

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

Definition at line 593 of file ArmarXManager.cpp.

+ Here is the call graph for this function:

◆ 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

Definition at line 577 of file ArmarXManager.cpp.

+ Here is the call graph for this function:

◆ 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

Definition at line 625 of file ArmarXManager.cpp.

+ Here is the caller graph for this function:

◆ 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

Definition at line 572 of file ArmarXManager.cpp.

+ Here is the call graph for this function:

◆ getObjectProperties()

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

getObjectProperties is used to retrieve the properties of an object

Returns

Definition at line 647 of file ArmarXManager.cpp.

◆ getObjectPropertyInfos()

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

Definition at line 668 of file ArmarXManager.cpp.

◆ 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

Definition at line 605 of file ArmarXManager.cpp.

◆ getPropertiesAdmin()

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

Definition at line 712 of file ArmarXManager.cpp.

+ Here is the call graph for this function:

◆ getSharedRemoteHandleState()

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

Definition at line 1233 of file ArmarXManager.cpp.

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

Definition at line 1238 of file ArmarXManager.cpp.

◆ isShutdown()

bool isShutdown ( )

Whether ArmarXManager shutdown has been finished.

Returns
shutdown finished

Definition at line 516 of file ArmarXManager.cpp.

◆ registerKnownObjectFactoriesWithIce()

void registerKnownObjectFactoriesWithIce ( )

non static convenience version of ArmarXManager::RegisterKnownObjectFactoriesWithIce()

See also
RegisterKnownObjectFactoriesWithIce()

Definition at line 1223 of file ArmarXManager.cpp.

+ Here is the call graph for this function:

◆ 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

Definition at line 1204 of file ArmarXManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

Definition at line 387 of file ArmarXManager.cpp.

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

Definition at line 335 of file ArmarXManager.cpp.

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

Definition at line 392 of file ArmarXManager.cpp.

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

Definition at line 360 of file ArmarXManager.cpp.

◆ setComponentIceProperties()

void setComponentIceProperties ( const Ice::PropertiesPtr properties)

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

Definition at line 720 of file ArmarXManager.cpp.

+ Here is the call graph for this function:

◆ setDataPaths()

void setDataPaths ( std::string  dataPaths)

Set data paths used to search for datafiles.

Parameters
dataPathssemicolon seperated list of paths

Definition at line 223 of file ArmarXManager.cpp.

+ Here is the call graph for this function:

◆ 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

Definition at line 218 of file ArmarXManager.cpp.

+ Here is the call graph for this function:

◆ shutdown()

void shutdown ( )

Shuts down the ArmarXManager.

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

Definition at line 418 of file ArmarXManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateComponentIceProperties()

void updateComponentIceProperties ( const Ice::PropertyDict &  properties)

Definition at line 732 of file ArmarXManager.cpp.

+ Here is the call graph for this function:

◆ waitForShutdown()

void waitForShutdown ( )

Wait for shutdown.

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

Definition at line 400 of file ArmarXManager.cpp.

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ ArmarXObjectObserver

friend class ArmarXObjectObserver
friend

Definition at line 103 of file ArmarXManager.h.

◆ PeriodicTask< ArmarXManager >

friend class PeriodicTask< ArmarXManager >
friend

Definition at line 102 of file ArmarXManager.h.


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