diff options
Diffstat (limited to 'src/openvic-simulation/dataloader/NodeTools.hpp')
-rw-r--r-- | src/openvic-simulation/dataloader/NodeTools.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/openvic-simulation/dataloader/NodeTools.hpp b/src/openvic-simulation/dataloader/NodeTools.hpp index bb75ffe..51bbfa9 100644 --- a/src/openvic-simulation/dataloader/NodeTools.hpp +++ b/src/openvic-simulation/dataloader/NodeTools.hpp @@ -162,5 +162,13 @@ namespace OpenVic { callback_t<int64_t> assign_variable_callback_int(const std::string_view name, T& var) { return _assign_variable_callback_int<int64_t>(name, var); } + + template<typename T> + callback_t<T const&> assign_variable_callback_pointer(T const*& var) { + return [&var](T const& val) -> bool { + var = &val; + return true; + }; + } } } |