Ignition Gazebo

API Reference

6.6.0
include/ignition/gazebo/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 IGNITION_GAZEBO_TYPES_HH_
18 #define IGNITION_GAZEBO_TYPES_HH_
19 
20 #include <chrono>
21 #include <cstdint>
22 #include <functional>
23 #include <utility>
24 
26 
27 namespace ignition
28 {
29  namespace gazebo
30  {
31  // Inline bracket to help doxygen filtering.
32  inline namespace IGNITION_GAZEBO_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 
85  using ComponentId = int;
86 
90  using ComponentTypeId = uint64_t;
91 
98 
100  using EntityQueryCallback = std::function<void (const UpdateInfo,
102 
104  static const ComponentId kComponentIdInvalid = -1;
105 
107  static const ComponentTypeId kComponentTypeIdInvalid = UINT64_MAX;
108  }
109  }
110 }
111 #endif
static const ComponentId kComponentIdInvalid
Id that indicates an invalid component.
Definition: include/ignition/gazebo/Types.hh:104
Component value has not changed.
Information passed to systems on the update callback.
Definition: include/ignition/gazebo/Types.hh:38
static const ComponentTypeId kComponentTypeIdInvalid
Id that indicates an invalid component type.
Definition: include/ignition/gazebo/Types.hh:107
The EntityComponentManager constructs, deletes, and returns components and entities. A component can be of any class which inherits from components::BaseComponent.
Definition: EntityComponentManager.hh:66
uint64_t ComponentTypeId
A unique identifier for a component type. A component type must be derived from components::BaseCompo...
Definition: include/ignition/gazebo/Types.hh:90
Component value has changed, and is changing periodically. This indicates to systems that it is ok to...
int ComponentId
A unique identifier for a component instance. The uniqueness of a ComponentId is scoped to the compon...
Definition: include/ignition/gazebo/Types.hh:85
ComponentState
Possible states for a component.
Definition: include/ignition/gazebo/Types.hh:65
This library is part of the Ignition Robotics project.
Component value has suffered a one-time change. This indicates to systems that this change must be pr...