ArmarXObjectScheduler Class Reference

Takes care of the lifecycle management of ManagedIceObjects. More...

#include <ArmarXCore/core/ArmarXObjectScheduler.h>

+ Inheritance diagram for ArmarXObjectScheduler:

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::ManagedIceObjectPtrgetObject () 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 LogSenderPtrgetLogSender () 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
 

Detailed Description

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.

Lifecyle of a ManagedIceObject managed by the ArmarXObjectScheduler

Definition at line 74 of file ArmarXObjectScheduler.h.

Constructor & Destructor Documentation

◆ ArmarXObjectScheduler()

ArmarXObjectScheduler ( const ArmarXManagerPtr armarXManager,
const IceManagerPtr iceManager,
const armarx::ManagedIceObjectPtr object,
Ice::ObjectAdapterPtr  objectAdapterToAddTo,
bool  startSchedulingObject = true 
)

Constructs an ArmarXObjectScheduler.

Parameters
armarXManagerpointer to the armarXManager
iceManagerpointer to the iceManager
objectobject to schedule

Definition at line 69 of file ArmarXObjectScheduler.cpp.

+ Here is the call graph for this function:

◆ ~ArmarXObjectScheduler()

~ArmarXObjectScheduler ( )
override

Definition at line 95 of file ArmarXObjectScheduler.cpp.

Member Function Documentation

◆ checkDependenciesResolvement()

bool checkDependenciesResolvement ( )
protected

Definition at line 377 of file ArmarXObjectScheduler.cpp.

+ Here is the caller graph for this function:

◆ checkDependenciesStatus()

bool checkDependenciesStatus ( ) const

Definition at line 441 of file ArmarXObjectScheduler.cpp.

◆ dependsOn()

bool dependsOn ( const std::string &  objectName)

Definition at line 472 of file ArmarXObjectScheduler.cpp.

◆ disconnected()

void disconnected ( bool  reconnect)

Definition at line 492 of file ArmarXObjectScheduler.cpp.

◆ getObject()

const ManagedIceObjectPtr & getObject ( ) const

Retrieve pointer to scheduled ManagedIceObject.

Returns
ManagedIceObjectPtr

Definition at line 323 of file ArmarXObjectScheduler.cpp.

◆ getObjectState()

ManagedIceObjectState getObjectState ( ) const

Definition at line 327 of file ArmarXObjectScheduler.cpp.

+ Here is the caller graph for this function:

◆ isTerminated()

bool isTerminated ( ) const

Check whether the Scheduler is terminated.

Returns
terminated state

Definition at line 312 of file ArmarXObjectScheduler.cpp.

+ Here is the call graph for this function:

◆ isTerminationRequested()

bool isTerminationRequested ( ) const

Definition at line 318 of file ArmarXObjectScheduler.cpp.

◆ startScheduling()

void startScheduling ( )

Definition at line 107 of file ArmarXObjectScheduler.cpp.

+ Here is the caller graph for this function:

◆ terminate()

void terminate ( )

Terminates the ManagedIceObject.

Definition at line 127 of file ArmarXObjectScheduler.cpp.

+ Here is the call graph for this function:

◆ waitForDependencies()

void waitForDependencies ( int  timeoutMs = -1)

waits until all depenencies are resolved.

Parameters
timeoutMsIf 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.

+ Here is the call graph for this function:

◆ waitForObjectState()

bool waitForObjectState ( ManagedIceObjectState  stateToWaitFor,
const long  timeoutMs = -1 
) const

waitForObjectStart waits (thread sleeps) until the object reached a specific state.

Parameters
stateToWaitForState for which the calling thread should wait for.
timeoutMsTimeout in miliseconds until this function stops waiting and returns false. Set to -1 for infinite waiting.
Returns
Whether the object reached the state before timeout or not.
See also
waitForObjectStateMinimum()

Definition at line 182 of file ArmarXObjectScheduler.cpp.

+ Here is the call graph for this function:

◆ waitForObjectStateMinimum()

bool waitForObjectStateMinimum ( ManagedIceObjectState  minimumStateToWaitFor,
const long  timeoutMs = -1 
) const

waitForObjectStart waits (thread sleeps) until the object reached a specific state (or higher/later).

Parameters
minimumStateToWaitForMinimum State for which the calling thread should wait for.
timeoutMsTimeout in miliseconds until this function stops waiting and returns false. Set to -1 for infinite waiting.
Returns
Whether the object reached the minimum state before timeout or not.
See also
waitForObjectState()

Definition at line 239 of file ArmarXObjectScheduler.cpp.

+ Here is the call graph for this function:

◆ waitForTermination()

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.

+ Here is the call graph for this function:

◆ wakeupDependencyCheck()

void wakeupDependencyCheck ( )

Definition at line 431 of file ArmarXObjectScheduler.cpp.

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ ArmarXMultipleObjectsScheduler

friend class ArmarXMultipleObjectsScheduler
friend

Definition at line 202 of file ArmarXObjectScheduler.h.


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