$darkmode
simulation_probe.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2024 Robert Bosch GmbH
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * SPDX-License-Identifier: Apache-2.0
17  */
22 #pragma once
23 
24 #include <map>
25 #include <string>
26 #include <vector>
27 
28 #include <fable/json.hpp>
29 
30 #include "simulation_outcome.hpp"
31 
32 namespace engine {
33 
43  SimulationOutcome outcome;
44 
46  std::vector<std::string> errors;
47 
49  std::string uuid;
50 
52  std::map<std::string, std::string> plugins;
53 
55  std::map<std::string, std::vector<std::string>> vehicles;
56 
58  std::map<std::string, fable::Json> trigger_actions;
59 
61  std::map<std::string, fable::Json> trigger_events;
62 
64  std::vector<std::string> http_endpoints;
65 
70  std::map<std::string, std::string> signal_metadata;
71 
76 
77  friend void to_json(fable::Json& j, const SimulationProbe& r) {
78  j = fable::Json{
79  {"uuid", r.uuid},
80  {"plugins", r.plugins},
81  {"vehicles", r.vehicles},
82  {"trigger_actions", r.trigger_actions},
83  {"trigger_events", r.trigger_events},
84  {"http_endpoints", r.http_endpoints},
85  {"signals", r.signal_metadata},
86  {"tests", r.test_metadata},
87  };
88  }
89 };
90 
91 } // namespace engine
nlohmann::json Json
Definition: fable_fwd.hpp:35
SimulationOutcome
Definition: simulation_outcome.hpp:33
Definition: simulation_probe.hpp:42
fable::Json test_metadata
Definition: simulation_probe.hpp:75
std::map< std::string, fable::Json > trigger_events
List of trigger events enrolled.
Definition: simulation_probe.hpp:61
std::map< std::string, std::string > signal_metadata
Definition: simulation_probe.hpp:70
std::string uuid
UUID of the simulation, if any.
Definition: simulation_probe.hpp:49
std::vector< std::string > http_endpoints
List of HTTP endpoints that are available.
Definition: simulation_probe.hpp:64
std::map< std::string, std::string > plugins
Map of plugin name -> plugin path.
Definition: simulation_probe.hpp:52
std::map< std::string, fable::Json > trigger_actions
List of trigger actions enrolled.
Definition: simulation_probe.hpp:58
std::map< std::string, std::vector< std::string > > vehicles
Map of vehicle name -> list of components.
Definition: simulation_probe.hpp:55
std::vector< std::string > errors
Collection of errors from running the probe.
Definition: simulation_probe.hpp:46