17 #ifndef AGXFMI2_EXPORT_VARIABLE_H
18 #define AGXFMI2_EXPORT_VARIABLE_H
20 #include <agx/config/AGX_USE_FMI.h>
32 #include <external/fmi/2.0/fmi2Functions.h>
68 typedef fmi2Status StatusT;
86 agx::TiXmlElement *exportDescription();
93 void setModule(Module *module);
106 template <
typename T>
113 using CallbackFn = void (*)(T&);
121 OutputVariableT(CallbackType callback);
125 virtual fmi2Status get(T& value);
128 void setStartValue(T startValue);
131 T getStartValue()
const;
134 template <
typename T2>
135 void setCallback(T2 callback)
137 m_callback = CallbackType(callback);
142 virtual ~OutputVariableT();
145 CallbackType m_callback;
148 typedef OutputVariableT<fmi2Real> OutputVariable_Real;
149 typedef OutputVariableT<fmi2Integer> OutputVariable_Int;
150 typedef OutputVariableT<fmi2Boolean> OutputVariable_Bool;
151 typedef OutputVariableT<fmi2String> OutputVariable_String;
158 template <
typename T>
159 class AGXFMI_EXPORT InputVariableT :
public OutputVariableT<T>
165 typedef void (*CallbackFn)(T);
172 InputVariableT(CallbackType callback);
176 virtual fmi2Status set(T value);
179 virtual fmi2Status get(T& value);
185 template <
typename T2>
186 void setCallback(T2 callback)
188 m_callback = CallbackType(callback);
193 virtual ~InputVariableT();
196 CallbackType m_callback;
200 typedef InputVariableT<fmi2Real> InputVariable_Real;
201 typedef InputVariableT<fmi2Integer> InputVariable_Int;
202 typedef InputVariableT<fmi2Boolean> InputVariable_Bool;
203 typedef InputVariableT<fmi2String> InputVariable_String;
216 template <>
struct Variable::TypMap<fmi2Real> {
static const Type type = TYPE_REAL; };
217 template <>
struct Variable::TypMap<fmi2Integer> {
static const Type type = TYPE_INT; };
219 template <>
struct Variable::TypMap<fmi2String> {
static const Type type = TYPE_STRING; };
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGX_DECLARE_VECTOR_TYPES(type)
Abstract representation of a value.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Templated callback with one argument.
Representation of a name string.
This namespace contains functionality for using AGX together with version 2 of the Functional Mockup ...
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...