|
Main class of an ArmarX process. More...
#include <ArmarXCore/core/ArmarXManager.h>
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::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. More... | |
const IceManagerPtr & | getIceManager () 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< ManagedIceObjectPtr > | getManagedObjects () 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 | |
![]() | |
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 | |
![]() | |
bool | checkLogLevel (MessageTypeT level) const |
const LogSenderPtr & | getLogSender () const |
Retrieve log sender. More... | |
LogSenderPtr | loghelper (const char *file, int line, const char *function) const |
![]() | |
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
Definition at line 97 of file ArmarXManager.h.
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") |
Definition at line 102 of file ArmarXManager.cpp.
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 |
Definition at line 120 of file ArmarXManager.cpp.
|
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.
Definition at line 248 of file ArmarXManager.cpp.
|
virtual |
|
virtual |
|
virtual |
void asyncShutdown | ( | std::size_t | timeoutMs = 0 | ) |
Calls shutdown() after a timeout.
timeoutMs | The timeout to wait. (unit ms) |
Definition at line 552 of file ArmarXManager.cpp.
bool checkIceConnection | ( | bool | printHint = true | ) | const |
|
static |
Definition at line 141 of file ArmarXManager.cpp.
|
inline |
Definition at line 418 of file ArmarXManager.h.
|
inline |
Definition at line 397 of file ArmarXManager.h.
|
inline |
Definition at line 455 of file ArmarXManager.h.
|
inline |
Definition at line 437 of file ArmarXManager.h.
void enableLogging | ( | bool | enable | ) |
Enable or disable logging.
enable | whether to enable logging |
Definition at line 219 of file ArmarXManager.cpp.
void enableProfiling | ( | bool | enable | ) |
Enable or disable profiling of CPU Usage.
Definition at line 225 of file ArmarXManager.cpp.
const Ice::ObjectAdapterPtr & getAdapter | ( | ) | const |
|
override |
const Ice::CommunicatorPtr & getCommunicator | ( | ) | const |
|
override |
Gets the hostname of the host running the manager.
Part of the Ice MiceManagerInsightProvider interface.
c | Ice context |
Definition at line 613 of file ArmarXManager.cpp.
const IceManagerPtr & getIceManager | ( | ) | const |
Retrieve the instance of the icemanager.
Definition at line 574 of file ArmarXManager.cpp.
|
override |
Retrieve the names of all ManagedIceObject.
Part of the Ice interface.
c | Ice context |
Definition at line 804 of file ArmarXManager.cpp.
|
overridevirtual |
Retrieve pointers to all ManagedIceObject.
Implements ManagedIceObjectRegistryInterface.
Definition at line 586 of file ArmarXManager.cpp.
|
override |
Definition at line 1412 of file ArmarXManager.cpp.
|
override |
|
override |
Retrieve connectivity of a ManagedIceObject.
Part of the Ice MiceManagerInsightProvider interface.
objectName | name of the object |
c | Ice context |
Definition at line 627 of file ArmarXManager.cpp.
|
override |
Retrieve connectivity of a ManagedIceObject.
Part of the Ice interface.
objectName | name of the object |
c | Ice context |
Definition at line 676 of file ArmarXManager.cpp.
|
override |
Retrieve the names of all ManagedIceObject.
Part of the Ice MiceManagerInsightProvider interface.
c | Ice context |
Definition at line 621 of file ArmarXManager.cpp.
|
override |
getObjectProperties is used to retrieve the properties of an object
Definition at line 698 of file ArmarXManager.cpp.
|
override |
Definition at line 721 of file ArmarXManager.cpp.
|
override |
Retrieve state of a ManagedIceObject.
Part of the Ice interface.
objectName | name of the object |
c | Ice context |
Definition at line 655 of file ArmarXManager.cpp.
|
override |
const std::shared_ptr< SharedRemoteHandleState > & getSharedRemoteHandleState | ( | ) | const |
Definition at line 1319 of file ArmarXManager.cpp.
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. |
Definition at line 1325 of file ArmarXManager.cpp.
bool isShutdown | ( | ) |
Whether ArmarXManager shutdown has been finished.
Definition at line 563 of file ArmarXManager.cpp.
void registerKnownObjectFactoriesWithIce | ( | ) |
non static convenience version of ArmarXManager::RegisterKnownObjectFactoriesWithIce()
Definition at line 1307 of file ArmarXManager.cpp.
|
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.
Definition at line 1287 of file ArmarXManager.cpp.
|
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.
Definition at line 425 of file ArmarXManager.cpp.
|
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.
Definition at line 374 of file ArmarXManager.cpp.
|
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.
Definition at line 431 of file ArmarXManager.cpp.
|
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.
Definition at line 399 of file ArmarXManager.cpp.
void setComponentIceProperties | ( | const Ice::PropertiesPtr & | properties | ) |
Calls Component::setIceProperties() on all components assigend to this ArmarXManager Instance.
Definition at line 778 of file ArmarXManager.cpp.
void setDataPaths | ( | std::string | dataPaths | ) |
Set data paths used to search for datafiles.
dataPaths | semicolon seperated list of paths |
Definition at line 237 of file ArmarXManager.cpp.
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 |
Definition at line 231 of file ArmarXManager.cpp.
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 459 of file ArmarXManager.cpp.
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.
Definition at line 440 of file ArmarXManager.cpp.
|
friend |
Definition at line 103 of file ArmarXManager.h.
|
friend |
Definition at line 102 of file ArmarXManager.h.