Gazebo Physics

API Reference

7.4.0
FrameID.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 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 
18 #ifndef GZ_PHYSICS_FRAMEID_HH_
19 #define GZ_PHYSICS_FRAMEID_HH_
20 
21 #include <memory>
22 
23 #include <gz/physics/Export.hh>
24 #include <gz/physics/detail/Identity.hh>
25 #include <gz/utils/SuppressWarning.hh>
26 
27 namespace gz
28 {
29  namespace physics
30  {
31  // Forward declaration
32  class FrameSemantics;
33 
46  class GZ_PHYSICS_VISIBLE FrameID final
47  {
48  // Comparison operators
49  public: bool operator ==(const FrameID &_other) const;
50  public: bool operator <(const FrameID &_other) const;
51  public: bool operator >(const FrameID &_other) const;
52  public: bool operator <=(const FrameID &_other) const;
53  public: bool operator >=(const FrameID &_other) const;
54  public: bool operator !=(const FrameID &_other) const;
55 
56  // Explicitly allow default copy constructors and assignment operators
57  public: FrameID(const FrameID&) = default;
58  public: FrameID(FrameID&&) = default;
59  public: FrameID &operator =(const FrameID&) = default;
60  public: FrameID &operator =(FrameID&&) = default;
61 
63  public: static const FrameID &World();
64 
66  public: std::size_t ID() const;
67 
69  public: bool IsWorld() const;
70 
88  public: bool IsReferenceCounted() const;
89 
94  private: explicit FrameID(const Identity &_identity);
95 
97  private: enum WorldConstructorArg { ConstructWorld };
98 
100  private: explicit FrameID(WorldConstructorArg);
101 
102  // Friendship declaration
103  friend class FrameSemantics;
104 
106  private: std::size_t id;
107 
111  GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
112  private: std::shared_ptr<void> ref;
113  GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
114  };
115  }
116 }
117 
118 #endif