scenario_simulator_v2 C++ API
open_scenario.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__OPEN_SCENARIO_HPP_
16 #define OPENSCENARIO_INTERPRETER__SYNTAX__OPEN_SCENARIO_HPP_
17 
18 #include <boost/filesystem.hpp>
19 #include <boost/json.hpp>
23 #include <pugixml.hpp>
24 
26 {
27 inline namespace syntax
28 {
29 /* ---- OpenScenario -----------------------------------------------------------
30  *
31  * <xsd:complexType name="OpenScenario">
32  * <xsd:sequence>
33  * <xsd:element name="FileHeader" type="FileHeader"/>
34  * <xsd:group ref="OpenScenarioCategory"/>
35  * </xsd:sequence>
36  * </xsd:complexType>
37  *
38  * -------------------------------------------------------------------------- */
39 struct OpenScenario : public Scope
40 {
41  const boost::filesystem::path pathname; // for substitution syntax '$(dirname)'
42 
43  pugi::xml_document script;
44 
46 
48 
49  std::size_t frame = 0;
50 
51  explicit OpenScenario(const boost::filesystem::path &);
52 
53  auto evaluate() -> Object;
54 
55  auto load(const boost::filesystem::path &) -> const pugi::xml_node &;
56 };
57 
58 auto operator<<(boost::json::object &, const OpenScenario &) -> boost::json::object &;
59 } // namespace syntax
60 } // namespace openscenario_interpreter
61 
62 #endif // OPENSCENARIO_INTERPRETER__SYNTAX__OPEN_SCENARIO_HPP_
Definition: scope.hpp:154
auto operator<<(std::ostream &, const Boolean &) -> std::ostream &
Definition: boolean.cpp:46
Definition: escape_sequence.hpp:22
Pointer< Expression > Object
Definition: object.hpp:26
Definition: file_header.hpp:43
Definition: open_scenario_category.hpp:37
Definition: open_scenario.hpp:40
const boost::filesystem::path pathname
Definition: open_scenario.hpp:41
const FileHeader file_header
Definition: open_scenario.hpp:45
OpenScenario(const boost::filesystem::path &)
Definition: open_scenario.cpp:24
const OpenScenarioCategory category
Definition: open_scenario.hpp:47
pugi::xml_document script
Definition: open_scenario.hpp:43
auto load(const boost::filesystem::path &) -> const pugi::xml_node &
Definition: open_scenario.cpp:38
std::size_t frame
Definition: open_scenario.hpp:49
auto evaluate() -> Object
Definition: open_scenario.cpp:32