1 #ifndef ORO_TIMER_COMPONENT_HPP 2 #define ORO_TIMER_COMPONENT_HPP 5 #include <rtt/os/TimeService.hpp> 6 #include <rtt/TaskContext.hpp> 7 #include <rtt/os/Timer.hpp> 8 #include <rtt/OutputPort.hpp> 10 #include <rtt/RTT.hpp> 11 #include <ocl/OCL.hpp> 22 :
public RTT::TaskContext
29 RTT::OutputPort<RTT::os::Timer::TimerId>& me;
30 std::vector<RTT::OutputPort<RTT::os::Timer::TimerId>* >& m_port_timers;
31 TimeoutCatcher(std::vector<RTT::OutputPort<RTT::os::Timer::TimerId>* >& port_timers, RTT::OutputPort<RTT::os::Timer::TimerId>& op) :
32 os::Timer(port_timers.size(), ORO_SCHED_RT, os::HighestPriority),
34 m_port_timers(port_timers)
36 virtual void timeout(os::Timer::TimerId
id) {
37 m_port_timers[id]->write(
id);
42 std::vector<OutputPort<RTT::os::Timer::TimerId>* > port_timers;
43 OutputPort<RTT::os::Timer::TimerId> mtimeoutEvent;
62 RTT::Operation<bool(RTT::os::Timer::TimerId, double)>
waitCommand;
67 bool waitFor(RTT::os::Timer::TimerId
id);
72 bool wait(RTT::os::Timer::TimerId
id,
double seconds);
bool startHook()
This hook will check if a Activity has been properly setup.
RTT::Operation< bool(RTT::os::Timer::TimerId)> waitForCommand
Command: wait until a timer expires.
bool wait(RTT::os::Timer::TimerId id, double seconds)
Command Implementation: arm and wait until a timer expires.
A Component interface to the Real-Time types::Toolkit's timer.
The Orocos Component Library.
Helper class for catching the virtual timeout function of Timer.
RTT::Operation< bool(RTT::os::Timer::TimerId, double)> waitCommand
Command: arm and wait until a timer expires.
bool isTimerExpired(RTT::os::Timer::TimerId id) const
Command Condition: return true if id expired.
TimerComponent(std::string name="os::Timer")
Set up a component for timing events.
bool waitFor(RTT::os::Timer::TimerId id)
Command Implementation: wait until a timer expires.