|
Takes care of the lifecycle management of ManagedIceObjects. More...
#include <ArmarXCore/core/ArmarXObjectScheduler.h>
Public Member Functions | |
ArmarXObjectScheduler (const ArmarXManagerPtr &armarXManager, const IceManagerPtr &iceManager, const armarx::ManagedIceObjectPtr &object, Ice::ObjectAdapterPtr objectAdapterToAddTo, bool startSchedulingObject=true) | |
Constructs an ArmarXObjectScheduler. More... | |
bool | checkDependenciesStatus () const |
bool | dependsOn (const std::string &objectName) |
void | disconnected (bool reconnect) |
const armarx::ManagedIceObjectPtr & | getObject () const |
Retrieve pointer to scheduled ManagedIceObject. More... | |
ManagedIceObjectState | getObjectState () const |
bool | isTerminated () const |
Check whether the Scheduler is terminated. More... | |
bool | isTerminationRequested () const |
void | startScheduling () |
void | terminate () |
Terminates the ManagedIceObject. More... | |
void | waitForDependencies (int timeoutMs=-1) |
waits until all depenencies are resolved. More... | |
bool | waitForObjectState (ManagedIceObjectState stateToWaitFor, const long timeoutMs=-1) const |
waitForObjectStart waits (thread sleeps) until the object reached a specific state. More... | |
bool | waitForObjectStateMinimum (ManagedIceObjectState minimumStateToWaitFor, const long timeoutMs=-1) const |
waitForObjectStart waits (thread sleeps) until the object reached a specific state (or higher/later). More... | |
void | waitForTermination () |
Waits until scheduler has been terminated. More... | |
void | wakeupDependencyCheck () |
~ArmarXObjectScheduler () 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 () |
Protected Member Functions | |
bool | checkDependenciesResolvement () |
Protected Member Functions inherited from Logging | |
bool | checkLogLevel (MessageTypeT level) const |
const LogSenderPtr & | getLogSender () const |
Retrieve log sender. More... | |
LogSenderPtr | loghelper (const char *file, int line, const char *function) const |
Friends | |
class | ArmarXMultipleObjectsScheduler |
Additional Inherited Members | |
Protected Attributes inherited from Logging | |
MessageTypeT | minimumLoggingLevel |
SpamFilterDataPtr | spamFilter |
LogTag | tag |
Takes care of the lifecycle management of ManagedIceObjects.
The ArmarXObjectScheduler schedules the lifecycle of a ManagedIceObject in a single thread. According to the current state, the ManagedIceObject framework hooks are called. It provides all necessary functionality for a clean initialisation of ManagedIceObjects as well as dependency-resolution, dependency-monitoring, and exception handling. ArmarXObjectSchedulers are created by the ArmarXManager.
Definition at line 74 of file ArmarXObjectScheduler.h.
ArmarXObjectScheduler | ( | const ArmarXManagerPtr & | armarXManager, |
const IceManagerPtr & | iceManager, | ||
const armarx::ManagedIceObjectPtr & | object, | ||
Ice::ObjectAdapterPtr | objectAdapterToAddTo, | ||
bool | startSchedulingObject = true |
||
) |
Constructs an ArmarXObjectScheduler.
armarXManager | pointer to the armarXManager |
iceManager | pointer to the iceManager |
object | object to schedule |
Definition at line 69 of file ArmarXObjectScheduler.cpp.
|
override |
Definition at line 95 of file ArmarXObjectScheduler.cpp.
|
protected |
Definition at line 377 of file ArmarXObjectScheduler.cpp.
bool checkDependenciesStatus | ( | ) | const |
Definition at line 441 of file ArmarXObjectScheduler.cpp.
bool dependsOn | ( | const std::string & | objectName | ) |
Definition at line 472 of file ArmarXObjectScheduler.cpp.
void disconnected | ( | bool | reconnect | ) |
Definition at line 492 of file ArmarXObjectScheduler.cpp.
const ManagedIceObjectPtr & getObject | ( | ) | const |
Retrieve pointer to scheduled ManagedIceObject.
Definition at line 323 of file ArmarXObjectScheduler.cpp.
ManagedIceObjectState getObjectState | ( | ) | const |
Definition at line 327 of file ArmarXObjectScheduler.cpp.
bool isTerminated | ( | ) | const |
Check whether the Scheduler is terminated.
Definition at line 312 of file ArmarXObjectScheduler.cpp.
bool isTerminationRequested | ( | ) | const |
Definition at line 318 of file ArmarXObjectScheduler.cpp.
void startScheduling | ( | ) |
Definition at line 107 of file ArmarXObjectScheduler.cpp.
void terminate | ( | ) |
Terminates the ManagedIceObject.
Definition at line 127 of file ArmarXObjectScheduler.cpp.
void waitForDependencies | ( | int | timeoutMs = -1 | ) |
waits until all depenencies are resolved.
timeoutMs | If set to -1, it waits indefinitely. Otherwise throws exception after waiting the specifed time (given in milliseconds). |
Definition at line 337 of file ArmarXObjectScheduler.cpp.
bool waitForObjectState | ( | ManagedIceObjectState | stateToWaitFor, |
const long | timeoutMs = -1 |
||
) | const |
waitForObjectStart waits (thread sleeps) until the object reached a specific state.
stateToWaitFor | State for which the calling thread should wait for. |
timeoutMs | Timeout in miliseconds until this function stops waiting and returns false. Set to -1 for infinite waiting. |
Definition at line 182 of file ArmarXObjectScheduler.cpp.
bool waitForObjectStateMinimum | ( | ManagedIceObjectState | minimumStateToWaitFor, |
const long | timeoutMs = -1 |
||
) | const |
waitForObjectStart waits (thread sleeps) until the object reached a specific state (or higher/later).
minimumStateToWaitFor | Minimum State for which the calling thread should wait for. |
timeoutMs | Timeout in miliseconds until this function stops waiting and returns false. Set to -1 for infinite waiting. |
Definition at line 239 of file ArmarXObjectScheduler.cpp.
void waitForTermination | ( | ) |
Waits until scheduler has been terminated.
After termination the lifecycle of the ManagedIceObject has ceased and the thread has joined.
Definition at line 149 of file ArmarXObjectScheduler.cpp.
void wakeupDependencyCheck | ( | ) |
Definition at line 431 of file ArmarXObjectScheduler.cpp.
|
friend |
Definition at line 202 of file ArmarXObjectScheduler.h.