Rosetta Utilities  2014.35
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
utility::pointer::ReferenceCountMI_ Class Reference

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

#include <ReferenceCountMI_.hh>

Public Member Functions

virtual ~ReferenceCountMI_ ()
 Destructor. More...
 
Size ref_count () const
 Reference count. More...
 
- Public Member Functions inherited from utility::pointer::ReferenceCountMI
virtual ~ReferenceCountMI ()
 Destructor. More...
 

Protected Member Functions

 ReferenceCountMI_ ()
 Default constructor. More...
 
 ReferenceCountMI_ (ReferenceCountMI_ const &)
 Copy constructor. More...
 
ReferenceCountMI_operator= (ReferenceCountMI_ const &)
 Copy assignment. More...
 
- Protected Member Functions inherited from utility::pointer::ReferenceCountMI
 ReferenceCountMI ()
 Default constructor. More...
 
 ReferenceCountMI (ReferenceCountMI const &)
 Copy constructor. More...
 
ReferenceCountMIoperator= (ReferenceCountMI const &)
 Copy assignment. More...
 

Private Types

typedef ReferenceCountMI Super
 

Private Member Functions

void add_ref () const
 Add a reference: Increment the count. More...
 
void remove_ref () const
 Remove a reference: Decrement the count: Self-destruct if count hits zero. More...
 

Private Attributes

Size count_
 Reference count. More...
 

Static Private Attributes

static Size const max_count_ = static_cast< ReferenceCountMI_::Size >( -1 )
 Max count. More...
 

Friends

template<typename T >
void owning_ptr_acquire (T *)
 Add a reference to the object acquired by an owning_ptr. More...
 
template<typename T >
void owning_ptr_release (T *)
 Remove a reference from the object released by an owning_ptr. More...
 

Additional Inherited Members

- Public Types inherited from utility::pointer::ReferenceCountMI
typedef platform::Size Size
 
typedef platform::Size size_type
 

Detailed Description

Base class for reference counted polymorphic classes.

Member Typedef Documentation

Constructor & Destructor Documentation

utility::pointer::ReferenceCountMI_::ReferenceCountMI_ ( )
inlineprotected

Default constructor.

utility::pointer::ReferenceCountMI_::ReferenceCountMI_ ( ReferenceCountMI_ const &  )
inlineprotected

Copy constructor.

virtual utility::pointer::ReferenceCountMI_::~ReferenceCountMI_ ( )
inlinevirtual

Destructor.

References count_.

Member Function Documentation

void utility::pointer::ReferenceCountMI_::add_ref ( ) const
inlineprivatevirtual

Add a reference: Increment the count.

Implements utility::pointer::ReferenceCountMI.

References count_, and max_count_.

ReferenceCountMI_& utility::pointer::ReferenceCountMI_::operator= ( ReferenceCountMI_ const &  )
inlineprotected

Copy assignment.

Size utility::pointer::ReferenceCountMI_::ref_count ( ) const
inlinevirtual

Reference count.

Implements utility::pointer::ReferenceCountMI.

References count_.

void utility::pointer::ReferenceCountMI_::remove_ref ( ) const
inlineprivatevirtual

Remove a reference: Decrement the count: Self-destruct if count hits zero.

Implements utility::pointer::ReferenceCountMI.

References count_.

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.

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

Remove a reference from the object released by an owning_ptr.

Member Data Documentation

Size utility::pointer::ReferenceCountMI_::count_
mutableprivate

Reference count.

Note
Identity semantics: Not copied or assigned

Referenced by add_ref(), ref_count(), remove_ref(), and ~ReferenceCountMI_().

ReferenceCountMI_::Size const utility::pointer::ReferenceCountMI_::max_count_ = static_cast< ReferenceCountMI_::Size >( -1 )
staticprivate

Max count.

ReferenceCountMI_ static member definitions.

Referenced by add_ref().


The documentation for this class was generated from the following files: