aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/utility/Getters.hpp
diff options
context:
space:
mode:
author BrickPi <49528459+BrickPi@users.noreply.github.com>2023-11-13 02:25:32 +0100
committer GitHub <noreply@github.com>2023-11-13 02:25:32 +0100
commitba7bfc52803781c970d6e8afc84c7d3d3e843726 (patch)
tree768e068cd0fbe02f1eef1bced2471d0cda920c08 /src/openvic-simulation/utility/Getters.hpp
parentc8983f5cda0b396b76c9d1491cf4c8ff5997d420 (diff)
parent66226db07d3702cc1c61498ce3fbce3d366b2488 (diff)
Merge pull request #74 from OpenVicProject/apply-country-history
Country History Improvements
Diffstat (limited to 'src/openvic-simulation/utility/Getters.hpp')
-rw-r--r--src/openvic-simulation/utility/Getters.hpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/openvic-simulation/utility/Getters.hpp b/src/openvic-simulation/utility/Getters.hpp
index c8f2193..e34a970 100644
--- a/src/openvic-simulation/utility/Getters.hpp
+++ b/src/openvic-simulation/utility/Getters.hpp
@@ -16,7 +16,7 @@ namespace OpenVic {
struct ReturnByValueProperty {};
/*
- * Template function used to choose the return type and provide the implementation for the
+ * Template function used to choose the return type and provide the implementation
* for variable getters created using the PROPERTY macro.
*/
template<typename decl, typename T>
@@ -55,12 +55,19 @@ namespace OpenVic {
*/
#define PROPERTY(NAME) \
NAME; \
-\
public: \
auto get_##NAME() const -> decltype(OpenVic::_get_property<decltype(NAME)>(NAME)) { \
return OpenVic::_get_property<decltype(NAME)>(NAME); \
} \
-\
+private:
+
+// TODO: Special logic to decide argument type and control assignment.
+#define PROPERTY_RW(NAME) \
+ PROPERTY(NAME) \
+public: \
+ void set_##NAME(decltype(NAME) new_##NAME) { \
+ NAME = new_##NAME; \
+ } \
private:
}