15 #ifndef OPENSCENARIO_INTERPRETER__SYNTAX__ENTITY_HPP_
16 #define OPENSCENARIO_INTERPRETER__SYNTAX__ENTITY_HPP_
26 #include <pugixml.hpp>
29 #include <type_traits>
37 inline namespace syntax
41 struct ScenarioObject;
43 struct EntitySelection;
63 template <typename Function>
64 auto
apply(const Function & function)
const
66 using Result = std::invoke_result_t<Function, Entity>;
68 if constexpr (std::is_same_v<Result, void>) {
71 auto results = std::valarray<Result>(
objects.size());
72 std::transform(std::begin(
objects), std::end(
objects), std::begin(results),
function);
97 return std::hash<void *>{}(entity.get());
Definition: scope.hpp:154
Result
Definition: cpp_scenario_node.hpp:28
auto operator==(const Entity &, const Entity &) -> bool
Definition: entity.cpp:49
auto operator<<(std::ostream &, const Boolean &) -> std::ostream &
Definition: boolean.cpp:46
std::string String
Definition: string.hpp:24
Definition: entity_ref.hpp:35
Definition: entity_selection.hpp:40
Definition: entity.hpp:46
auto name() const -> String
Definition: entity.cpp:59
auto objects() const -> std::set< Entity >
Definition: entity.cpp:61
auto apply(const Function &function) const
Definition: entity.hpp:64
auto objectTypes() const -> std::set< ObjectType::value_type >
Definition: entity.cpp:72
Definition: object_type.hpp:44
Definition: scenario_object.hpp:41
auto operator()(const openscenario_interpreter::Entity &entity) const -> std::size_t
Definition: entity.hpp:95