Rosetta Utilities  2014.35
Classes | Namespaces | Functions
owning_ptr.hh File Reference

Shared-ownership intrusive reference-counted smart pointer. More...

#include <utility/pointer/owning_ptr.fwd.hh>
#include <utility/pointer/owning_ptr.functions.hh>
#include <utility/down_cast.hh>
#include <cassert>
#include <iosfwd>
#include <boost/type_traits/remove_const.hpp>

Classes

class  utility::pointer::owning_ptr< T >
 Shared-ownership intrusive reference-counted smart pointer. 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
 

Functions

template<typename T , typename U >
bool utility::pointer::operator== (owning_ptr< T > const &a, owning_ptr< U > const &b)
 owning_ptr == owning_ptr More...
 
template<typename T >
bool utility::pointer::operator== (owning_ptr< T > const &a, T const *const b)
 owning_ptr == pointer More...
 
template<typename T >
bool utility::pointer::operator== (T const *const a, owning_ptr< T > const &b)
 pointer == owning_ptr More...
 
template<typename T , typename U >
bool utility::pointer::operator!= (owning_ptr< T > const &a, owning_ptr< U > const &b)
 owning_ptr != owning_ptr More...
 
template<typename T >
bool utility::pointer::operator!= (owning_ptr< T > const &a, T const *const b)
 owning_ptr != pointer More...
 
template<typename T >
bool utility::pointer::operator!= (T const *const a, owning_ptr< T > const &b)
 pointer != owning_ptr More...
 
template<typename T , typename U >
bool utility::pointer::operator< (owning_ptr< T > const &a, owning_ptr< U > const &b)
 owning_ptr < owning_ptr More...
 
template<typename T >
bool utility::pointer::operator< (owning_ptr< T > const &a, T const *const b)
 owning_ptr < pointer More...
 
template<typename T >
bool utility::pointer::operator< (T const *const a, owning_ptr< T > const &b)
 pointer < owning_ptr More...
 
template<typename T >
void utility::pointer::swap (owning_ptr< T > &a, owning_ptr< T > &b)
 Swap two owning_ptr objects. More...
 
template<typename T >
T * utility::pointer::get_pointer (owning_ptr< T > const &a)
 Get pointer of owning_ptr: needed by boost::mem_fn. More...
 
template<typename T , typename U >
owning_ptr< T > utility::pointer::static_pointer_cast (owning_ptr< U > const &a)
 Static cast an owning_ptr. More...
 
template<typename T , typename U >
owning_ptr< T > utility::pointer::const_pointer_cast (owning_ptr< U > const &a)
 Const cast an owning_ptr. More...
 
template<typename T , typename U >
owning_ptr< T > utility::pointer::dynamic_pointer_cast (owning_ptr< U > const &a)
 Dynamic cast an owning_ptr. More...
 
template<typename T , typename U >
owning_ptr< T > utility::pointer::down_pointer_cast (owning_ptr< U > const &a)
 Down cast an owning_ptr. More...
 
template<typename CharT , typename CharTraits , typename T >
std::basic_ostream< CharT,
CharTraits > & 
utility::pointer::operator<< (std::basic_ostream< CharT, CharTraits > &os, owning_ptr< T > const &a)
 Stream output. More...
 

Detailed Description

Shared-ownership intrusive reference-counted smart pointer.

Author
Stuart G. Mentzer (Stuar.nosp@m.t_Me.nosp@m.ntzer.nosp@m.@obj.nosp@m.exx.c.nosp@m.om)
Remarks
  • Holds a pointer to an object that owning_ptr owns with other smart pointers using the object's reference counting mechanism.
  • The object type can be const.
  • Can copy construct and assign from pointer, object, or owning_ptr of an assignable type, including from owning_ptr< T > to owning_ptr< T const >.
  • Functions owning_ptr_acquire() and owning_ptr_release() must be defined for all types that will be reference counted.