property.hpp 586 B

1234567891011121314
  1. #if !defined(property)
  2. #define property1(declaration) public: declaration
  3. #define property2(declaration, getter) public: __declspec(property(get=getter)) declaration; protected: declaration##_
  4. #define property3(declaration, getter, setter) public: __declspec(property(get=getter, put=setter)) declaration; protected: declaration##_
  5. #define property_(_1, _2, _3, name, ...) name
  6. #define property(...) property_(__VA_ARGS__, property3, property2, property1)(__VA_ARGS__)
  7. #else
  8. #undef property1
  9. #undef property2
  10. #undef property3
  11. #undef property_
  12. #undef property
  13. #endif