Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Types | Private Attributes
RTT::extras::TimerThread Class Reference

#include <TimerThread.hpp>

Inheritance diagram for RTT::extras::TimerThread:
Inheritance graph
[legend]

List of all members.

Public Member Functions

bool addActivity (PeriodicActivity *t)
bool removeActivity (PeriodicActivity *t)
 TimerThread (int priority, const std::string &name, double periodicity, unsigned cpu_affinity=~0)
 TimerThread (int scheduler, int priority, const std::string &name, double periodicity, unsigned cpu_affinity=~0)
virtual ~TimerThread ()

Static Public Member Functions

static TimerThreadPtr Instance (int priority, double periodicity)
static TimerThreadPtr Instance (int scheduler, int priority, double periodicity)
static TimerThreadPtr Instance (int scheduler, int priority, double periodicity, unsigned cpu_affinity)

Static Public Attributes

static const unsigned int MAX_ACTIVITIES = 64

Protected Types

typedef std::vector
< boost::weak_ptr< TimerThread > > 
TimerThreadList

Protected Member Functions

virtual void finalize ()
virtual bool initialize ()
void reorderList ()
virtual void step ()

Protected Attributes

os::MutexRecursive mutex

Static Protected Attributes

static TimerThreadList TimerThreads

Private Types

typedef std::vector
< PeriodicActivity * > 
ActivityList

Private Attributes

bool cleanup
ActivityList tasks

Detailed Description

This Periodic Thread is meant for executing a PeriodicActivity object periodically.

See also:
PeriodicActivity

Definition at line 69 of file TimerThread.hpp.


Member Typedef Documentation

Definition at line 72 of file TimerThread.hpp.

typedef std::vector< boost::weak_ptr<TimerThread> > RTT::extras::TimerThread::TimerThreadList [protected]

A Boost weak pointer is used to store non-owning pointers to shared objects.

Definition at line 140 of file TimerThread.hpp.


Constructor & Destructor Documentation

RTT::TimerThread::TimerThread ( int  priority,
const std::string &  name,
double  periodicity,
unsigned  cpu_affinity = ~0 
)

Create a periodic Timer thread.

Parameters:
priorityThe priority of this thread
periodicityThe periodicity of this thread in seconds (e.g. 0.001 = 1000Hz )

Definition at line 90 of file TimerThread.cpp.

RTT::TimerThread::TimerThread ( int  scheduler,
int  priority,
const std::string &  name,
double  periodicity,
unsigned  cpu_affinity = ~0 
)

Create a periodic Timer thread with a given scheduler type.

Parameters:
schedulerThe scheduler in which this thread runs
priorityThe priority of this thread within scheduler
periodicityThe periodicity of this thread in seconds (e.g. 0.001 = 1000Hz )

Definition at line 96 of file TimerThread.cpp.

Destructor

Definition at line 102 of file TimerThread.cpp.


Member Function Documentation

Add an Timer that will be ticked every execution period Once added, a timer can not be removed.

Definition at line 108 of file TimerThread.cpp.

void RTT::TimerThread::finalize ( ) [protected, virtual]
See also:
base::RunnableInterface::finalize()

Reimplemented from RTT::os::Thread.

Reimplemented in RTT::extras::SimulationThread.

Definition at line 135 of file TimerThread.cpp.

bool RTT::TimerThread::initialize ( ) [protected, virtual]
See also:
base::RunnableInterface::initialize()

Reimplemented from RTT::os::Thread.

Reimplemented in RTT::extras::SimulationThread.

Definition at line 131 of file TimerThread.cpp.

TimerThreadPtr RTT::TimerThread::Instance ( int  priority,
double  periodicity 
) [static]

Create a TimerThread with a given priority and periodicity, using the default scheduler, ORO_SCHED_RT.

Definition at line 56 of file TimerThread.cpp.

TimerThreadPtr RTT::TimerThread::Instance ( int  scheduler,
int  priority,
double  periodicity 
) [static]

Create a TimerThread with a given scheduler, priority and periodicity.

Definition at line 61 of file TimerThread.cpp.

TimerThreadPtr RTT::TimerThread::Instance ( int  scheduler,
int  priority,
double  periodicity,
unsigned  cpu_affinity 
) [static]

Create a TimerThread with a given scheduler, priority and periodicity.

Definition at line 66 of file TimerThread.cpp.

Definition at line 119 of file TimerThread.cpp.

void RTT::TimerThread::reorderList ( ) [protected]

Definition at line 158 of file TimerThread.cpp.

void RTT::TimerThread::step ( ) [protected, virtual]
See also:
base::RunnableInterface::step()

Reimplemented from RTT::os::Thread.

Reimplemented in RTT::extras::SimulationThread.

Definition at line 145 of file TimerThread.cpp.


Member Data Documentation

Definition at line 74 of file TimerThread.hpp.

const unsigned int RTT::extras::TimerThread::MAX_ACTIVITIES = 64 [static]

Definition at line 76 of file TimerThread.hpp.

A Activity can not create a activity of same priority from step(). If so a deadlock will occur.

Definition at line 134 of file TimerThread.hpp.

Definition at line 73 of file TimerThread.hpp.

All timer threads.

Definition at line 145 of file TimerThread.hpp.


The documentation for this class was generated from the following files:


rtt
Author(s): RTT Developers
autogenerated on Mon Oct 6 2014 03:13:58