TAO_AnyTypeCode 4.0.1
|
True reference counting policy. More...
#include <True_RefCount_Policy.h>
Public Member Functions | |
void | add_ref () |
Increase the reference count on this object. | |
void | remove_ref () |
Decrease the reference count on this object. | |
Protected Member Functions | |
True_RefCount_Policy () | |
Constructor. | |
virtual | ~True_RefCount_Policy () |
Destructor. | |
Private Attributes | |
std::atomic< uint32_t > | refcount_ |
Reference counter. | |
True reference counting policy.
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:
and use it like so:
operator
delete()
directly on the host class object.
|
protected |
Constructor.
|
protectedvirtual |
Destructor.
remove_ref()
calls operator
delete
this
. void TAO::True_RefCount_Policy::add_ref | ( | ) |
Increase the reference count on this object.
void TAO::True_RefCount_Policy::remove_ref | ( | ) |
Decrease the reference count on this object.
Decrease the reference count on this object. Once the reference count drops to zero, call operator
delete()
on this object.
|
private |
Reference counter.