diff options
author | Joel Machens <ajmach6@gmail.com> | 2023-11-12 21:41:34 +0100 |
---|---|---|
committer | Joel Machens <ajmach6@gmail.com> | 2023-11-13 02:10:47 +0100 |
commit | 66226db07d3702cc1c61498ce3fbce3d366b2488 (patch) | |
tree | 768e068cd0fbe02f1eef1bced2471d0cda920c08 /src/openvic-simulation/utility | |
parent | c8983f5cda0b396b76c9d1491cf4c8ff5997d420 (diff) |
Added CountryInstance & Country History Apply Func
Diffstat (limited to 'src/openvic-simulation/utility')
-rw-r--r-- | src/openvic-simulation/utility/Getters.hpp | 13 |
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: } |