#include </home/sspr/src/www/orocos-1.0/export/build/orocos-rtt-1.2.2/build/rtt/TimerThread.hpp>
Inheritance diagram for TimerThread:

It does this by invoking a Timer object which executes the activities.
Public Types | |
| typedef double | Seconds |
| typedef long | secs |
| typedef long | msecs |
| typedef long long | nsecs |
Public Member Functions | |
| TimerThread (int priority, const std::string &name, double periodicity) | |
| Create a periodic Timer thread. | |
| TimerThread (int scheduler, int priority, const std::string &name, double periodicity) | |
| Create a periodic Timer thread with a given scheduler type. | |
| virtual | ~TimerThread () |
| Destructor. | |
| bool | timerAdd (detail::TimerInterface *) |
| Add an Timer that will be ticked every execution period Once added, a timer can not be removed. | |
| detail::TimerInterface * | timerGet (Seconds period) const |
| Get a Timer ticking at a certain period. | |
| virtual bool | run (OS::RunnableInterface *r) |
| Run the functionality of one RunnableInterface object. | |
| virtual bool | start () |
| Start the thread. | |
| virtual bool | stop () |
| Stop the thread. | |
| bool | setPeriod (Seconds s) |
| Set the periodicity of this thread in seconds. | |
| bool | setPeriod (secs s, nsecs ns) |
| Set the periodicity of this thread (seconds, nanoseconds). | |
| bool | setPeriod (TIME_SPEC p) |
| Set the periodicity of this thread. | |
| void | getPeriod (secs &s, nsecs &ns) const |
| Get the periodicity of this thread (seconds, nanoseconds). | |
| virtual Seconds | getPeriod () const |
| Get the periodicity of this thread in seconds. | |
| virtual nsecs | getPeriodNS () const |
| Get the periodicity of this thread in nano-seconds. | |
| virtual bool | isRunning () const |
| Returns whether the thread is running. | |
| virtual const char * | getName () const |
| Read the name of this task. | |
| virtual RTOS_TASK * | getTask () |
| Get the RTOS_TASK pointer FIXME should this be a const? | |
| virtual bool | setScheduler (int sched_type) |
| Change the scheduler policy in which this thread runs. | |
| virtual int | getScheduler () const |
| Get the scheduler policy in which this thread runs. | |
| virtual bool | setPriority (int priority) |
| Set the priority of this Thread. | |
| virtual int | getPriority () const |
| The priority of this Thread. | |
| virtual void | yield () |
| Yields (but to the back of the scheduler queue) the calling thread. | |
| void | setMaxOverrun (int m) |
| int | getMaxOverrun () const |
| void | terminate () |
| Exit and destroy the thread. | |
| void | emergencyStop () |
| unsigned int | threadNumber () const |
| The unique thread number. | |
Static Public Member Functions | |
| static TimerThreadPtr | Instance (int priority, double periodicity) |
| Create a TimerThread with a given priority and periodicity, using the default scheduler, ORO_SCHED_RT. | |
| static TimerThreadPtr | Instance (int scheduler, int priority, double periodicity) |
| Create a TimerThread with a given scheduler, priority and periodicity. | |
Protected Types | |
| typedef std::vector< detail::TimerInterface * > | TimerList |
|
typedef std::vector< boost::weak_ptr< TimerThread > > | TimerThreadList |
| A Boost weak pointer is used to store non-owning pointers to shared objects. | |
Protected Member Functions | |
| virtual bool | initialize () |
| virtual void | step () |
| virtual void | finalize () |
| virtual void | continuousStepping (bool yes_no) |
| virtual bool | setToStop () |
| Use this from within step() to stop this thread. | |
Protected Attributes | |
| TimerList | clocks |
| A list containing all the Timer instances we must tick. | |
| OS::Mutex | lock |
| A Activity can not create a activity of same priority from step(). | |
| int | threadnb |
| Threads are given an unique number, which follows thread creation order. | |
Static Protected Attributes | |
| static TimerThreadList | TimerThreads |
| All timer threads. | |
| TimerThread | ( | int | priority, | |
| const std::string & | name, | |||
| double | periodicity | |||
| ) |
Create a periodic Timer thread.
| priority | The priority of this thread | |
| periodicity | The periodicity of this thread in seconds (e.g. 0.001 = 1000Hz ) |
| TimerThread | ( | int | scheduler, | |
| int | priority, | |||
| const std::string & | name, | |||
| double | periodicity | |||
| ) |
Create a periodic Timer thread with a given scheduler type.
| scheduler | The scheduler in which this thread runs | |
| priority | The priority of this thread within scheduler | |
| periodicity | The periodicity of this thread in seconds (e.g. 0.001 = 1000Hz ) |
| virtual bool run | ( | OS::RunnableInterface * | r | ) | [virtual, inherited] |
Run the functionality of one RunnableInterface object.
Only one RunnableInterface object can be run, the old one is disconnected.
| r | The object to run or zero to clear. |
Implements ThreadInterface.
| virtual bool setScheduler | ( | int | sched_type | ) | [virtual, inherited] |
Change the scheduler policy in which this thread runs.
| sched_type | An OS-specific value which selects a scheduler. Orocos requires that these two values are available: |
Implements ThreadInterface.
| virtual int getScheduler | ( | ) | const [virtual, inherited] |
Get the scheduler policy in which this thread runs.
Implements ThreadInterface.
| virtual bool setPriority | ( | int | priority | ) | [virtual, inherited] |
Set the priority of this Thread.
| priority | The priority given upon construction of this thread. It has to be interpreted in the current OS scheduler. |
Implements ThreadInterface.
| virtual int getPriority | ( | ) | const [virtual, inherited] |
The priority of this Thread.
Implements ThreadInterface.
| void terminate | ( | ) | [inherited] |
Exit and destroy the thread.
| virtual bool setToStop | ( | ) | [protected, virtual, inherited] |
Use this from within step() to stop this thread.
This function will call finalize() as well, thus it is advised to call this function as the last statement in your step().
TimerList clocks [protected] |
A list containing all the Timer instances we must tick.
A Activity can not create a activity of same priority from step().
If so a deadlock will occur.
int threadnb [protected, inherited] |
1.5.1