Advertisement
pushrbx

C++ Properties Macros

Feb 10th, 2013
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #define PROPERTY(type, name)  __declspec( property
  2.     ( put = property__set_##name, get = property__get_##name ) ) type name;\
  3.     typedef type property__tmp_type_##name
  4. #define READONLY_PROPERTY(type, name) __declspec( property (get = property__get_##name) ) type name;\
  5.     typedef type property__tmp_type_##name
  6. #define WRITEONLY_PROPERTY(type, name) __declspec( property (put = property__set_##name) ) type name;\
  7.     typedef type property__tmp_type_##name
  8.  
  9. #define GET(name) property__tmp_type_##name property__get_##name()
  10. #define SET(name) void property__set_##name(const property__tmp_type_##name& value)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement