#include <True_RefCount_Policy.h>
Public Member Functions | |
void | add_ref (void) |
Increase the reference count on this object. | |
void | remove_ref (void) |
Decrease the reference count on this object. | |
Protected Member Functions | |
True_RefCount_Policy (void) | |
Constructor. | |
virtual | ~True_RefCount_Policy (void) |
Destructor. | |
Private Attributes | |
TAO_SYNCH_MUTEX | lock_ |
Lock used to synchronize reference count. | |
unsigned int | refcount_ |
Reference count. |
This class is intended to be used as a "policy" argument to a host class template that requires true/functional reference counting. That class would then inherit privately from it like so:
template <class RefCountPolicy> class MyHostClass : private RefCountPolicy { public: void my_add_ref (void) { this->RefCountPolicy::add_ref (); } void my_remove_ref (void) { this->RefCountPolicy::remove_ref (); } };
and use it like so:
typedef MyHostClass<TAO::True_RefCount_Policy> MyRefCountedClass; MyRefCountedClass * p = new MyRefCountedClass; ... p->my_remove_ref ();
operator @c delete()
directly on the host class object.
|
Constructor.
|
|
Destructor.
|
|
Increase the reference count on this object.
|
|
Decrease the reference count on this object.
Decrease the reference count on this object. Once the reference count drops to zero, call |
|
Lock used to synchronize reference count.
|
|
Reference count.
|