scenario_simulator_v2 C++ API
priority.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__PRIORITY_HPP_
16 #define OPENSCENARIO_INTERPRETER__SYNTAX__PRIORITY_HPP_
17 
19 
21 {
22 inline namespace syntax
23 {
24 /*
25  Priority (OpenSCENARIO XML 1.3.1)
26 
27  Rules that govern interaction between events that belong to the same maneuver.
28 
29  <xsd:simpleType name="Priority">
30  <xsd:union>
31  <xsd:simpleType>
32  <xsd:restriction base="xsd:string">
33  <xsd:enumeration value="overwrite">
34  <xsd:annotation>
35  <xsd:appinfo>
36  deprecated
37  </xsd:appinfo>
38  </xsd:annotation>
39  </xsd:enumeration>
40  <xsd:enumeration value="override"/>
41  <xsd:enumeration value="parallel"/>
42  <xsd:enumeration value="skip"/>
43  </xsd:restriction>
44  </xsd:simpleType>
45  <xsd:simpleType>
46  <xsd:restriction base="parameter"/>
47  </xsd:simpleType>
48  </xsd:union>
49  </xsd:simpleType>
50 */
51 struct Priority
52 {
53  enum value_type {
54 
55  /*
56  overwrite is deprecated and deleted from internal enum.
57  */
58  // overwrite,
59 
60  /*
61  If a starting event has priority Skip, then it will not be run if there
62  is any other event in the same scope (maneuver) in the running state.
63  */
65 
66  /*
67  Execute in parallel to other events.
68  */
70 
71  /*
72  If a starting event has priority Override, all events in running state,
73  within the same scope (maneuver) as the starting event,
74  should be issued a stop command (stop transition).
75  */
76  override,
77  } value;
78 
79  Priority() = default;
80 
81  constexpr operator value_type() const noexcept { return value; }
82 };
83 
84 auto operator>>(std::istream &, Priority &) -> std::istream &;
85 
86 auto operator<<(std::ostream &, const Priority &) -> std::ostream &;
87 } // namespace syntax
88 } // namespace openscenario_interpreter
89 
90 #endif // OPENSCENARIO_INTERPRETER__SYNTAX__PRIORITY_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
Definition: priority.hpp:52
enum openscenario_interpreter::syntax::Priority::value_type value
value_type
Definition: priority.hpp:53
@ parallel
Definition: priority.hpp:69
@ skip
Definition: priority.hpp:64