Ignition Gazebo

API Reference

5.1.0
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 
25 namespace ignition
26 {
27  namespace gazebo
28  {
29  // Inline bracket to help doxygen filtering.
30  inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
31  // Forward declarations.
32  class EntityComponentManager;
33 
36  struct UpdateInfo
37  {
40  std::chrono::steady_clock::duration simTime{0};
41 
44  std::chrono::steady_clock::duration realTime{0};
45 
47  std::chrono::steady_clock::duration dt{0};
48 
50  // cppcheck-suppress unusedStructMember
51  uint64_t iterations{0};
52 
58  // cppcheck-suppress unusedStructMember
59  bool paused{true};
60  };
61 
63  enum class ComponentState
64  {
66  NoChange = 0,
67 
70  PeriodicChange = 1,
71 
75  OneTimeChange = 2
76  };
77 
81  using ComponentId = int;
82 
86  using ComponentTypeId = uint64_t;
87 
91 
93  using EntityQueryCallback = std::function<void (const UpdateInfo,
95 
97  static const ComponentId kComponentIdInvalid = -1;
98 
100  static const ComponentTypeId kComponentTypeIdInvalid = UINT64_MAX;
101  }
102  }
103 }
104 #endif
static const ComponentId kComponentIdInvalid
Id that indicates an invalid component.
Definition: Types.hh:97
Component value has not changed.
Information passed to systems on the update callback.
Definition: Types.hh:36
static const ComponentTypeId kComponentTypeIdInvalid
Id that indicates an invalid component type.
Definition: Types.hh:100
The EntityComponentManager constructs, deletes, and returns components and entities. A component can be of any class which inherits from components::BaseComponent.
Definition: EntityComponentManager.hh:65
uint64_t ComponentTypeId
A unique identifier for a component type. A component type must be derived from components::BaseCompo...
Definition: Types.hh:86
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: Types.hh:81
ComponentState
Possible states for a component.
Definition: Types.hh:63
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...