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 2012 Nate Koenig
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 "gazebo/sdf/sdf.hh"
28 #include "gazebo/common/Time.hh"
29 
30 namespace gazebo
31 {
32  namespace physics
33  {
36 
41  class State
42  {
44  public: State();
45 
53  public: State(const std::string &_name,
54  const common::Time &_realTime,
55  const common::Time &_simTime);
56 
58  public: virtual ~State();
59 
64  public: virtual void Load(const sdf::ElementPtr _elem);
65 
69  public: State &operator=(const State &_state);
70 
74  public: State operator-(const State &_state) const;
75 
79  public: std::string GetName() const;
80 
84  public: void SetName(const std::string &_name);
85 
88  public: common::Time GetWallTime() const;
89 
92  public: common::Time GetRealTime() const;
93 
96  public: common::Time GetSimTime() const;
97 
99  protected: std::string name;
100 
103  };
105  }
106 }
107 #endif