scenario_simulator_v2 C++ API
boolean.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__BOOLEAN_HPP_
16 #define OPENSCENARIO_INTERPRETER__SYNTAX__BOOLEAN_HPP_
17 
18 #include <iostream>
20 
22 {
23 inline namespace syntax
24 {
25 struct Boolean
26 {
27  using value_type = bool;
28 
30 
31  Boolean() = default;
32 
33  constexpr Boolean(value_type value) noexcept : data(value) {}
34 
35  explicit Boolean(const std::string &);
36 
37  auto operator=(const value_type & rhs) noexcept -> Boolean &;
38 
39  constexpr operator value_type() const noexcept { return data; }
40 };
41 
42 auto operator>>(std::istream &, Boolean &) -> std::istream &;
43 
44 auto operator<<(std::ostream &, const Boolean &) -> std::ostream &;
45 
46 extern const Object true_v;
47 
48 extern const Object false_v;
49 
50 auto asBoolean(bool) -> const Object &;
51 } // namespace syntax
52 } // namespace openscenario_interpreter
53 
54 #endif // OPENSCENARIO_INTERPRETER__SYNTAX__BOOLEAN_HPP_
const Object true_v
Definition: boolean.cpp:58
auto operator>>(std::istream &, Boolean &) -> std::istream &
Definition: boolean.cpp:52
auto asBoolean(bool) -> const Object &
Definition: boolean.cpp:62
const Object false_v
Definition: boolean.cpp:60
auto operator<<(std::ostream &, const Boolean &) -> std::ostream &
Definition: boolean.cpp:46
Definition: escape_sequence.hpp:22
std::string string
Definition: junit5.hpp:26
Definition: boolean.hpp:26
auto operator=(const value_type &rhs) noexcept -> Boolean &
Definition: boolean.cpp:40
constexpr Boolean(value_type value) noexcept
Definition: boolean.hpp:33
bool value_type
Definition: boolean.hpp:27
value_type data
Definition: boolean.hpp:29