HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UT_SharedPtr< T > Class Template Reference

Wrapper around hboost::shared_ptr. More...

#include <UT_SharedPtr.h>

+ Inheritance diagram for UT_SharedPtr< T >:

Public Member Functions

 UT_SharedPtr ()
 
template<class Y >
 UT_SharedPtr (Y *p)
 
template<class Y >
 UT_SharedPtr (UT_SharedPtr< Y > const &r)
 
 UT_SharedPtr (hboost::shared_ptr< T > const &r)
 
template<class Y , class D >
 UT_SharedPtr (Y *p, D d)
 
void clear ()
 Convenience method to clear the pointer. More...
 
void steal (T *src)
 Steal and take ownership of the data passed in. More...
 

Detailed Description

template<class T>
class UT_SharedPtr< T >

Wrapper around hboost::shared_ptr.

An shared pointer takes ownership of the object referenced. The reference counting is done outside the object interface, so the size of a UT_SharedPtr is larger than a vanilla pointer.

As this is a wrapper around the boost shared pointer template, the type (T) must have a Copy Constructor and a valid Assignment Operator

See Also
UT_IntrusivePtr
Examples:
packedshareddata/GU_PackedSharedData.C, and packedshareddata/GU_PackedSharedData.h.

Definition at line 27 of file UT_SharedPtr.h.

Constructor & Destructor Documentation

template<class T>
UT_SharedPtr< T >::UT_SharedPtr ( )
inline

Definition at line 30 of file UT_SharedPtr.h.

template<class T>
template<class Y >
UT_SharedPtr< T >::UT_SharedPtr ( Y p)
inline

Definition at line 35 of file UT_SharedPtr.h.

template<class T>
template<class Y >
UT_SharedPtr< T >::UT_SharedPtr ( UT_SharedPtr< Y > const r)
inline

Definition at line 38 of file UT_SharedPtr.h.

template<class T>
UT_SharedPtr< T >::UT_SharedPtr ( hboost::shared_ptr< T > const r)
inline

Definition at line 40 of file UT_SharedPtr.h.

template<class T>
template<class Y , class D >
UT_SharedPtr< T >::UT_SharedPtr ( Y p,
d 
)
inline

UT_SharedPtr will release p by calling d(p) Requirements: D's copy constructor must not throw

Definition at line 45 of file UT_SharedPtr.h.

Member Function Documentation

template<class T>
void UT_SharedPtr< T >::clear ( void  )
inline

Convenience method to clear the pointer.

Definition at line 48 of file UT_SharedPtr.h.

template<class T>
void UT_SharedPtr< T >::steal ( T src)
inline

Steal and take ownership of the data passed in.

Definition at line 51 of file UT_SharedPtr.h.


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