Rosetta 3.3
|
Interface class for reference counted polymorphic classes. More...
#include <ReferenceCountMI.hh>
Public Types | |
typedef platform::Size | Size |
typedef platform::Size | size_type |
Public Member Functions | |
virtual | ~ReferenceCountMI () |
Destructor. | |
virtual Size | ref_count () const =0 |
Reference count. | |
Protected Member Functions | |
ReferenceCountMI () | |
Default constructor. | |
ReferenceCountMI (ReferenceCountMI const &) | |
Copy constructor. | |
ReferenceCountMI & | operator= (ReferenceCountMI const &) |
Copy assignment. | |
virtual void | add_ref () const =0 |
Add a reference: Increment the count. | |
virtual void | remove_ref () const =0 |
Remove a reference: Decrement the count: Self-destruct if count hits zero. | |
Friends | |
template<typename T > | |
void | owning_ptr_acquire (T *) |
Add a reference to the object acquired by an owning_ptr. | |
template<typename T > | |
void | owning_ptr_release (T *) |
Remove a reference from the object released by an owning_ptr. |
Interface class for reference counted polymorphic classes.
ReferenceCountMI is a pure interface base class for multiple inheritance Decorator pattern hierarchies needing reference counting.
To use ReferenceCountMI the root class in the hierarchy should inherit from it virtually and the concrete classes should inherit from the ReferenceCountMI_ implementation.
utility::pointer::ReferenceCountMI::ReferenceCountMI | ( | ) | [inline, protected] |
Default constructor.
utility::pointer::ReferenceCountMI::ReferenceCountMI | ( | ReferenceCountMI const & | ) | [inline, protected] |
Copy constructor.
virtual utility::pointer::ReferenceCountMI::~ReferenceCountMI | ( | ) | [inline, virtual] |
Destructor.
virtual void utility::pointer::ReferenceCountMI::add_ref | ( | ) | const [protected, pure virtual] |
Add a reference: Increment the count.
ReferenceCountMI& utility::pointer::ReferenceCountMI::operator= | ( | ReferenceCountMI const & | ) | [inline, protected] |
Copy assignment.
virtual Size utility::pointer::ReferenceCountMI::ref_count | ( | ) | const [pure virtual] |
Reference count.
Implemented in utility::pointer::ReferenceCountMI_.
virtual void utility::pointer::ReferenceCountMI::remove_ref | ( | ) | const [protected, pure virtual] |
Remove a reference: Decrement the count: Self-destruct if count hits zero.
void owning_ptr_acquire | ( | T * | p | ) | [friend] |
Add a reference to the object acquired by an owning_ptr.
Reimplemented in utility::pointer::ReferenceCountMI_.
void owning_ptr_release | ( | T * | p | ) | [friend] |
Remove a reference from the object released by an owning_ptr.
Reimplemented in utility::pointer::ReferenceCountMI_.