src/common.h

changeset 421
7d26db0be944
parent 402
ec95fc95e5f3
child 433
b49930dcbe84
equal deleted inserted replaced
420:8d6af951b611 421:7d26db0be944
59 #define elif else if 59 #define elif else if
60 60
61 void doDevf (const char* func, const char* fmtstr, ...); 61 void doDevf (const char* func, const char* fmtstr, ...);
62 62
63 // Version string identifier 63 // Version string identifier
64 const char* versionString (); 64 const char* versionString();
65 const char* versionMoniker (); 65 const char* versionMoniker();
66 const char* fullVersionString (); 66 const char* fullVersionString();
67 67
68 // Null pointer 68 // Null pointer
69 static const std::nullptr_t null = nullptr; 69 static const std::nullptr_t null = nullptr;
70 70
71 #ifdef __GNUC__ 71 #ifdef __GNUC__
89 #endif // RELEASE 89 #endif // RELEASE
90 90
91 #define PROP_NAME(GET) m_##GET 91 #define PROP_NAME(GET) m_##GET
92 92
93 #define READ_ACCESSOR(T, GET) \ 93 #define READ_ACCESSOR(T, GET) \
94 T const& GET () const 94 T const& GET() const
95 95
96 #define SET_ACCESSOR(T, SET) \ 96 #define SET_ACCESSOR(T, SET) \
97 void SET (T val) 97 void SET (T val)
98 98
99 // Read-only, private property with a get accessor 99 // Read-only, private property with a get accessor
131 public: \ 131 public: \
132 READ_ACCESSOR (T, GET) { return PROP_NAME (GET); } 132 READ_ACCESSOR (T, GET) { return PROP_NAME (GET); }
133 133
134 // Property whose set accessor is a public slot 134 // Property whose set accessor is a public slot
135 // TODO: make this replace PROPERTY 135 // TODO: make this replace PROPERTY
136 #define SLOT_PROPERTY( T, GET, SET ) \ 136 #define SLOT_PROPERTY (T, GET, SET) \
137 private: \ 137 private: \
138 T PROP_NAME( GET ); \ 138 T PROP_NAME (GET); \
139 public: \ 139 public: \
140 READ_ACCESSOR( T, GET ) { return PROP_NAME (GET); } \ 140 READ_ACCESSOR (T, GET) { return PROP_NAME (GET); } \
141 public slots: \ 141 public slots: \
142 SET_ACCESSOR( T, SET ) { PROP_NAME (GET) = val; } 142 SET_ACCESSOR (T, SET) { PROP_NAME (GET) = val; }
143 143
144 #ifdef null 144 #ifdef null
145 #undef null 145 #undef null
146 #endif // null 146 #endif // null
147 147

mercurial