State.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 /* Desc: A generic physics state
18  * Author: Nate Koenig
19  */
20 
21 #ifndef _STATE_HH_
22 #define _STATE_HH_
23 
24 #include <string>
25 
26 #include <sdf/sdf.hh>
27 
29 #include "gazebo/common/Time.hh"
30 #include "gazebo/util/system.hh"
31 
32 namespace gazebo
33 {
34  namespace physics
35  {
38 
43  class GZ_PHYSICS_VISIBLE State
44  {
46  public: State();
47 
56  public: State(const std::string &_name,
57  const common::Time &_realTime,
58  const common::Time &_simTime,
59  const uint64_t _iterations);
60 
62  public: virtual ~State();
63 
68  public: virtual void Load(const sdf::ElementPtr _elem);
69 
73  public: State &operator=(const State &_state);
74 
78  public: State operator-(const State &_state) const;
79 
83  public: std::string GetName() const;
84 
88  public: void SetName(const std::string &_name);
89 
92  public: common::Time GetWallTime() const;
93 
96  public: common::Time GetRealTime() const;
97 
100  public: common::Time GetSimTime() const;
101 
104  public: uint64_t GetIterations() const;
105 
109  public: virtual void SetWallTime(const common::Time &_time);
110 
113  public: virtual void SetRealTime(const common::Time &_time);
114 
117  public: virtual void SetSimTime(const common::Time &_time);
118 
121  public: virtual void SetIterations(const uint64_t _iterations);
122 
124  protected: std::string name;
125 
127  protected: common::Time wallTime, realTime, simTime;
128 
131  protected: uint64_t iterations = 0;
132  };
134  }
135 }
136 #endif
std::string name
Name associated with this State.
Definition: State.hh:124
Forward declarations for the common classes.
Definition: Animation.hh:26
common::Time wallTime
Times for the state data.
Definition: State.hh:127
State of an entity.
Definition: State.hh:43
default namespace for gazebo
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:47