6#ifndef YARP_MANAGER_Executable
7#define YARP_MANAGER_Executable
27#define WDOG_PERIOD 5.0
64class ConcurentWrapper;
65class ConcurentRateWrapper;
80 void setID(
int id) { theID = id;}
81 void setCommand(
const char* val) {
if(val) { strCommand = val; } }
82 void setParam(
const char* val) {
if(val) { strParam = val; } }
83 void setHost(
const char* val) {
if(val) { strHost = val; } }
84 void setStdio(
const char* val) {
if(val) { strStdio = val; } }
85 void setWorkDir(
const char* val) {
if(val) { strWorkdir = val; } }
86 void setEnv(
const char* val) {
if(val) { strEnv = val; } }
102 const char*
getParam() {
return strParam.c_str(); }
103 const char*
getHost() {
return strHost.c_str(); }
104 const char*
getStdio() {
return strStdio.c_str(); }
106 const char*
getEnv() {
return strEnv.c_str(); }
132 std::string strCommand;
133 std::string strParam;
135 std::string strStdio;
136 std::string strWorkdir;
141 double originalWaitStart;
142 double originalWaitStop;
158 void startImplement();
159 void stopImplement();
160 void killImplement();
161 void watchdogImplement();
174 : labor(ptrLabor), executable(ptrExecutable) { }
180 if(labor && executable) {
181 (executable->*labor)();
205 if(labor && executable) {
206 (executable->*labor)();
~ConcurentRateWrapper() override
void run() override
Loop function.
ConcurentRateWrapper(Executable *ptrExecutable, ExecutableFuncPtr ptrLabor)
ConcurentWrapper(Executable *ptrExecutable, ExecutableFuncPtr ptrLabor)
void run() override
Main body of the new thread.
~ConcurentWrapper() override
Singleton class ErrorLogger.
void onBrokerStdout(const char *msg) override
CnnContainer & getConnections()
void setParam(const char *val)
void setWorkDir(const char *val)
void setOriginalPostStopWait(double t)
void setPostStopWait(double t)
void restoreOriginalPostStopWait()
void setPostExecWait(double t)
void setOriginalPostExecWait(double t)
BrokerType getBrokerType()
void setHost(const char *val)
void setStdio(const char *val)
ResourceContainer & getResources()
void setEnv(const char *val)
void addResource(ResYarpPort &res)
void setCommand(const char *val)
const char * getCommand()
const char * getWorkDir()
void disableAutoConnect()
void restoreOriginalPostExecWait()
void addConnection(Connection &cnn)
bool shouldChangeBroker()
void setAndInitializeBroker(Broker *_broker)
virtual void onExecutableStdout(void *which, const char *msg)
virtual void onCnnFailed(void *which)
virtual void onExecutableFailed(void *which)
virtual void onExecutableStop(void *which)
virtual void onExecutableDied(void *which)
virtual void onCnnStablished(void *which)
virtual void onCnnReleased(void *which)
virtual ~MEvent()=default
virtual void onExecutableStart(void *which)
virtual void onError(void *which)
An abstraction for a periodic thread.
PeriodicThread(double period, ShouldUseSystemClock useSystemClock=ShouldUseSystemClock::No, PeriodicThreadClock clockAccuracy=PeriodicThreadClock::Relative)
Constructor.
bool isRunning() const
Returns true when the thread is started, false otherwise.
void stop()
Call this to stop the thread, this call blocks until the thread is terminated (and releaseThread() ca...
A class for thread synchronization and mutual exclusion.
An abstraction for a thread of execution.
bool stop()
Stop the thread.
bool isRunning()
Returns true if the thread is running (Thread::start has been called successfully and the thread has ...
std::vector< Executable * >::iterator ExecutablePIterator
enum yarp::manager::__RSTATE RSTATE
std::vector< ResYarpPort > ResourceContainer
std::vector< Executable * > ExecutablePContainer
void(Executable::* ExecutableFuncPtr)()
std::vector< Connection > CnnContainer
The main, catch-all namespace for YARP.