Gazebo Gazebo

API Reference

6.16.0
gz/sim/components/TemperatureRange.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 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_GAZEBO_COMPONENTS_TEMPERATURERANGE_HH_
18 #define GZ_GAZEBO_COMPONENTS_TEMPERATURERANGE_HH_
19 
20 #include <istream>
21 #include <ostream>
22 
23 #include <gz/math/Temperature.hh>
24 
27 #include <gz/sim/config.hh>
28 
29 namespace ignition
30 {
31 namespace gazebo
32 {
33 // Inline bracket to help doxygen filtering.
34 inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
35 namespace components
36 {
39  {
44 
45  public: bool operator==(const TemperatureRangeInfo &_info) const
46  {
47  return (this->min == _info.min) &&
48  (this->max == _info.max);
49  }
50 
51  public: bool operator!=(const TemperatureRangeInfo &_info) const
52  {
53  return !(*this == _info);
54  }
55  };
56 }
57 
58 namespace serializers
59 {
62  {
67  public: static std::ostream &Serialize(std::ostream &_out,
69  {
70  _out << _info.min << " " << _info.max;
71  return _out;
72  }
73 
78  public: static std::istream &Deserialize(std::istream &_in,
80  {
81  _in >> _info.min >> _info.max;
82  return _in;
83  }
84  };
85 }
86 
87 namespace components
88 {
90  using TemperatureRange = Component<TemperatureRangeInfo,
91  class TemperatureRangeTag, serializers::TemperatureRangeInfoSerializer>;
92  IGN_GAZEBO_REGISTER_COMPONENT("ign_gazebo_components.TemperatureRange",
93  TemperatureRange)
94 }
95 }
96 }
97 }
98 
99 #endif
bool operator!=(const TemperatureRangeInfo &_info) const
Definition: gz/sim/components/TemperatureRange.hh:51
math::Temperature max
The maximum temperature (kelvin)
Definition: gz/sim/components/TemperatureRange.hh:43
Component< TemperatureRangeInfo, class TemperatureRangeTag, serializers::TemperatureRangeInfoSerializer > TemperatureRange
A component that stores a temperature range in kelvin.
Definition: gz/sim/components/TemperatureRange.hh:91
This library is part of the Gazebo project.
math::Temperature min
The minimum temperature (kelvin)
Definition: gz/sim/components/TemperatureRange.hh:41
#define IGN_GAZEBO_REGISTER_COMPONENT(_compType, _classname)
Static component registration macro.
Definition: gz/sim/components/Factory.hh:509
static std::istream & Deserialize(std::istream &_in, components::TemperatureRangeInfo &_info)
Deserialization for components::TemperatureRangeInfo.
Definition: gz/sim/components/TemperatureRange.hh:78
STL class.
IGN_GAZEBO_REGISTER_COMPONENT("ign_gazebo_components.Actor", Actor) using AnimationTime
Time in seconds within animation being currently played.
static std::ostream & Serialize(std::ostream &_out, const components::TemperatureRangeInfo &_info)
Serialization for components::TemperatureRangeInfo.
Definition: gz/sim/components/TemperatureRange.hh:67
Serializer for components::TemperatureRangeInfo object.
Definition: gz/sim/components/TemperatureRange.hh:61
Data structure to hold a temperature range, in kelvin.
Definition: gz/sim/components/TemperatureRange.hh:38
STL class.
bool operator==(const TemperatureRangeInfo &_info) const
Definition: gz/sim/components/TemperatureRange.hh:45