DD::Image::RefCountedPtr< T > Class Template Reference

Public Member Functions

 RefCountedPtr ()
 
 RefCountedPtr (T *obj)
 
 RefCountedPtr (const RefCountedPtr< T > &other)
 
 ~RefCountedPtr ()
 
void operator= (const RefCountedPtr< T > &other)
 
T & operator* ()
 
const T & operator* () const
 
T * operator-> ()
 
const T * operator-> () const
 
int refcount () const
 
 operator bool () const
 
void allocate ()
 
template<class P1 >
void allocate (const P1 &p1)
 
template<class P1 , class P2 >
void allocate (const P1 &p1, const P2 &p2)
 
template<class P1 , class P2 , class P3 >
void allocate (const P1 &p1, const P2 &p2, const P3 &p3)
 
void clear ()
 

Static Public Member Functions

template<class U >
static RefCountedPtr< T > downCast (RefCountedPtr< U > other)
 

Detailed Description

template<class T>
class DD::Image::RefCountedPtr< T >

Template for a reference counted ptr. Template argument T should be a subclass of RefCountedObject, or provide a similar interface.

Constructor & Destructor Documentation

template<class T>
DD::Image::RefCountedPtr< T >::RefCountedPtr ( )
inline

Create a NULL pointer.

template<class T>
DD::Image::RefCountedPtr< T >::RefCountedPtr ( T *  obj)
inlineexplicit

Create a new RefCountedPtr around an existing object, and increment its reference count.

template<class T>
DD::Image::RefCountedPtr< T >::RefCountedPtr ( const RefCountedPtr< T > &  other)
inline

Copy an existing RefCountedPtr and increment the reference

template<class T>
DD::Image::RefCountedPtr< T >::~RefCountedPtr ( )
inline

Destroy the RefCountedPtr and if needed delete the underlying object

Member Function Documentation

template<class T>
void DD::Image::RefCountedPtr< T >::operator= ( const RefCountedPtr< T > &  other)
inline

Copy an existing RefCountedPtr, incrementing and decrementing references as appropriate.

template<class T>
T& DD::Image::RefCountedPtr< T >::operator* ( )
inline

Get the underlying object

template<class T>
const T& DD::Image::RefCountedPtr< T >::operator* ( ) const
inline

Get the underlying object

template<class T>
T* DD::Image::RefCountedPtr< T >::operator-> ( )
inline

Get the underlying object

template<class T>
const T* DD::Image::RefCountedPtr< T >::operator-> ( ) const
inline

Get the underlying object

template<class T>
int DD::Image::RefCountedPtr< T >::refcount ( ) const
inline

Return the reference count of the underlying object

template<class T>
template<class U >
static RefCountedPtr<T> DD::Image::RefCountedPtr< T >::downCast ( RefCountedPtr< U >  other)
inlinestatic

Use dynamic_cast to downcast to another, more specific, RefCountedPtr type

template<class T>
DD::Image::RefCountedPtr< T >::operator bool ( ) const
inline

Test whether the pointer is pointing at an object right now. True if it is.

template<class T>
void DD::Image::RefCountedPtr< T >::allocate ( )
inline

Allocate a new object and make this pointer be a reference to it.

Referenced by DD::Image::GeometryList::add_primitive().

template<class T>
template<class P1 >
void DD::Image::RefCountedPtr< T >::allocate ( const P1 &  p1)
inline

Allocate a new object and make this pointer be a reference to it.

template<class T>
template<class P1 , class P2 >
void DD::Image::RefCountedPtr< T >::allocate ( const P1 &  p1,
const P2 &  p2 
)
inline

Allocate a new object and make this pointer be a reference to it.

template<class T>
template<class P1 , class P2 , class P3 >
void DD::Image::RefCountedPtr< T >::allocate ( const P1 &  p1,
const P2 &  p2,
const P3 &  p3 
)
inline

Allocate a new object and make this pointer be a reference to it.

template<class T>
void DD::Image::RefCountedPtr< T >::clear ( )
inline

Unreference the existing object (possibly deleting it)

Referenced by DD::Image::ReadGeo::create_geometry(), DD::Image::GeoOp::delete_allocations(), and DD::Image::GeoOp::get_geometry().



©2022 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.thefoundry.co.uk