All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
State.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2014 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 
31 namespace gazebo
32 {
33  namespace physics
34  {
37 
42  class State
43  {
45  public: State();
46 
54  public: State(const std::string &_name,
55  const common::Time &_realTime,
56  const common::Time &_simTime);
57 
59  public: virtual ~State();
60 
65  public: virtual void Load(const sdf::ElementPtr _elem);
66 
70  public: State &operator=(const State &_state);
71 
75  public: State operator-(const State &_state) const;
76 
80  public: std::string GetName() const;
81 
85  public: void SetName(const std::string &_name);
86 
89  public: common::Time GetWallTime() const;
90 
93  public: common::Time GetRealTime() const;
94 
97  public: common::Time GetSimTime() const;
98 
102  public: virtual void SetWallTime(const common::Time &_time);
103 
106  public: virtual void SetRealTime(const common::Time &_time);
107 
110  public: virtual void SetSimTime(const common::Time &_time);
111 
113  protected: std::string name;
114 
117  };
119  }
120 }
121 #endif