Ignition Physics

API Reference

5.1.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 IGNITION_PHYSICS_FRAMEID_HH_
19 #define IGNITION_PHYSICS_FRAMEID_HH_
20 
21 #include <memory>
22 
23 #include <ignition/physics/Export.hh>
24 #include <ignition/physics/detail/Identity.hh>
25 #include <ignition/utils/SuppressWarning.hh>
26 
27 namespace ignition
28 {
29  namespace physics
30  {
31  // Forward declaration
32  class FrameSemantics;
33 
46  class IGNITION_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  IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING
112  private: std::shared_ptr<const void> ref;
113  IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING
114  };
115  }
116 }
117 
118 #endif
FrameSemantics is an Interface that can be provided by ignition-physics engines to provide users with...
Definition: FrameSemantics.hh:38
Container for specifying Frame IDs. We do not want to use a generic integer type for this...
Definition: FrameID.hh:46