rtt_rosclock_sim_clock_activity.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2013, Johannes Meyer, TU Darmstadt
5  * Copyright (c) 2013, Intermodalics BVBA
6  * All rights reserved.
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  *
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * * Neither the name of TU Darmstadt and Intermodalics BVBA
19  * nor the names of its contributors may be
20  * used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  * Copyright (c) 2014, Jonathan Bohren, The Johns Hopkins University
37  * - Generalized for multiple time sources
38  * - Integrated with rtt_rosclock package
39  *********************************************************************/
40 
41 
42 #ifndef __RTT_ROSCLOCK_RTT_ROSCLOCK_SIM_CLOCK_ACTIVITY_H
43 #define __RTT_ROSCLOCK_RTT_ROSCLOCK_SIM_CLOCK_ACTIVITY_H
44 
47 
48 #include <rtt/os/TimeService.hpp>
49 #include <rtt/os/Mutex.hpp>
50 
51 #include <list>
52 #include <string>
53 
54 namespace rtt_rosclock {
55 
56  class SimClockActivityManager;
57 
59  {
60  public:
63  const std::string& name = "SimClockActivity");
64 
66  RTT::Seconds period,
68  const std::string& name ="SimClockActivity");
69 
70  virtual ~SimClockActivity();
71 
72  virtual RTT::Seconds getPeriod() const;
73  virtual bool isPeriodic() const;
74  virtual bool setPeriod(RTT::Seconds s);
75 
76  virtual unsigned getCpuAffinity() const;
77  virtual bool setCpuAffinity(unsigned cpu);
78 
80 
81  virtual bool initialize();
82  virtual void step();
83 #if defined(RTT_VERSION_GTE)
84 #if RTT_VERSION_GTE(2,9,0)
86 #endif
87 #endif
88  virtual void loop();
89  virtual bool breakLoop();
90  virtual void finalize();
91 
92  virtual bool start();
93  virtual bool stop();
94 
95  virtual bool isRunning() const;
96  virtual bool isActive() const;
97 
98  virtual bool execute();
99  virtual bool trigger();
100  virtual bool timeout();
101 
103 
104  private:
105  std::string name_;
106 
109 
111  bool running_;
112 
114  bool active_;
115 
118 
121  };
122 }
123 
124 #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 Sat Jun 8 2019 18:06:00