aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/dataloader/NodeTools.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvic-simulation/dataloader/NodeTools.hpp')
-rw-r--r--src/openvic-simulation/dataloader/NodeTools.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/openvic-simulation/dataloader/NodeTools.hpp b/src/openvic-simulation/dataloader/NodeTools.hpp
index 4d56488..a23fb4f 100644
--- a/src/openvic-simulation/dataloader/NodeTools.hpp
+++ b/src/openvic-simulation/dataloader/NodeTools.hpp
@@ -4,6 +4,7 @@
#include <cstdint>
#include <functional>
#include <map>
+#include <optional>
#include <set>
#include <type_traits>
@@ -310,5 +311,13 @@ namespace OpenVic {
return true;
};
}
+
+ template<typename T>
+ Callback<T const&> auto assign_variable_callback_pointer(std::optional<T const*>& var) {
+ return [&var](T const& val) -> bool {
+ var = &val;
+ return true;
+ };
+ }
}
}