From 66226db07d3702cc1c61498ce3fbce3d366b2488 Mon Sep 17 00:00:00 2001 From: Joel Machens Date: Sun, 12 Nov 2023 14:41:34 -0600 Subject: Added CountryInstance & Country History Apply Func --- src/openvic-simulation/utility/Getters.hpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/openvic-simulation/utility/Getters.hpp') 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 @@ -55,12 +55,19 @@ namespace OpenVic { */ #define PROPERTY(NAME) \ NAME; \ -\ public: \ auto get_##NAME() const -> decltype(OpenVic::_get_property(NAME)) { \ return OpenVic::_get_property(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: } -- cgit v1.2.3-56-ga3b1