#include <SimulationThread.hpp>
Public Member Functions | |
virtual bool | isRunning () const |
virtual bool | isRunning () const |
virtual bool | run (unsigned int maxsteps) |
virtual bool | run (unsigned int maxsteps) |
virtual os::ThreadInterface * | simthread () |
virtual os::ThreadInterface * | simthread () |
virtual bool | start (unsigned int maxsteps) |
virtual bool | start () |
virtual bool | start (unsigned int maxsteps) |
virtual bool | start () |
virtual | ~SimulationThread () |
virtual | ~SimulationThread () |
Static Public Member Functions | |
static SimulationThreadPtr | Instance (double period=0.001) |
static SimulationThreadPtr | Instance (double period=0.001) |
static bool | Release () |
static bool | Release () |
Protected Member Functions | |
void | finalize () |
void | finalize () |
bool | initialize () |
bool | initialize () |
SimulationThread (double period) | |
SimulationThread (double period) | |
void | step () |
void | step () |
Private Attributes | |
os::TimeService * | beat |
unsigned int | cursteps |
unsigned int | maxsteps_ |
bool | sim_running |
Static Private Attributes | |
static SimulationThreadPtr | _instance |
This thread is the simulated real-time periodic thread in the Orocos system.
All your activities in the same program must be a SimulationActivity for this to work, since the os::TimeService global time is updated when this thread runs.
By default, the update period is 0.001 seconds. If you want to run with a finer or coarser grained time step, use the Instance() method and supply another period before SimulationActivities are created.
Definition at line 61 of file install/include/rtt/extras/SimulationThread.hpp.
RTT::SimulationThread::~SimulationThread | ( | ) | [virtual] |
Destructor
Definition at line 98 of file SimulationThread.cpp.
RTT::SimulationThread::SimulationThread | ( | double | period | ) | [protected] |
Constructor
Definition at line 86 of file SimulationThread.cpp.
virtual RTT::extras::SimulationThread::~SimulationThread | ( | ) | [virtual] |
Destructor
RTT::extras::SimulationThread::SimulationThread | ( | double | period | ) | [protected] |
Constructor
void RTT::extras::SimulationThread::finalize | ( | ) | [protected, virtual] |
Reimplemented from RTT::extras::TimerThread.
void RTT::SimulationThread::finalize | ( | ) | [protected, virtual] |
Reimplemented from RTT::extras::TimerThread.
Definition at line 155 of file SimulationThread.cpp.
bool RTT::extras::SimulationThread::initialize | ( | ) | [protected, virtual] |
Reimplemented from RTT::extras::TimerThread.
bool RTT::SimulationThread::initialize | ( | ) | [protected, virtual] |
Reimplemented from RTT::extras::TimerThread.
Definition at line 141 of file SimulationThread.cpp.
static SimulationThreadPtr RTT::extras::SimulationThread::Instance | ( | double | period = 0.001 |
) | [static] |
Create the SimulationThread with a given period. Only one SimulationThread can be created.
period | The period in seconds at which the simulation takes steps and updates the TimeService. Only the first invocation of Instance will consider this parameter. The others will ignore it. |
SimulationThreadPtr RTT::SimulationThread::Instance | ( | double | period = 0.001 |
) | [static] |
Create the SimulationThread with a given period. Only one SimulationThread can be created.
period | The period in seconds at which the simulation takes steps and updates the TimeService. Only the first invocation of Instance will consider this parameter. The others will ignore it. |
Definition at line 69 of file SimulationThread.cpp.
virtual bool RTT::extras::SimulationThread::isRunning | ( | ) | const [virtual] |
Returns true if thread is running or run( unsigned int ) is being invoked.
Reimplemented from RTT::os::Thread.
bool RTT::SimulationThread::isRunning | ( | ) | const [virtual] |
Returns true if thread is running or run( unsigned int ) is being invoked.
Reimplemented from RTT::os::Thread.
Definition at line 103 of file SimulationThread.cpp.
static bool RTT::extras::SimulationThread::Release | ( | ) | [static] |
Releases the SimulationThread Reference counting might aid in making this call safe
bool RTT::SimulationThread::Release | ( | ) | [static] |
Releases the SimulationThread Reference counting might aid in making this call safe
Definition at line 79 of file SimulationThread.cpp.
virtual bool RTT::extras::SimulationThread::run | ( | unsigned int | maxsteps | ) | [virtual] |
bool RTT::SimulationThread::run | ( | unsigned int | maxsteps | ) | [virtual] |
Execute maxsteps steps immediately. This function will call the step() functions maxsteps times, without requiring start() or stop() to be called before or after. The thread is thus not used.
Definition at line 122 of file SimulationThread.cpp.
virtual os::ThreadInterface* RTT::extras::SimulationThread::simthread | ( | ) | [virtual] |
Always returns the MainThread.
os::ThreadInterface * RTT::SimulationThread::simthread | ( | ) | [virtual] |
Always returns the MainThread.
Definition at line 137 of file SimulationThread.cpp.
virtual bool RTT::extras::SimulationThread::start | ( | unsigned int | maxsteps | ) | [virtual] |
Only run the simulation maxsteps time steps, then stop the SimulationThread.
virtual bool RTT::extras::SimulationThread::start | ( | ) | [virtual] |
Start the Thread.
Reimplemented from RTT::os::Thread.
bool RTT::SimulationThread::start | ( | unsigned int | maxsteps | ) | [virtual] |
Only run the simulation maxsteps time steps, then stop the SimulationThread.
Definition at line 114 of file SimulationThread.cpp.
bool RTT::SimulationThread::start | ( | ) | [virtual] |
Start the Thread.
Reimplemented from RTT::os::Thread.
Definition at line 108 of file SimulationThread.cpp.
void RTT::extras::SimulationThread::step | ( | ) | [protected, virtual] |
Reimplemented from RTT::extras::TimerThread.
void RTT::SimulationThread::step | ( | ) | [protected, virtual] |
Reimplemented from RTT::extras::TimerThread.
Definition at line 166 of file SimulationThread.cpp.
static SimulationThreadPtr RTT::extras::SimulationThread::_instance [static, private] |
Our only instance of the SimulationThread
Definition at line 132 of file install/include/rtt/extras/SimulationThread.hpp.
os::TimeService * RTT::extras::SimulationThread::beat [private] |
The System clock.
Definition at line 137 of file install/include/rtt/extras/SimulationThread.hpp.
unsigned int RTT::extras::SimulationThread::cursteps [private] |
Definition at line 139 of file install/include/rtt/extras/SimulationThread.hpp.
unsigned int RTT::extras::SimulationThread::maxsteps_ [private] |
Definition at line 139 of file install/include/rtt/extras/SimulationThread.hpp.
bool RTT::extras::SimulationThread::sim_running [private] |
Definition at line 141 of file install/include/rtt/extras/SimulationThread.hpp.