TimerComponent.hpp
Go to the documentation of this file.
1 #ifndef ORO_TIMER_COMPONENT_HPP
2 #define ORO_TIMER_COMPONENT_HPP
3 
4 
5 #include <rtt/os/TimeService.hpp>
6 #include <rtt/TaskContext.hpp>
7 #include <rtt/os/Timer.hpp>
8 #include <rtt/OutputPort.hpp>
9 
10 #include <rtt/RTT.hpp>
11 #include <ocl/OCL.hpp>
12 
13 namespace OCL
14 {
22  : public RTT::TaskContext
23  {
24  protected:
28  struct TimeoutCatcher : public os::Timer {
30  std::vector<RTT::OutputPort<RTT::os::Timer::TimerId>* >& m_port_timers;
32  os::Timer(port_timers.size(), ORO_SCHED_RT, os::HighestPriority, name + ".Timer"),
33  me(op),
34  m_port_timers(port_timers)
35  {}
36  virtual void timeout(os::Timer::TimerId id) {
37  m_port_timers[id]->write(id);
38  me.write(id);
39  }
40  };
41 
42  std::vector<OutputPort<RTT::os::Timer::TimerId>* > port_timers;
45 
50  bool startHook();
51  void updateHook();
52  void stopHook();
53 
58 
63 
68 
72  bool wait(RTT::os::Timer::TimerId id, double seconds);
73 
78  public:
82  TimerComponent( std::string name = "os::Timer" );
83 
84  virtual ~TimerComponent();
85  };
86 
87 }
88 
89 #endif
TimeoutCatcher mtimer
RTT::Operation< bool(RTT::os::Timer::TimerId, double)> waitCommand
Variable opBinary s not applicable to op
Definition: rtt.cpp:757
RTT::Operation< bool(RTT::os::Timer::TimerId)> waitForCommand
bool wait(RTT::os::Timer::TimerId id, double seconds)
TimerComponent(std::string name="os::Timer")
const int HighestPriority
OutputPort< RTT::os::Timer::TimerId > mtimeoutEvent
std::vector< OutputPort< RTT::os::Timer::TimerId > * > port_timers
A Component interface to the Real-Time types::Toolkit&#39;s timer. It must be configured with a Activity ...
bool waitFor(RTT::os::Timer::TimerId id)
std::vector< RTT::OutputPort< RTT::os::Timer::TimerId > * > & m_port_timers
WriteStatus write(const T &sample)
TimeoutCatcher(std::vector< RTT::OutputPort< RTT::os::Timer::TimerId > * > &port_timers, RTT::OutputPort< RTT::os::Timer::TimerId > &op, const std::string &name)
bool isTimerExpired(RTT::os::Timer::TimerId id) const
virtual void timeout(os::Timer::TimerId id)
#define ORO_SCHED_RT
RTT::OutputPort< RTT::os::Timer::TimerId > & me


ocl
Author(s): OCL Development Team
autogenerated on Mon Mar 23 2020 04:47:19