--- a/src/common.h Sun May 19 02:55:29 2013 +0300 +++ b/src/common.h Sun May 19 03:42:25 2013 +0300 @@ -72,6 +72,18 @@ #define NDEBUG // remove asserts #endif // RELEASE +// Read-only, private property with a get accessor +#define READ_PROPERTY(T, GET) \ +private: \ + T m_##GET; \ +public: \ + const T& GET () const { return m_##GET; } \ + +// Read/write private property with get and set accessors +#define PROPERTY(T, GET, SET) \ + READ_PROPERTY(T, GET) \ + void SET (T val) { m_##GET = val; } + #ifdef null #undef null #endif // null