scenario_simulator_v2 C++ API
misc_object_category.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__MISC_OBJECT_CATEGORY_HPP_
16 #define OPENSCENARIO_INTERPRETER__SYNTAX__MISC_OBJECT_CATEGORY_HPP_
17 
18 #include <iostream>
19 #include <traffic_simulator_msgs/msg/entity_subtype.hpp>
20 
22 {
23 inline namespace syntax
24 {
25 /* ---- MiscObjectCategory 1.1 -------------------------------------------------
26  *
27  * <xsd:simpleType name="MiscObjectCategory">
28  * <xsd:union>
29  * <xsd:simpleType>
30  * <xsd:restriction base="xsd:string">
31  * <xsd:enumeration value="barrier"/>
32  * <xsd:enumeration value="building"/>
33  * <xsd:enumeration value="crosswalk"/>
34  * <xsd:enumeration value="gantry"/>
35  * <xsd:enumeration value="none"/>
36  * <xsd:enumeration value="obstacle"/>
37  * <xsd:enumeration value="parkingSpace"/>
38  * <xsd:enumeration value="patch"/>
39  * <xsd:enumeration value="pole"/>
40  * <xsd:enumeration value="railing"/>
41  * <xsd:enumeration value="roadMark"/>
42  * <xsd:enumeration value="soundBarrier"/>
43  * <xsd:enumeration value="streetLamp"/>
44  * <xsd:enumeration value="trafficIsland"/>
45  * <xsd:enumeration value="tree"/>
46  * <xsd:enumeration value="vegetation"/>
47  * <xsd:enumeration value="wind">
48  * <xsd:annotation>
49  * <xsd:appinfo>
50  * deprecated
51  * </xsd:appinfo>
52  * </xsd:annotation>
53  * </xsd:enumeration>
54  * </xsd:restriction>
55  * </xsd:simpleType>
56  * <xsd:simpleType>
57  * <xsd:restriction base="parameter"/>
58  * </xsd:simpleType>
59  * </xsd:union>
60  * </xsd:simpleType>
61  * -------------------------------------------------------------------------- */
63 {
64  enum value_type {
65  none, // NOTE: This is the default value and should not be included in the sort.
66 
67  // NOTE: Sorted by lexicographic order.
83  wind, // NOTE: DEPRECATED (since OpenSCENARIO 1.1)
84  } value;
85 
86  MiscObjectCategory() = default;
87 
88  constexpr operator value_type() const noexcept { return value; }
89 
91  {
93  {
94  switch (value) { // NOTE: Sorted by lexicographic order.
95  default:
96  result.value = traffic_simulator_msgs::msg::EntitySubtype::UNKNOWN;
97  break;
98  }
99  }
100 
101  return result;
102  }
103 };
104 
105 auto operator>>(std::istream &, MiscObjectCategory &) -> std::istream &;
106 
107 auto operator<<(std::ostream &, const MiscObjectCategory &) -> std::ostream &;
108 } // namespace syntax
109 } // namespace openscenario_interpreter
110 
111 #endif // OPENSCENARIO_INTERPRETER__SYNTAX__MISC_OBJECT_CATEGORY_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: escape_sequence.hpp:22
traffic_simulator_msgs::EntitySubtype EntitySubtype
Definition: helper_functions.hpp:30
Definition: misc_object_category.hpp:63
enum openscenario_interpreter::syntax::MiscObjectCategory::value_type value
value_type
Definition: misc_object_category.hpp:64
@ barrier
Definition: misc_object_category.hpp:68
@ trafficIsland
Definition: misc_object_category.hpp:80
@ wind
Definition: misc_object_category.hpp:83
@ pole
Definition: misc_object_category.hpp:75
@ none
Definition: misc_object_category.hpp:65
@ building
Definition: misc_object_category.hpp:69
@ crosswalk
Definition: misc_object_category.hpp:70
@ patch
Definition: misc_object_category.hpp:74
@ soundBarrier
Definition: misc_object_category.hpp:78
@ tree
Definition: misc_object_category.hpp:81
@ gantry
Definition: misc_object_category.hpp:71
@ railing
Definition: misc_object_category.hpp:76
@ roadMark
Definition: misc_object_category.hpp:77
@ obstacle
Definition: misc_object_category.hpp:72
@ vegetation
Definition: misc_object_category.hpp:82
@ parkingSpace
Definition: misc_object_category.hpp:73
@ streetLamp
Definition: misc_object_category.hpp:79