Go to the source code of this file.
Detailed Description
QScopedPointer gebruiken voor priv_ptr zodat PIMPL_UNINITIALIZE niet nodig is is niet echt een optie. QScopedPointerDeleter is geimplementeerd met compile-time type checking, wat extra implementatie-constraints oplegt voor de public class. (zie docs voor forward declaration in QScopedPointer)
See also:
Define Documentation
#define PIMPL_DECLARE_PRIVATE |
( |
|
Class |
) |
|
Value:private: \
inline Class##Private* priv_func() { return reinterpret_cast<Class##Private *>(priv_ptr); } \
inline const Class##Private* priv_func() const { return reinterpret_cast<const Class##Private *>(priv_ptr); } \
friend class Class##Private; \
void* priv_ptr;
#define PIMPL_DECLARE_PUBLIC |
( |
|
Class |
) |
|
Value:public: \
inline Class* pub_func() { return static_cast<Class *>(pub_ptr); } \
inline const Class* pub_func() const { return static_cast<const Class *>(pub_ptr); } \
private: \
friend class Class; \
void* pub_ptr;
#define PIMPL_INITIALIZE |
( |
|
Class |
) |
|
#define PIMPL_PRIVATE |
( |
|
Class |
) |
Class##Private * const priv = priv_func() |
#define PIMPL_PUBLIC |
( |
|
Class |
) |
Class * const pub = pub_func() |
#define PIMPL_UNINITIALIZE |
( |
|
Class |
) |
|