41 #include "../ExecutionEngine.hpp" 49 using namespace detail;
55 ,mTaskState(initial_state)
56 ,mInitialState(initial_state)
57 ,mTargetState(initial_state)
58 ,mTriggerOnStart(true)
105 log(
Error) <<
"in configure(): state has been changed inside the configureHook" <<
endlog();
106 log(
Error) <<
" but configureHook returned true. Bailing out." <<
endlog();
118 )
CATCH(std::exception
const& e,
119 log(
Error) <<
"in configure(): switching to exception state because of unhandled exception" <<
endlog();
123 log(
Error) <<
"in configure(): switching to exception state because of unhandled exception" <<
endlog();
139 )
CATCH(std::exception
const& e,
140 log(
Error) <<
"in cleanup(): switching to exception state because of unhandled exception" <<
endlog();
144 log(
Error) <<
"in cleanup(): switching to exception state because of unhandled exception" <<
endlog();
177 )
CATCH(std::exception
const& e,
178 log(
RTT::Error) <<
"stopHook(), cleanupHook() and/or exceptionHook() raised " << e.what() <<
", going into Fatal" <<
endlog();
181 log(
Error) <<
"stopHook(), cleanupHook() and/or exceptionHook() raised an exception, going into Fatal" <<
endlog();
207 log(
Error) <<
"in start(): state has been changed inside the startHook" <<
endlog();
208 log(
Error) <<
" but startHook returned true. Bailing out." <<
endlog();
220 )
CATCH(std::exception
const& e,
221 log(
Error) <<
"in start(): switching to exception state because of unhandled exception" <<
endlog();
225 log(
Error) <<
"in start(): switching to exception state because of unhandled exception" <<
endlog();
237 if (
engine()->stopTask(
this) ) {
246 )
CATCH(std::exception
const& e,
247 log(
Error) <<
"in stop(): switching to exception state because of unhandled exception" <<
endlog();
251 log(
Error) <<
"in stop(): switching to exception state because of unhandled exception" <<
endlog();
virtual bool setPeriod(Seconds s)=0
#define TRY(C)
Contains static global configuration variables and cached entries.
The state indicating the component encountered a C++ exception.
ActivityInterface * getActivity() const
Query for the task this interface is run in.
virtual bool configureHook()
virtual void updateHook()
TaskState const mInitialState
virtual TaskState getTargetState() const
virtual bool isActive() const =0
The state indicating that a run-time error has occured [red] and needs attention. ...
virtual bool isConfigured() const
virtual bool setCpuAffinity(unsigned cpu)
virtual bool isRunning() const
virtual unsigned getCpuAffinity() const =0
The state indicating additional configuration is required.
virtual Seconds getPeriod() const
virtual bool inException() const
virtual bool inFatalError() const
TaskCore(TaskState initial_state=Stopped, const std::string &name=std::string())
virtual bool setCpuAffinity(unsigned cpu)=0
The state indicating the component encountered a fatal error and is unable to execute.
virtual void exceptionHook()
base::TaskCore * getParent()
virtual Seconds getPeriod() const =0
virtual bool breakUpdateHook()
virtual TaskState getTaskState() const
virtual bool isActive() const
virtual void cleanupHook()
virtual bool inRunTimeError() const
The state indicating the component is running [green].
virtual unsigned getCpuAffinity() const
#define tracepoint_context(provider, event, name)
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
The state indicating the component is ready to run.
virtual bool setPeriod(Seconds s)
const ExecutionEngine * engine() const
static Logger::LogFunction endlog()