@@ -103,8 +103,8 @@ namespace fmu4cpp {
103103 public:
104104 Variable (
105105 const std::string &name,
106- unsigned int vr, size_t index, T *ptr)
107- : VariableBase(name, vr, index), access_(std::make_unique<PtrAccess<T>>(ptr)) {}
106+ unsigned int vr, size_t index, T *ptr, const std::function< void (T)>& onChange )
107+ : VariableBase(name, vr, index), access_(std::make_unique<PtrAccess<T>>(ptr, onChange )) {}
108108
109109 Variable (
110110 const std::string &name,
@@ -170,8 +170,8 @@ namespace fmu4cpp {
170170 public:
171171 IntVariable (
172172 const std::string &name,
173- unsigned int vr, size_t index, int *ptr)
174- : Variable(name, vr, index, ptr) {}
173+ unsigned int vr, size_t index, int *ptr, std::function< void ( int )> onChange )
174+ : Variable(name, vr, index, ptr, onChange ) {}
175175
176176 IntVariable (
177177 const std::string &name,
@@ -208,8 +208,8 @@ namespace fmu4cpp {
208208 public:
209209 RealVariable (
210210 const std::string &name,
211- unsigned int vr, size_t index, double *ptr)
212- : Variable(name, vr, index, ptr) {
211+ unsigned int vr, size_t index, double *ptr, const std::function< void ( double )>& onChange )
212+ : Variable(name, vr, index, ptr, onChange ) {
213213
214214 variability_ = variability_t ::CONTINUOUS;
215215 }
@@ -252,8 +252,8 @@ namespace fmu4cpp {
252252 public:
253253 BoolVariable (
254254 const std::string &name,
255- unsigned int vr, size_t index, bool *ptr)
256- : Variable(name, vr, index, ptr) {}
255+ unsigned int vr, size_t index, bool *ptr, const std::function< void ( bool )>& onChange )
256+ : Variable(name, vr, index, ptr, onChange ) {}
257257
258258 BoolVariable (
259259 const std::string &name,
@@ -268,8 +268,8 @@ namespace fmu4cpp {
268268 public:
269269 StringVariable (
270270 const std::string &name,
271- unsigned int vr, size_t index, std::string *ptr)
272- : Variable(name, vr, index, ptr) {}
271+ unsigned int vr, size_t index, std::string *ptr, const std::function< void (std::string)>& onChange )
272+ : Variable(name, vr, index, ptr, onChange ) {}
273273
274274 StringVariable (
275275 const std::string &name,
0 commit comments