Public Types | Public Member Functions | List of all members
RefCountedPtr< T > Class Template Reference

A shared pointer template for reference-counted objects. More...

#include <RefCounted.h>

Public Types

typedef T element_type
 

Public Member Functions

 RefCountedPtr ()
 
 RefCountedPtr (T *p, bool add_ref=true)
 
template<class U >
 RefCountedPtr (RefCountedPtr< U > const &rhs)
 
 RefCountedPtr (RefCountedPtr const &rhs)
 
 RefCountedPtr (RefCountedPtr &&rhs)
 
RefCountedPtroperator= (RefCountedPtr &&rhs)
 
 ~RefCountedPtr ()
 
template<class U >
RefCountedPtroperator= (RefCountedPtr< U > const &rhs)
 
bool operator== (RefCountedPtr< T > const &rhs) const
 
template<class U >
bool operator== (RefCountedPtr< U > const &rhs) const
 
bool operator!= (RefCountedPtr< T > const &rhs) const
 
template<class U >
bool operator!= (RefCountedPtr< U > const &rhs) const
 
RefCountedPtroperator= (RefCountedPtr const &rhs)
 
RefCountedPtroperator= (T *rhs)
 
T * get () const
 Get a pointer the intenal object held by the reference-counted object. More...
 
T *const & GetCR () const
 Get a constant reference to the intenal object held by the reference-counted object. More...
 
T *& GetR ()
 Get a reference to the intenal object held by the reference-counted object. More...
 
T & operator* () const
 Get a reference to the intenal object held by the reference-counted object. More...
 
T * operator-> () const
 Get a pointer to the intenal object held by the reference-counted object. More...
 
bool IsValid () const
 Return true if the ref-counted object has a valid (non-NULL) internal object. More...
 
bool IsNull () const
 Return true if the ref-counted object has a invalid (NULL) internal object. More...
 
bool Equals (T const *other) const
 
bool Equals (RefCountedPtr const &other) const
 
void swap (RefCountedPtr &rhs)
 Swap the internal objects pointed to by two smart pointers. More...
 

Detailed Description

template<class T>
class Bentley::RefCountedPtr< T >

A shared pointer template for reference-counted objects.

Type T must have functions named AddRef and Release with signatures that conform to the reference-counting pattern.

Member Typedef Documentation

typedef T element_type

Constructor & Destructor Documentation

RefCountedPtr ( T *  p,
bool  add_ref = true 
)
RefCountedPtr ( RefCountedPtr< U > const &  rhs)
RefCountedPtr ( RefCountedPtr< T > const &  rhs)
RefCountedPtr ( RefCountedPtr< T > &&  rhs)

Member Function Documentation

bool Equals ( T const *  other) const
bool Equals ( RefCountedPtr< T > const &  other) const
T* get ( ) const
T* const& GetCR ( ) const

Get a constant reference to the intenal object held by the reference-counted object.

T*& GetR ( )

Get a reference to the intenal object held by the reference-counted object.

bool IsNull ( ) const

Return true if the ref-counted object has a invalid (NULL) internal object.

Referenced by VirtualCollectionIterator< IteratorImplementation >::operator!=().

bool IsValid ( ) const

Return true if the ref-counted object has a valid (non-NULL) internal object.

bool operator!= ( RefCountedPtr< T > const &  rhs) const
bool operator!= ( RefCountedPtr< U > const &  rhs) const
T& operator* ( ) const

Get a reference to the intenal object held by the reference-counted object.

T* operator-> ( ) const

Get a pointer to the intenal object held by the reference-counted object.

RefCountedPtr& operator= ( RefCountedPtr< T > &&  rhs)
RefCountedPtr& operator= ( RefCountedPtr< U > const &  rhs)
RefCountedPtr& operator= ( RefCountedPtr< T > const &  rhs)
RefCountedPtr& operator= ( T *  rhs)
bool operator== ( RefCountedPtr< T > const &  rhs) const
bool operator== ( RefCountedPtr< U > const &  rhs) const
void swap ( RefCountedPtr< T > &  rhs)

Swap the internal objects pointed to by two smart pointers.

Referenced by RefCountedPtr< IECInstanceCollectionAdapter >::operator=().


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

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.