scenario_simulator_v2 C++ API
expression.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__EXPRESSION_HPP_
16 #define OPENSCENARIO_INTERPRETER__EXPRESSION_HPP_
17 
19 
21 {
22 struct Expression // NOTE: Member functions are lexicographically sorted.
23 {
24  virtual bool accomplished() { return false; }
25 
26  virtual auto description() const -> std::string { return ""; }
27 
29  {
30  throw SemanticError("No viable evaluation for class ", makeTypename(type()));
31  }
32 
33  virtual auto type() const noexcept -> const std::type_info & { return typeid(Expression); }
34 
35  virtual auto write(std::ostream & os) const -> std::ostream &
36  {
38  }
39 };
40 } // namespace openscenario_interpreter
41 
42 #endif // OPENSCENARIO_INTERPRETER__EXPRESSION_HPP_
auto makeTypename(Ts &&... xs)
Definition: demangle.hpp:30
Definition: hypot.hpp:22
Definition: cache.hpp:27
Definition: expression.hpp:23
virtual auto evaluate(const Pointer< Expression > &) -> Pointer< Expression >
Definition: expression.hpp:28
virtual auto description() const -> std::string
Definition: expression.hpp:26
virtual auto type() const noexcept -> const std::type_info &
Definition: expression.hpp:33
virtual bool accomplished()
Definition: expression.hpp:24
virtual auto write(std::ostream &os) const -> std::ostream &
Definition: expression.hpp:35
Definition: if_has_stream_output_operator.hpp:28