forked from DigitalDynamicsLab/fmu_tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TypesVariantsDefault.h
24 lines (18 loc) · 1.13 KB
/
TypesVariantsDefault.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef TYPESVARIANTS_H
#define TYPESVARIANTS_H
#include "variant/variant_guard.hpp"
#include "fmi2_headers/fmi2TypesPlatform.h"
#include <string>
#define FMITYPESPLATFORM_DEFAULT
// variants does not allow repeated types;
// unfortunately, in the default implementation, both fmi2Boolean and fmi2Integer point to a int type
// that's why, by default, FmuVariable::VarbindType and FmuVariable::StartType does not have both of them
// however, in case the user has its own custom types definition, it is required to define new valid variants
// in order to cover all possible available types
using FmuVariableBindType = varns::variant<fmi2Real*, fmi2Integer*, fmi2String*,
std::pair<std::function<fmi2Real()>, std::function<void(fmi2Real)>>,
std::pair<std::function<fmi2Integer()>, std::function<void(fmi2Integer)>>,
std::pair<std::function<fmi2String()>, std::function<void(fmi2String)>>
>;
using FmuVariableStartType = varns::variant<fmi2Real, fmi2Integer, std::string>;
#endif