Rosetta 3.3
Public Types | Public Member Functions | Protected Member Functions | Friends
utility::pointer::ReferenceCountMI Class Reference

Interface class for reference counted polymorphic classes. More...

#include <ReferenceCountMI.hh>

Inheritance diagram for utility::pointer::ReferenceCountMI:
Inheritance graph
[legend]

List of all members.

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.
ReferenceCountMIoperator= (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.

Detailed Description

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.


Member Typedef Documentation


Constructor & Destructor Documentation

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.


Member Function Documentation

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.


Friends And Related Function Documentation

template<typename T >
void owning_ptr_acquire ( T *  p) [friend]

Add a reference to the object acquired by an owning_ptr.

Reimplemented in utility::pointer::ReferenceCountMI_.

template<typename T >
void owning_ptr_release ( T *  p) [friend]

Remove a reference from the object released by an owning_ptr.

Reimplemented in utility::pointer::ReferenceCountMI_.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines