Ignition Gazebo

API Reference

5.0.0
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 IGNITION_GAZEBO_COMPONENTS_TEMPERATURERANGE_HH_
18 #define IGNITION_GAZEBO_COMPONENTS_TEMPERATURERANGE_HH_
19 
20 #include <istream>
21 #include <ostream>
22 
24 
27 #include <ignition/gazebo/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 {
38  struct TemperatureRangeInfo
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
math::Temperature max
The maximum temperature (kelvin)
Definition: TemperatureRange.hh:43
bool operator==(const TemperatureRangeInfo &_info) const
Definition: TemperatureRange.hh:45
STL class.
bool operator!=(const TemperatureRangeInfo &_info) const
Definition: TemperatureRange.hh:51
static std::istream & Deserialize(std::istream &_in, components::TemperatureRangeInfo &_info)
Deserialization for components::TemperatureRangeInfo.
Definition: TemperatureRange.hh:78
static std::ostream & Serialize(std::ostream &_out, const components::TemperatureRangeInfo &_info)
Serialization for components::TemperatureRangeInfo.
Definition: TemperatureRange.hh:67
#define IGN_GAZEBO_REGISTER_COMPONENT(_compType, _classname)
Static component registration macro.
Definition: Factory.hh:329
Data structure to hold a temperature range, in kelvin.
Definition: TemperatureRange.hh:38
math::Temperature min
The minimum temperature (kelvin)
Definition: TemperatureRange.hh:41
Component< TemperatureRangeInfo, class TemperatureRangeTag, serializers::TemperatureRangeInfoSerializer > TemperatureRange
A component that stores a temperature range in kelvin.
Definition: TemperatureRange.hh:91
Serializer for components::TemperatureRangeInfo object.
Definition: TemperatureRange.hh:61
This library is part of the Ignition Robotics project.
STL class.