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 addActivity (PeriodicActivity *t)
bool removeActivity (PeriodicActivity *t)
bool removeActivity (PeriodicActivity *t)
 TimerThread (int scheduler, int priority, const std::string &name, double periodicity, unsigned cpu_affinity=~0)
 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)
 TimerThread (int priority, const std::string &name, double periodicity, unsigned cpu_affinity=~0)
virtual ~TimerThread ()
virtual ~TimerThread ()

Static Public Member Functions

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

Static Public Attributes

static const unsigned int MAX_ACTIVITIES = 64

Protected Types

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

Protected Member Functions

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

Protected Attributes

os::MutexRecursive mutex

Static Protected Attributes

static TimerThreadList TimerThreads

Private Types

typedef std::vector
< PeriodicActivity * > 
ActivityList
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 install/include/rtt/extras/TimerThread.hpp.


Member Typedef Documentation

Definition at line 72 of file rtt/extras/TimerThread.hpp.

Definition at line 72 of file install/include/rtt/extras/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 rtt/extras/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 install/include/rtt/extras/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:
priority The priority of this thread
periodicity The 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:
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 )

Definition at line 96 of file TimerThread.cpp.

RTT::TimerThread::~TimerThread (  )  [virtual]

Destructor

Definition at line 102 of file TimerThread.cpp.

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

Create a periodic Timer thread.

Parameters:
priority The priority of this thread
periodicity The periodicity of this thread in seconds (e.g. 0.001 = 1000Hz )
RTT::extras::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:
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 RTT::extras::TimerThread::~TimerThread (  )  [virtual]

Destructor


Member Function Documentation

bool RTT::extras::TimerThread::addActivity ( PeriodicActivity t  ) 

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

bool RTT::TimerThread::addActivity ( PeriodicActivity t  ) 

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.

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

Reimplemented from RTT::os::Thread.

Reimplemented in RTT::extras::SimulationThread, and RTT::extras::SimulationThread.

Definition at line 135 of file TimerThread.cpp.

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

Reimplemented from RTT::os::Thread.

Reimplemented in RTT::extras::SimulationThread, and RTT::extras::SimulationThread.

Definition at line 131 of file TimerThread.cpp.

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

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

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

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

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

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

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.

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  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.

bool RTT::extras::TimerThread::removeActivity ( PeriodicActivity t  ) 
bool RTT::TimerThread::removeActivity ( PeriodicActivity t  ) 

Definition at line 119 of file TimerThread.cpp.

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

Definition at line 158 of file TimerThread.cpp.

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

Reimplemented from RTT::os::Thread.

Reimplemented in RTT::extras::SimulationThread, and RTT::extras::SimulationThread.

Definition at line 145 of file TimerThread.cpp.


Member Data Documentation

Definition at line 74 of file install/include/rtt/extras/TimerThread.hpp.

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

Definition at line 76 of file install/include/rtt/extras/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 install/include/rtt/extras/TimerThread.hpp.

Definition at line 73 of file install/include/rtt/extras/TimerThread.hpp.

All timer threads.

Definition at line 145 of file install/include/rtt/extras/TimerThread.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


rtt
Author(s): RTT Developers
autogenerated on Fri Jan 11 09:49:56 2013