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 /* ---- PRIORITY ---------------------------------------------------------------
25  *
26  * <xsd:simpleType name="Priority">
27  * <xsd:union>
28  * <xsd:simpleType>
29  * <xsd:restriction base="xsd:string">
30  * <xsd:enumeration value="overwrite"/>
31  * <xsd:enumeration value="skip"/>
32  * <xsd:enumeration value="parallel"/>
33  * </xsd:restriction>
34  * </xsd:simpleType>
35  * <xsd:simpleType>
36  * <xsd:restriction base="parameter"/>
37  * </xsd:simpleType>
38  * </xsd:union>
39  * </xsd:simpleType>
40  *
41  * -------------------------------------------------------------------------- */
42 struct Priority
43 {
44  enum value_type {
45 
46  /*
47  If a starting event has priority Overwrite, all events in running state,
48  within the same scope (maneuver) as the starting event, should be issued
49  a stop command (stop transition).
50  */
52 
53  /*
54  If a starting event has priority Skip, then it will not be run if there
55  is any other event in the same scope (maneuver) in the running state.
56  */
58 
59  /*
60  Execute in parallel to other events.
61  */
63  } value;
64 
65  Priority() = default;
66 
67  constexpr operator value_type() const noexcept { return value; }
68 };
69 
70 auto operator>>(std::istream &, Priority &) -> std::istream &;
71 
72 auto operator<<(std::ostream &, const Priority &) -> std::ostream &;
73 } // namespace syntax
74 } // namespace openscenario_interpreter
75 
76 #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: escape_sequence.hpp:22
Definition: priority.hpp:43
enum openscenario_interpreter::syntax::Priority::value_type value
value_type
Definition: priority.hpp:44
@ overwrite
Definition: priority.hpp:51
@ parallel
Definition: priority.hpp:62
@ skip
Definition: priority.hpp:57