//d-ptr header
//
-// (c) Konrad Rosenbaum, 2010-2011
+// (c) Konrad Rosenbaum, 2010-2013
// Copying and distribution of this file, with or without modification,
// are permitted in any medium without royalty provided the copyright
// notice and this notice are preserved. This file is offered as-is,
The d-pointer class Private is only forward declared, you have to fully declare and implement it in the code where you are using it, i.e. where you are implementing the containing class.
-\param dp name of the d-pointer*/
-#define DECLARE_DPTR(dp) \
+Use the DECLARE_DPTRX version if your surrounding class is part of a library's exported API.
+
+\param dp name of the d-pointer
+\param export_spec use Q_DECL_EXPORT or Q_DECL_IMPORT to signal public API export or import
+*/
+#define DECLARE_DPTR(dp) DECLARE_DPTRX(dp,)
+#define DECLARE_DPTRX(dp,export_spec) \
private:\
class Private; \
- class DPrivate{\
+ class export_spec DPrivate{\
public:DPrivate();DPrivate(const DPrivate&);~DPrivate();\
DPrivate&operator=(const DPrivate&);\
const Private*operator->()const{return d;}\
Warning: shared d-pointers are not thread safe and they are only re-entrant if instances sharing the same d-pointer are only located in one thread, while instances with different d-pointers may be spread over different threads.
-\param dp name of the d-pointer*/
+Use the DECLARE_SHARED_DPTRX version if your surrounding class is part of a library's exported API.
+
+\param dp name of the d-pointer
+\param export_spec use Q_DECL_EXPORT or Q_DECL_IMPORT to signal public API export or import
+*/
#define DECLARE_SHARED_DPTR(dp) DECLARE_DPTR(dp)
+#define DECLARE_SHARED_DPTRX(dp,export_spec) DECLARE_DPTRX(dp,export_spec)
#ifdef DECLARE_NONCOPY_DPTR
The d-pointer class Private is only forward declared, you have to fully declare and implement it in the code where you are using it, i.e. where you are implementing the containing class.
-\param dp name of the d-pointer*/
-#define DECLARE_NONCOPY_DPTR(dp) \
+Use the DECLARE_NONCOPY_DPTRX version if your surrounding class is part of a library's exported API.
+
+\param dp name of the d-pointer
+\param export_spec use Q_DECL_EXPORT or Q_DECL_IMPORT to signal public API export or import
+*/
+#define DECLARE_NONCOPY_DPTR(dp) DECLARE_NONCOPY_DPTRX(dp,)
+#define DECLARE_NONCOPY_DPTRX(dp,export_spec) \
private:\
class Private; \
- class DPrivate{\
+ class export_spec DPrivate{\
public:DPrivate();~DPrivate();\
const Private*operator->()const{return d;}\
Private*operator->(){return d;}\