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.
 
bool checkDependenciesStatus () const
 
bool dependsOn (const std::string &objectName)
 
void disconnected (bool reconnect)
 
const armarx::ManagedIceObjectPtr & getObject () const
 Retrieve pointer to scheduled ManagedIceObject.
 
ManagedIceObjectState getObjectState () const
 
bool isTerminated () const
 Check whether the Scheduler is terminated.
 
bool isTerminationRequested () const
 
void startScheduling ()
 
void terminate ()
 Terminates the ManagedIceObject.
 
void waitForDependencies (int timeoutMs=-1)
 waits until all depenencies are resolved.
 
bool waitForObjectState (ManagedIceObjectState stateToWaitFor, const long timeoutMs=-1) const
 waitForObjectStart waits (thread sleeps) until the object reached a specific state.
 
bool waitForObjectStateMinimum (ManagedIceObjectState minimumStateToWaitFor, const long timeoutMs=-1) const
 waitForObjectStart waits (thread sleeps) until the object reached a specific state (or higher/later).
 
void waitForTermination ()
 Waits until scheduler has been terminated.
 
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.
 
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 ()
 

Protected Member Functions

bool checkDependenciesResolvement ()
 
- 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
 

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

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

◆ ~ArmarXObjectScheduler()

~ArmarXObjectScheduler ( )
override

Member Function Documentation

◆ checkDependenciesResolvement()

bool checkDependenciesResolvement ( )
protected

◆ checkDependenciesStatus()

bool checkDependenciesStatus ( ) const

◆ dependsOn()

bool dependsOn ( const std::string & objectName)

◆ disconnected()

void disconnected ( bool reconnect)

◆ getObject()

const ManagedIceObjectPtr & getObject ( ) const

Retrieve pointer to scheduled ManagedIceObject.

Returns
ManagedIceObjectPtr

◆ getObjectState()

ManagedIceObjectState getObjectState ( ) const

◆ isTerminated()

bool isTerminated ( ) const

Check whether the Scheduler is terminated.

Returns
terminated state

◆ isTerminationRequested()

bool isTerminationRequested ( ) const

◆ startScheduling()

void startScheduling ( )

◆ terminate()

void terminate ( )

Terminates the ManagedIceObject.

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

◆ 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()

◆ 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()

◆ waitForTermination()

void waitForTermination ( )

Waits until scheduler has been terminated.

After termination the lifecycle of the ManagedIceObject has ceased and the thread has joined.

◆ wakeupDependencyCheck()

void wakeupDependencyCheck ( )

Friends And Related Symbol Documentation

◆ ArmarXMultipleObjectsScheduler

friend class ArmarXMultipleObjectsScheduler
friend

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