Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
#define P6_REFCOUNTED (   classname)
Value:
#define P6_REFCOUNTED_THREADSAFE_RELEASE(classname)
The P6_REFCOUNTED_THREADSAFE_RELEASE helper macro implements a threadsafe release() method for use in...
Definition: p6comhlpr.h:576
#define P6_REFCOUNTED_CREATEINSTANCE(classname)
| _ \ ___ / _|/ ___|___ _ _ _ __ | |_ ___ __| | | | | | ___| |_ __ ___ _ __ ___ | |_) / _ \ |_| | / ...
Definition: p6comhlpr.h:520
struct P6R::P6AUTO_INT32 P6AUTO_INT32
Auto initializing INT32.
#define P6_REFCOUNTED_THREADSAFE_ADDREF(classname)
The P6_REFCOUNTED_THREADSAFE_ADDREF helper macro implements a threadsafe addref() method for use in c...
Definition: p6comhlpr.h:557

The P6_REFCOUNTED method is used to declare and implement the methods which the p6IRefCounted interface needs:

addref() and release() implement the standard P6COM reference counting semantics. createInstance() is also provided so that non-P6COM based classes can be created in the same fashion as P6COM based classes. Following this pattern has some advantages, for example it allows memory pooling (or the use of an alternate allocator of some other type) to be very easily added to the class if needed because the actual allocation is now abstracted.

Classes which derrive from p6IRefCounted MUST follow the standard P6COM reference counting semantics. It is highly recommended that classes which derrive from p6IRefCounted also be managed using the p6RefCounted<> smart pointer.

Parameters
classnameThe name of the class in which the reference counting methods will be decared/implemented in.

Definition at line 613 of file p6comhlpr.h.