Simo 0.0.1
Loading...
Searching...
No Matches
Config.h
1/*
2 * Copyright 2026 Matteo Fusi and Contributors
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
17#ifndef SIMO_CONFIG_HH
18#define SIMO_CONFIG_HH
19#include <Simo/Simo.h>
20
21#include <glaze/json/generic.hpp>
22#include <string>
23#include <vector>
24
25namespace SimoSim::Config {
26
27struct Parameter {
28 std::string name;
29 glz::generic_u64 value;
30};
31
32struct Module {
33 std::string name;
34 std::string type;
35 std::vector<Parameter> parameters;
36};
37
38} // namespace SimoSim::Config
39
40template <>
41struct glz::meta<SimoSim::Config::Parameter> {
43 static constexpr auto value = glz::object(&T::name, &T::value);
44};
45
46namespace SimoSim::Config {
47
49 Simo::Time time;
50};
51
52struct Config {
53 std::vector<Module> modules;
54 std::vector<std::pair<std::string, std::string>> connections;
55 SimulationInfo simulation;
56};
57
58} // namespace SimoSim::Config
59
60#endif // SIMO_CONFIG_HH
Definition Time.h:40
Definition Config.h:52
Definition Config.h:32
Definition Config.h:27
Definition Config.h:48