A centralized list of all TaskContexts using SimClockActivity. More...
#include <rtt_rosclock_sim_clock_activity_manager.h>
Public Member Functions | |
RTT::Seconds | getSimulationPeriod () const |
void | setSimulationPeriod (RTT::Seconds s) |
void | update () |
Execute all activities modulo their desired periods. | |
~SimClockActivityManager () | |
Static Public Member Functions | |
static boost::shared_ptr < SimClockActivityManager > | GetInstance () |
Get an instance of the singleton if it exists, null pointer otherwise. | |
static boost::shared_ptr < SimClockActivityManager > | Instance () |
Get an instance of the singleton. | |
Protected Member Functions | |
void | operator= (SimClockActivityManager const &) |
SimClockActivityManager () | |
The SimClockActivityManager is a singleton and is constructed by calling Instance() | |
SimClockActivityManager (SimClockActivityManager const &) | |
The SimClockActivityManager is a singleton and is constructed by calling Instance() | |
Private Member Functions | |
void | add (SimClockActivity *activity) |
Add an activity to the manager. | |
void | remove (SimClockActivity *activity) |
Remove an activity from the manager. | |
Private Attributes | |
std::list< SimClockActivity * > | activities_ |
All existing SimClockActivities. | |
RTT::os::Mutex | modify_activities_mutex_ |
Mutex used to exclude adding and removing activities from the update to all activities. | |
RTT::Seconds | simulation_period_ |
The desired/expected simulation period. | |
Static Private Attributes | |
static boost::weak_ptr < SimClockActivityManager > | singleton |
SimClockActivityManager singleton. | |
Friends | |
class | SimClockActivity |
Only SimClockActivities can add or remove themselves. |
A centralized list of all TaskContexts using SimClockActivity.
The SimClockActivityManager is used to synchronously update all TaskContexts using a SimClockActivity. This is the primary interface to executing a set of periodic tasks in simulation.
Definition at line 63 of file rtt_rosclock_sim_clock_activity_manager.h.
Definition at line 76 of file rtt_rosclock_sim_clock_activity_manager.cpp.
SimClockActivityManager::SimClockActivityManager | ( | ) | [protected] |
The SimClockActivityManager is a singleton and is constructed by calling Instance()
Definition at line 71 of file rtt_rosclock_sim_clock_activity_manager.cpp.
rtt_rosclock::SimClockActivityManager::SimClockActivityManager | ( | SimClockActivityManager const & | ) | [protected] |
The SimClockActivityManager is a singleton and is constructed by calling Instance()
void SimClockActivityManager::add | ( | SimClockActivity * | activity | ) | [private] |
Add an activity to the manager.
Definition at line 107 of file rtt_rosclock_sim_clock_activity_manager.cpp.
boost::shared_ptr< SimClockActivityManager > SimClockActivityManager::GetInstance | ( | ) | [static] |
Get an instance of the singleton if it exists, null pointer otherwise.
Definition at line 54 of file rtt_rosclock_sim_clock_activity_manager.cpp.
Definition at line 80 of file rtt_rosclock_sim_clock_activity_manager.cpp.
boost::shared_ptr< SimClockActivityManager > SimClockActivityManager::Instance | ( | ) | [static] |
Get an instance of the singleton.
Definition at line 59 of file rtt_rosclock_sim_clock_activity_manager.cpp.
void rtt_rosclock::SimClockActivityManager::operator= | ( | SimClockActivityManager const & | ) | [protected] |
void SimClockActivityManager::remove | ( | SimClockActivity * | activity | ) | [private] |
Remove an activity from the manager.
Definition at line 116 of file rtt_rosclock_sim_clock_activity_manager.cpp.
Definition at line 85 of file rtt_rosclock_sim_clock_activity_manager.cpp.
void SimClockActivityManager::update | ( | ) |
Execute all activities modulo their desired periods.
Definition at line 90 of file rtt_rosclock_sim_clock_activity_manager.cpp.
friend class SimClockActivity [friend] |
Only SimClockActivities can add or remove themselves.
Definition at line 89 of file rtt_rosclock_sim_clock_activity_manager.h.
std::list<SimClockActivity *> rtt_rosclock::SimClockActivityManager::activities_ [private] |
All existing SimClockActivities.
Definition at line 105 of file rtt_rosclock_sim_clock_activity_manager.h.
Mutex used to exclude adding and removing activities from the update to all activities.
Definition at line 102 of file rtt_rosclock_sim_clock_activity_manager.h.
The desired/expected simulation period.
Definition at line 108 of file rtt_rosclock_sim_clock_activity_manager.h.
boost::weak_ptr< SimClockActivityManager > SimClockActivityManager::singleton [static, private] |
SimClockActivityManager singleton.
Definition at line 99 of file rtt_rosclock_sim_clock_activity_manager.h.