26#include <condition_variable>
30#include <Ice/Handle.h>
31#include <Ice/ObjectAdapterF.h>
32#include <Ice/ObjectF.h>
33#include <IceUtil/Handle.h>
34#include <IceUtil/Shared.h>
39#include <ArmarXCore/interface/core/ManagedIceObjectDefinitions.h>
88 bool startSchedulingObject =
true);
99 bool dependsOn(
const std::string& objectName);
120 const long timeoutMs = -1)
const;
134 const long timeoutMs = -1)
const;
167 setInteruptConditionVariable(std::shared_ptr<std::condition_variable> interruptCondition,
168 std::shared_ptr<bool> interruptConditionVariable);
170 void scheduleObject();
172 void waitForInterrupt();
182 void disconnectObject();
194 std::mutex interruptMutex;
195 std::shared_ptr<std::condition_variable> interruptCondition;
196 std::shared_ptr<bool> interruptConditionVariable;
197 std::mutex dependencyWaitMutex;
198 std::condition_variable dependencyWaitCondition;
199 bool dependencyWaitConditionVariable;
200 bool terminateRequested;
201 bool objectedInitialized;
Main class of an ArmarX process.
Takes care of the lifecycle management of ManagedIceObjects.
void disconnected(bool reconnect)
void wakeupDependencyCheck()
ManagedIceObjectState getObjectState() const
bool dependsOn(const std::string &objectName)
void waitForDependencies(int timeoutMs=-1)
waits until all depenencies are resolved.
void terminate()
Terminates the ManagedIceObject.
ArmarXObjectScheduler(const ArmarXManagerPtr &armarXManager, const IceManagerPtr &iceManager, const armarx::ManagedIceObjectPtr &object, Ice::ObjectAdapterPtr objectAdapterToAddTo, bool startSchedulingObject=true)
Constructs an ArmarXObjectScheduler.
const armarx::ManagedIceObjectPtr & getObject() const
Retrieve pointer to scheduled ManagedIceObject.
bool isTerminationRequested() const
bool checkDependenciesStatus() const
bool isTerminated() const
Check whether the Scheduler is terminated.
bool checkDependenciesResolvement()
bool waitForObjectState(ManagedIceObjectState stateToWaitFor, const long timeoutMs=-1) const
waitForObjectStart waits (thread sleeps) until the object reached a specific state.
~ArmarXObjectScheduler() override
void waitForTermination()
Waits until scheduler has been terminated.
friend class ArmarXMultipleObjectsScheduler
bool waitForObjectStateMinimum(ManagedIceObjectState minimumStateToWaitFor, const long timeoutMs=-1) const
waitForObjectStart waits (thread sleeps) until the object reached a specific state (or higher/later).
::IceInternal::Handle<::Ice::ObjectAdapter > ObjectAdapterPtr
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< ArmarXManager > ArmarXManagerPtr
IceUtil::Handle< ArmarXObjectScheduler > ArmarXObjectSchedulerPtr
IceUtil::Handle< IceManager > IceManagerPtr
IceManager smart pointer.
IceInternal::Handle< ManagedIceObject > ManagedIceObjectPtr