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 /* ---- Wetness 1.2 --------------------------------------------------------
25  *
26  * <xsd:simpleType name="Wetness">
27  * <xsd:union>
28  * <xsd:simpleType>
29  * <xsd:restriction base="xsd:string">
30  * <xsd:enumeration value="dry"/>
31  * <xsd:enumeration value="moist"/>
32  * <xsd:enumeration value="wetWithPuddles"/>
33  * <xsd:enumeration value="lowFlooded"/>
34  * <xsd:enumeration value="highFlooded"/>
35  * </xsd:restriction>
36  * </xsd:simpleType>
37  * <xsd:simpleType>
38  * <xsd:restriction base="parameter"/>
39  * </xsd:simpleType>
40  * </xsd:union>
41  * </xsd:simpleType>
42  *
43  * -------------------------------------------------------------------------- */
44 struct Wetness
45 {
46  enum value_type {
47  dry, // Not wet.
48  moist, // Wet but no puddles are formed.
49  wetWithPuddles, // Wet, puddles are formed.
50  lowFlooded, // Road completely covered with water. No puddles anymore.
51  highFlooded // Road completely covered with water. Water depth > 5cm.
52  } value;
53 
54  Wetness() = default;
55 
56  constexpr Wetness(value_type value) : value(value) {}
57 
58  constexpr operator value_type() const noexcept { return value; }
59 };
60 
61 auto operator>>(std::istream &, Wetness &) -> std::istream &;
62 
63 auto operator<<(std::ostream &, const Wetness &) -> std::ostream &;
64 } // namespace syntax
65 } // namespace openscenario_interpreter
66 
67 #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:56
value_type
Definition: wetness.hpp:46
@ lowFlooded
Definition: wetness.hpp:50
@ moist
Definition: wetness.hpp:48
@ highFlooded
Definition: wetness.hpp:51
@ dry
Definition: wetness.hpp:47
@ wetWithPuddles
Definition: wetness.hpp:49