RTT::RunnableInterface Class Reference
[Activity (thread) classes.]

This class adds Activity specific semantics to OS::RunnableInterface and sits in the RTT namespace. More...

#include <rtt/RunnableInterface.hpp>

Inheritance diagram for RTT::RunnableInterface:
RTT::OS::RunnableInterface RTT::CommandProcessor RTT::EventProcessor RTT::ExecutionEngine RTT::ProgramProcessor RTT::StateMachineProcessor RTT::Timer RTT::BlockingEventProcessor RTT::CompletionProcessor

List of all members.

Public Member Functions

 ~RunnableInterface ()
 Checks if this is still in a task and if so, issues a critical warning.
virtual bool hasWork ()
 This method is for 'intelligent' activity implementations that wish to see if it is required to call step() (again).
ActivityInterfacegetActivity () const
 Query for the task this interface is run in.
virtual void setActivity (ActivityInterface *task)
 Set the task this interface is run in.
virtual OS::ThreadInterfacegetThread () const
 Get the thread this object is run in.
virtual bool initialize ()=0
 The method that will be called before the first periodical execution of step() ( or non periodical execution of loop() ), when the thread is started.
virtual void step ()=0
 The method that will be periodically executed when this class RTT_API is run in a periodic thread.
virtual void loop ()
 The method that will be executed once when this class RTT_API is run in a non periodic thread.
virtual bool breakLoop ()
 This method is called by the framework to break out of the loop() method.
virtual void finalize ()=0
 The method that will be called after the last periodical execution of step() ( or non periodical execution of loop() ), when the RunnableInterface is stopped.
virtual void setThread (ThreadInterface *t)
 Set the thread this object will be run in.

Detailed Description

This class adds Activity specific semantics to OS::RunnableInterface and sits in the RTT namespace.

Applications should always use this class instead of the OS version.

The getActivity() method is guaranteed to return a valid task pointer during initialize(), step() or loop() and finalize(). This allows the RunnableInterface to query the task's period(icity) and ThreadInterface. Consequently, initialize() knows whether step() or loop() will be called ( depending on ActivityInterface::isPeriodic() ).

See also:
ActivityInterface

Definition at line 60 of file RunnableInterface.hpp.


Member Function Documentation

virtual bool RTT::OS::RunnableInterface::breakLoop (  )  [virtual, inherited]

This method is called by the framework to break out of the loop() method.

Reimplement this method to signal loop() to return and return true on success. When this method is not reimplemented by you, it will always return false, denoting that the loop can not be broken. If breakLoop() returns true, the caller will wait until loop() returns.

Returns:
true if the loop could be notified to return.

Reimplemented in RTT::EventProcessor, RTT::ExecutionEngine, and RTT::Timer.

ActivityInterface * RTT::RunnableInterface::getActivity (  )  const [inline]

Query for the task this interface is run in.

Zero denotes that no task is present to run it, and hence no detailed information is available.

Returns:
The Activity which runs this RunnableInterface.

Definition at line 106 of file RunnableInterface.hpp.

virtual OS::ThreadInterface* RTT::RunnableInterface::getThread (  )  const [virtual]

Get the thread this object is run in.

Returns:
a pointer to the thread or 0 if not run by a thread.

Reimplemented from RTT::OS::RunnableInterface.

virtual bool RTT::RunnableInterface::hasWork (  )  [virtual]

This method is for 'intelligent' activity implementations that wish to see if it is required to call step() (again).

By default, false is returned. You should only return true in case there is a temporary reason to (re-)run step.

Returns:
true if this object should be run.
See also:
SequentialActivity implementation to see how this can be of use.

Reimplemented in RTT::CommandProcessor, RTT::EventProcessor, and RTT::ExecutionEngine.

virtual void RTT::OS::RunnableInterface::loop (  )  [virtual, inherited]

The method that will be executed once when this class RTT_API is run in a non periodic thread.

The default implementation calls step() once.

Reimplemented in RTT::Timer.

virtual void RTT::RunnableInterface::setActivity ( ActivityInterface task  )  [virtual]

Set the task this interface is run in.

A Zero means no task is running it.

Parameters:
task The ActivityInterface running this interface.

Reimplemented in RTT::ExecutionEngine.


The documentation for this class was generated from the following file:
Generated on Thu Dec 23 13:22:44 2010 for Orocos Real-Time Toolkit by  doxygen 1.6.3