|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
20 bWatchDog = _bWatchDog;
23 originalWaitStart = 0.0;
24 originalWaitStop = 0.0;
25 Executable::module = module;
37 watchdogWrapper =
nullptr;
43 delete watchdogWrapper;
52 bool Executable::initialize()
58 bool ret = broker->
init(strCommand.c_str(),
68 msg<<
"cannot initialize broker. : ";
72 event->onExecutableDied(
this);
82 event->onExecutableDied(
this);
87 startWrapper->
start();
94 void Executable::startImplement()
109 stopWrapper->
start();
113 void Executable::stopImplement()
129 killWrapper->
start();
132 void Executable::killImplement()
164 std::cerr<<
"Unknown state!"<<std::endl;
170 if (broker ==
nullptr)
188 strHost !=
"localhost")
193 strHost ==
"localhost")
211 if(watchdogWrapper ==
nullptr)
214 watchdogWrapper->
start();
219 if(watchdogWrapper && watchdogWrapper->
isRunning())
220 watchdogWrapper->
stop();
225 event->onExecutableStdout(
this, msg);
229 void Executable::watchdogImplement()
237 for(itr=connections.begin(); itr!=connections.end(); itr++)
238 if( !broker->
connected((*itr).from(), (*itr).to(), (*itr).carrier()) )
StateBase * currentState()
virtual const char * error()=0
Executable(Broker *_broker, MEvent *_event, Module *module, bool bWatchDog=true)
bool shouldChangeBroker()
void disconnectAllPorts()
std::stringstream OSTRINGSTREAM
void onBrokerStdout(const char *msg) override
enum yarp::manager::__RSTATE RSTATE
std::vector< Connection >::iterator CnnIterator
void wait()
Decrement the counter, even if we must wait to do that.
bool compareString(const char *szFirst, const char *szSecond)
bool isRunning() const
Returns true when the thread is started, false otherwise.
bool isRunning()
Returns true if the thread is running (Thread::start has been called successfully and the thread has ...
void post()
Increment the counter.
static ErrorLogger * Instance()
Singleton class ErrorLogger.
bool start()
Call this to start the thread.
void addError(const char *szError)
virtual bool initialized()=0
#define __CHECK_NULLPTR(_ptr)
virtual bool connected(const char *from, const char *to, const char *carrier)=0
BrokerType getBrokerType()
void stop()
Call this to stop the thread, this call blocks until the thread is terminated (and releaseThread() ca...
bool start()
Start the new thread running.
void setAndInitializeBroker(Broker *_broker)
void connectionFailed(void *which)
void setEventSink(BrokerEventSink *pEventSink)