Ignition Gazebo

API Reference

3.5.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 #include <ignition/common/Time.hh>
25 
26 namespace ignition
27 {
28  namespace gazebo
29  {
30  // Inline bracket to help doxygen filtering.
31  inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
32  // Forward declarations.
33  class EntityComponentManager;
34 
37  struct UpdateInfo
38  {
41  std::chrono::steady_clock::duration simTime{0};
42 
45  std::chrono::steady_clock::duration realTime{0};
46 
48  std::chrono::steady_clock::duration dt{0};
49 
51  // cppcheck-suppress unusedStructMember
52  uint64_t iterations{0};
53 
59  // cppcheck-suppress unusedStructMember
60  bool paused{true};
61  };
62 
64  enum class ComponentState
65  {
67  NoChange = 0,
68 
71  PeriodicChange = 1,
72 
76  OneTimeChange = 2
77  };
78 
82  using ComponentId = int;
83 
87  using ComponentTypeId = uint64_t;
88 
92 
94  using EntityQueryCallback = std::function<void (const UpdateInfo,
96 
98  static const ComponentId kComponentIdInvalid = -1;
99 
102  }
103  }
104 }
105 #endif
static const ComponentId kComponentIdInvalid
Id that indicates an invalid component.
Definition: Types.hh:98
Component value has not changed.
Information passed to systems on the update callback.
Definition: Types.hh:37
static const ComponentTypeId kComponentTypeIdInvalid
Id that indicates an invalid component type.
Definition: Types.hh:101
The EntityComponentManager constructs, deletes, and returns components and entities. A component can be of any class which inherits from components::BaseComponent.
Definition: EntityComponentManager.hh:64
uint64_t ComponentTypeId
A unique identifier for a component type. A component type must be derived from components::BaseCompo...
Definition: Types.hh:87
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:82
ComponentState
Possible states for a component.
Definition: Types.hh:64
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...