State.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2015 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 
44  {
46  public: State();
47 
55  public: State(const std::string &_name,
56  const common::Time &_realTime,
57  const common::Time &_simTime);
58 
60  public: virtual ~State();
61 
66  public: virtual void Load(const sdf::ElementPtr _elem);
67 
71  public: State &operator=(const State &_state);
72 
76  public: State operator-(const State &_state) const;
77 
81  public: std::string GetName() const;
82 
86  public: void SetName(const std::string &_name);
87 
90  public: common::Time GetWallTime() const;
91 
94  public: common::Time GetRealTime() const;
95 
98  public: common::Time GetSimTime() const;
99 
103  public: virtual void SetWallTime(const common::Time &_time);
104 
107  public: virtual void SetRealTime(const common::Time &_time);
108 
111  public: virtual void SetSimTime(const common::Time &_time);
112 
114  protected: std::string name;
115 
117  protected: common::Time wallTime, realTime, simTime;
118  };
120  }
121 }
122 #endif
std::string name
Name associated with this State.
Definition: State.hh:114
State of an entity.
Definition: State.hh:43
default namespace for gazebo
common::Time wallTime
Times for the state data.
Definition: State.hh:117
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:43