scenario_simulator_v2 C++ API
openscenario
openscenario_interpreter
include
openscenario_interpreter
syntax
event.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__EVENT_HPP_
16
#define OPENSCENARIO_INTERPRETER__SYNTAX__EVENT_HPP_
17
18
#include <boost/json.hpp>
19
#include <
openscenario_interpreter/scope.hpp
>
20
#include <
openscenario_interpreter/syntax/action.hpp
>
21
#include <
openscenario_interpreter/syntax/maneuver.hpp
>
22
#include <
openscenario_interpreter/syntax/priority.hpp
>
23
#include <
openscenario_interpreter/syntax/storyboard_element.hpp
>
24
#include <
openscenario_interpreter/syntax/trigger.hpp
>
25
#include <pugixml.hpp>
26
27
namespace
openscenario_interpreter
28
{
29
inline
namespace
syntax
30
{
31
/* ---- Event ------------------------------------------------------------------
32
*
33
* <xsd:complexType name="Event">
34
* <xsd:sequence>
35
* <xsd:element name="Action" maxOccurs="unbounded" type="Action"/>
36
* <xsd:element name="StartTrigger" type="Trigger"/>
37
* </xsd:sequence>
38
* <xsd:attribute name="priority" type="Priority" use="required"/>
39
* <xsd:attribute name="maximumExecutionCount" type="UnsignedInt"/>
40
* <xsd:attribute name="name" type="String" use="required"/>
41
* </xsd:complexType>
42
*
43
* -------------------------------------------------------------------------- */
44
struct
Event
:
private
Scope
,
public
StoryboardElement
45
{
46
using
Scope::name
;
47
48
const
Priority
priority
;
// Priority of each event.
49
50
explicit
Event
(
const
pugi::xml_node &,
Scope
&,
Maneuver
&);
51
52
auto
start
() ->
void
override
;
53
54
auto
evaluate
() ->
Object
override
;
55
56
friend
auto
operator<<
(boost::json::object &,
const
Event
&) -> boost::json::object &;
57
58
private
:
59
Maneuver
& parent_maneuver;
60
};
61
62
}
// namespace syntax
63
}
// namespace openscenario_interpreter
64
65
#endif
// OPENSCENARIO_INTERPRETER__SYNTAX__EVENT_HPP_
action.hpp
openscenario_interpreter::Pointer< Expression >
openscenario_interpreter::Scope
Definition:
scope.hpp:154
openscenario_interpreter::Scope::name
const std::string name
Definition:
scope.hpp:191
openscenario_interpreter::StoryboardElement
Definition:
storyboard_element.hpp:37
maneuver.hpp
openscenario_interpreter
Definition:
escape_sequence.hpp:22
priority.hpp
scope.hpp
storyboard_element.hpp
openscenario_interpreter::Event
Definition:
event.hpp:45
openscenario_interpreter::syntax::Event::start
auto start() -> void override
openscenario_interpreter::syntax::Event::priority
const Priority priority
Definition:
event.hpp:48
openscenario_interpreter::syntax::Event::operator<<
friend auto operator<<(boost::json::object &, const Event &) -> boost::json::object &
Definition:
event.cpp:70
openscenario_interpreter::syntax::Event::evaluate
auto evaluate() -> Object override
openscenario_interpreter::syntax::Event::Event
Event(const pugi::xml_node &, Scope &, Maneuver &)
openscenario_interpreter::syntax::Maneuver
Definition:
maneuver.hpp:40
openscenario_interpreter::syntax::Priority
Definition:
priority.hpp:43
trigger.hpp
Generated by
1.9.1