40 #include "../os/MainThread.hpp" 44 using namespace extras;
47 :
ActivityInterface(run), mmaster(master), mperiod( master->getPeriod() ), running(false), active(false)
52 :
ActivityInterface(run), mmaster(0), mperiod(period), running(false), active(false)
128 if (mmaster && !mmaster->
isActive())
133 if ( active ==
true )
177 return mperiod != 0.0;
194 if ( mperiod == 0.0 ) {
195 if ( !active || running )
double Seconds
Seconds are stored as a double precision float.
virtual bool trigger()=0
Trigger that work has to be done.
static ThreadInterface * Instance()
Return an object which represents the main thread.
A class for running a certain piece of code in a thread.
virtual bool isActive() const =0
Query if the activity is started.
virtual void step()=0
The method that will be periodically executed when this class is run in a periodic thread...
virtual unsigned getCpuAffinity() const =0
Get the cpu affinity of this activity.
virtual bool run(RunnableInterface *r)
Run exclusively this RunnableInterface.
RunnableInterface * runner
A thread which is being run.
Interface to start/stop and query a Activity.
static std::ostream & endl(std::ostream &__os)
virtual Seconds getPeriod() const =0
Get the periodicity of this activity in Seconds.
virtual void finalize()=0
The method that will be called after the last periodical execution of step() ( or non periodical exec...
virtual os::ThreadInterface * thread()=0
Returns a pointer to the thread which will run this activity.
virtual void loop()
The method that will be executed once when this class is run in a non periodic thread.
static Logger & log()
As Instance(), but more userfriendly.
virtual bool initialize()=0
The method that will be called before the first periodical execution of step() ( or non periodical ex...
virtual bool breakLoop()
This method is called by the framework to break out of the loop() method.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.