Rosetta Utilities  2014.35
Classes | Namespaces
ReferenceCount.hh File Reference

Base class for reference-counted single inheritance polymorphic classes. More...

#include <platform/types.hh>
#include <utility/pointer/ReferenceCount.fwd.hh>
#include <cassert>
#include <cstddef>

Classes

class  utility::pointer::ReferenceCount
 Base class for reference-counted polymorphic classes. More...
 

Namespaces

 utility
 unresizable vector whose size is known at compile time, which may be allocated on the stack, and which indexes from 1.
 
 utility::pointer
 

Detailed Description

Base class for reference-counted single inheritance polymorphic classes.

Author
Stuart G. Mentzer (Stuar.nosp@m.t_Me.nosp@m.ntzer.nosp@m.@obj.nosp@m.exx.c.nosp@m.om)
Remarks
  • Intended for use as a base class of polymorphic classes: A template-based approach without virtual destructor is preferred for non-polymorphic classes for efficiency.
  • Count value made mutable and reference add/subtract functions made const so that const objects can be held by shared ownership smart pointers.
  • Prefer to ReferenceCountMI if single inheritance is being used and a pure interface is not needed at the top of the hierarchy since the counter update functions are non-virtual here.