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
25
namespace
SimoSim::Config {
26
27
struct
Parameter
{
28
std::string name;
29
glz::generic_u64 value;
30
};
31
32
struct
Module
{
33
std::string name;
34
std::string type;
35
std::vector<Parameter> parameters;
36
};
37
38
}
// namespace SimoSim::Config
39
40
template
<>
41
struct
glz::meta<SimoSim::Config::Parameter> {
42
using
T =
SimoSim::Config::Parameter
;
43
static
constexpr
auto
value = glz::object(&T::name, &T::value);
44
};
45
46
namespace
SimoSim::Config {
47
48
struct
SimulationInfo
{
49
Simo::Time
time;
50
};
51
52
struct
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
Simo::Time
Definition
Time.h:40
SimoSim::Config::Config
Definition
Config.h:52
SimoSim::Config::Module
Definition
Config.h:32
SimoSim::Config::Parameter
Definition
Config.h:27
SimoSim::Config::SimulationInfo
Definition
Config.h:48
src
SimoSim
Config.h
Generated by
1.16.1