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 <filesystem>
22
#include <glaze/json/generic.hpp>
23
#include <string>
24
#include <vector>
25
26
namespace
SimoSim::Config {
27
28
struct
Parameter
{
29
std::string name;
30
glz::generic_u64 value;
31
};
32
33
struct
Module
{
34
std::string name;
35
std::string type;
36
std::vector<Parameter> parameters;
37
};
38
39
}
// namespace SimoSim::Config
40
41
template
<>
42
struct
glz::meta<SimoSim::Config::Parameter> {
43
using
T =
SimoSim::Config::Parameter
;
44
static
constexpr
auto
value = glz::object(&T::name, &T::value);
45
};
46
47
namespace
SimoSim::Config {
48
49
struct
SimulationInfo
{
50
Simo::Time
time;
51
std::optional<std::string> dump_parameters_path;
52
};
53
54
struct
Config
{
55
std::vector<Module> modules;
56
std::vector<std::pair<std::string, std::string>> connections;
57
SimulationInfo
simulation;
58
};
59
60
}
// namespace SimoSim::Config
61
62
#endif
// SIMO_CONFIG_HH
Simo::Time
Definition
Time.h:40
SimoSim::Config::Config
Definition
Config.h:54
SimoSim::Config::Module
Definition
Config.h:33
SimoSim::Config::Parameter
Definition
Config.h:28
SimoSim::Config::SimulationInfo
Definition
Config.h:49
src
SimoSim
Config.h
Generated by
1.16.1