rtt_rosclock_sim_clock_activity.h
Go to the documentation of this file.
1 /*
2  * (C) 2013, Johannes Meyer, TU Darmstadt
3  * (C) 2013, Intermodalics BVBA
4  * (C) 2014, Jonathan Bohren, The Johns Hopkins University
5  * - Generalized for multiple time sources
6  * - Integrated with rtt_rosclock package
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in the
15  * documentation and/or other materials provided with the distribution.
16  * 3. Neither the name of the copyright holder nor the names of its contributors
17  * may be used to endorse or promote products derived from this software
18  * without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 
35 #ifndef __RTT_ROSCLOCK_RTT_ROSCLOCK_SIM_CLOCK_ACTIVITY_H
36 #define __RTT_ROSCLOCK_RTT_ROSCLOCK_SIM_CLOCK_ACTIVITY_H
37 
40 
41 #include <rtt/os/TimeService.hpp>
42 #include <rtt/os/Mutex.hpp>
43 
44 #include <list>
45 #include <string>
46 
47 namespace rtt_rosclock {
48 
49  class SimClockActivityManager;
50 
52  {
53  public:
56  const std::string& name = "SimClockActivity");
57 
59  RTT::Seconds period,
61  const std::string& name ="SimClockActivity");
62 
63  virtual ~SimClockActivity();
64 
65  virtual RTT::Seconds getPeriod() const;
66  virtual bool isPeriodic() const;
67  virtual bool setPeriod(RTT::Seconds s);
68 
69  virtual unsigned getCpuAffinity() const;
70  virtual bool setCpuAffinity(unsigned cpu);
71 
73 
74  virtual bool initialize();
75  virtual void step();
76 #if defined(RTT_VERSION_GTE)
77 #if RTT_VERSION_GTE(2,9,0)
79 #endif
80 #endif
81  virtual void loop();
82  virtual bool breakLoop();
83  virtual void finalize();
84 
85  virtual bool start();
86  virtual bool stop();
87 
88  virtual bool isRunning() const;
89  virtual bool isActive() const;
90 
91  virtual bool execute();
92  virtual bool trigger();
93  virtual bool timeout();
94 
96 
97  private:
98  std::string name_;
99 
102 
104  bool running_;
105 
107  bool active_;
108 
111 
114  };
115 }
116 
117 #endif // ifndef __RTT_ROSCLOCK_RTT_ROSCLOCK_SIM_CLOCK_ACTIVITY_H
double Seconds
bool active_
True if start() has been called.
RTT::Seconds period_
The desired minimum execution period.
bool running_
True after start() has succeeded.
SimClockActivity(RTT::base::RunnableInterface *run=0, const std::string &name="SimClockActivity")
XmlRpcServer s
virtual bool run(RunnableInterface *r)
virtual RTT::os::TimeService::ticks getLastExecutionTicks() const
boost::shared_ptr< SimClockActivityManager > manager_
Parent activity manager.
RTT::os::TimeService::ticks last_
The last time the activity was executed.
virtual RTT::os::ThreadInterface * thread()


rtt_rosclock
Author(s):
autogenerated on Mon May 10 2021 02:45:33