|
|
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 |
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
| 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)
| applicationName | name of the application used for registering the manager to Ice and for logging |
| port | the port of the Ice locator service |
| host | the host of the Ice locator service |
| locatorName | the name of the Ice locator service |
| args | list of arguments for Ice (e.g. "--Ice.ThreadPool.Server.SizeMax=10") |
| 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.
| applicationName | name of the application used for registering the manager to Ice and for logging |
| communicator | configured Ice::Communicator |
|
override |
|
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).
| object | object to add |
| addWithOwnAdapter | If true this object will have it's own adapter |
| objectName | Name that the object should have. if not empty overrides the currently set name. |
Implements ManagedIceObjectRegistryInterface.
|
virtual |
|
virtual |
|
virtual |
| void asyncShutdown | ( | std::size_t | timeoutMs = 0 | ) |
Calls shutdown() after a timeout.
| timeoutMs | The timeout to wait. (unit ms) |
|
static |
| bool checkIceConnection | ( | bool | printHint = true | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
| void enableLogging | ( | bool | enable | ) |
Enable or disable logging.
| enable | whether to enable logging |
| void enableProfiling | ( | bool | enable | ) |
Enable or disable profiling of CPU Usage.
| const Ice::ObjectAdapterPtr & getAdapter | ( | ) | const |
|
override |
| const Ice::CommunicatorPtr & getCommunicator | ( | ) | const |
|
override |
| const IceManagerPtr & getIceManager | ( | ) | const |
Retrieve the instance of the icemanager.
|
override |
Retrieve the names of all ManagedIceObject.
Part of the Ice interface.
| c | Ice context |
|
overridevirtual |
Retrieve pointers to all ManagedIceObject.
Implements ManagedIceObjectRegistryInterface.
|
override |
|
override |
|
override |
Retrieve connectivity of a ManagedIceObject.
Part of the Ice MiceManagerInsightProvider interface.
| objectName | name of the object |
| c | Ice context |
|
override |
Retrieve connectivity of a ManagedIceObject.
Part of the Ice interface.
| objectName | name of the object |
| c | Ice context |
|
override |
Retrieve the names of all ManagedIceObject.
Part of the Ice MiceManagerInsightProvider interface.
| c | Ice context |
|
override |
getObjectProperties is used to retrieve the properties of an object
|
override |
|
override |
Retrieve state of a ManagedIceObject.
Part of the Ice interface.
| objectName | name of the object |
| c | Ice context |
|
override |
| const std::shared_ptr< SharedRemoteHandleState > & getSharedRemoteHandleState | ( | ) | const |
| void increaseSchedulers | ( | int | increaseBy | ) |
increased the number of single threaded schedulers.
Decrease is not possible, since the link to objects is fixed.
| increasyBy | Increases the number of single threaded schedulers by this amount. |
| bool isShutdown | ( | ) |
Whether ArmarXManager shutdown has been finished.
|
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.
| void registerKnownObjectFactoriesWithIce | ( | ) |
non static convenience version of ArmarXManager::RegisterKnownObjectFactoriesWithIce()
|
overridevirtual |
Removes an object from the manager.
This version waits until all calls to this component are finished and the has been completely removed.
| object | object to remove |
Implements ManagedIceObjectRegistryInterface.
|
overridevirtual |
Removes an object from the manager.
This version waits until all calls to this component are finished and the has been completely removed.
| objectName | name of the object to remove |
Implements ManagedIceObjectRegistryInterface.
|
overridevirtual |
Removes an object from the manager.
This version returns immediatly and does not wait for all call to this to finish.
| object | object to remove |
Implements ManagedIceObjectRegistryInterface.
|
overridevirtual |
Removes an object from the manager.
This version returns immediatly and does not wait for all call to this to finish.
| objectName | name of the object to remove |
Implements ManagedIceObjectRegistryInterface.
| 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.
| dataPaths | semicolon seperated list of paths |
| void setGlobalMinimumLoggingLevel | ( | MessageTypeT | minimumLoggingLevel | ) |
Set minimum logging level to output in log stream.
| applicationName | name of the application used for registering the manager to Ice and for logging |
| communicator | configured Ice::Communicator |
| void shutdown | ( | ) |
Shuts down the ArmarXManager.
If a thread is waiting in waitForShutdown, the thread is activated after shutdown has been completed.
| void updateComponentIceProperties | ( | const Ice::PropertyDict & | properties | ) |
| void waitForShutdown | ( | ) |
Wait for shutdown.
Shutdown is initialized once shutdown() is called on ArmarXManager e.g. from a signal handler.
|
friend |
|
friend |