scenario_simulator_v2 C++ API
wetness.hpp
Go to the documentation of this file.
1 // Copyright 2015 TIER IV, Inc. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef OPENSCENARIO_INTERPRETER__SYNTAX__WETNESS_HPP_
16 #define OPENSCENARIO_INTERPRETER__SYNTAX__WETNESS_HPP_
17 
18 #include <iostream>
19 
21 {
22 inline namespace syntax
23 {
24 /*
25  Wetness (OpenSCENARIO XML 1.3.1)
26 
27  Definition of the wetness of the road.
28 
29  <xsd:simpleType name="Wetness">
30  <xsd:union>
31  <xsd:simpleType>
32  <xsd:restriction base="xsd:string">
33  <xsd:enumeration value="dry"/>
34  <xsd:enumeration value="moist"/>
35  <xsd:enumeration value="wetWithPuddles"/>
36  <xsd:enumeration value="lowFlooded"/>
37  <xsd:enumeration value="highFlooded"/>
38  </xsd:restriction>
39  </xsd:simpleType>
40  <xsd:simpleType>
41  <xsd:restriction base="parameter"/>
42  </xsd:simpleType>
43  </xsd:union>
44  </xsd:simpleType>
45 */
46 struct Wetness
47 {
48  enum value_type {
49  dry, // Not wet.
50  moist, // Wet but no puddles are formed.
51  wetWithPuddles, // Wet, puddles are formed.
52  lowFlooded, // Road completely covered with water. No puddles anymore.
53  highFlooded // Road completely covered with water. Water depth > 5cm.
54  } value;
55 
56  Wetness() = default;
57 
58  constexpr Wetness(value_type value) : value(value) {}
59 
60  constexpr operator value_type() const noexcept { return value; }
61 };
62 
63 auto operator>>(std::istream &, Wetness &) -> std::istream &;
64 
65 auto operator<<(std::ostream &, const Wetness &) -> std::ostream &;
66 } // namespace syntax
67 } // namespace openscenario_interpreter
68 
69 #endif // OPENSCENARIO_INTERPRETER__SYNTAX__WETNESS_HPP_
auto operator>>(std::istream &, Boolean &) -> std::istream &
Definition: boolean.cpp:52
auto operator<<(std::ostream &, const Boolean &) -> std::ostream &
Definition: boolean.cpp:46
Definition: hypot.hpp:22
enum openscenario_interpreter::syntax::Wetness::value_type value
constexpr Wetness(value_type value)
Definition: wetness.hpp:58
value_type
Definition: wetness.hpp:48
@ lowFlooded
Definition: wetness.hpp:52
@ moist
Definition: wetness.hpp:50
@ highFlooded
Definition: wetness.hpp:53
@ dry
Definition: wetness.hpp:49
@ wetWithPuddles
Definition: wetness.hpp:51