Gazebo Sim

API Reference

7.7.0
include/gz/sim/Types.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 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 #ifndef GZ_SIM_TYPES_HH_
18 #define GZ_SIM_TYPES_HH_
19 
20 #include <chrono>
21 #include <cstdint>
22 #include <functional>
23 #include <utility>
24 
25 #include "gz/sim/Entity.hh"
26 
27 namespace gz
28 {
29  namespace sim
30  {
31  // Inline bracket to help doxygen filtering.
32  inline namespace GZ_SIM_VERSION_NAMESPACE {
33  // Forward declarations.
34  class EntityComponentManager;
35 
38  struct UpdateInfo
39  {
42  std::chrono::steady_clock::duration simTime{0};
43 
46  std::chrono::steady_clock::duration realTime{0};
47 
49  std::chrono::steady_clock::duration dt{0};
50 
52  // cppcheck-suppress unusedStructMember
53  uint64_t iterations{0};
54 
60  // cppcheck-suppress unusedStructMember
61  bool paused{true};
62  };
63 
65  enum class ComponentState
66  {
68  NoChange = 0,
69 
72  PeriodicChange = 1,
73 
77  OneTimeChange = 2
78  };
79 
83  using ComponentTypeId = uint64_t;
84 
86  using EntityQueryCallback = std::function<void (const UpdateInfo,
88 
90  static const ComponentTypeId kComponentTypeIdInvalid = UINT64_MAX;
91  }
92  }
93 }
94 #endif