diff options
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: } |