VisioMove SDK (iOS)  2.1.22
VgEngine::VgRefPtr< Type > Class Template Reference

Public Member Functions

 VgRefPtr ()
 
 VgRefPtr (Type *pPointer)
 
 VgRefPtr (const VgRefPtr &pRefPtr)
 
template<class OtherType >
 VgRefPtr (const VgRefPtr< OtherType > &pRefPtr)
 
 ~VgRefPtr ()
 
 operator VgEngine::VgConstRefPtr< Type > ()
 
 operator VgEngine::VgConstRefPtr< Type > () const
 
template<typename OtherType >
 operator VgEngine::VgConstRefPtr< OtherType > () const
 
VgRefPtroperator= (const VgRefPtr &pRefPtr)
 
template<class OtherType >
VgRefPtr< Type > & operator= (const VgRefPtr< OtherType > &pRefPtr)
 
VgRefPtrset (Type *pPointer)
 
VgRefPtroperator= (Type *pPointer)
 
bool operator== (const VgRefPtr &pRefPtr) const
 
bool operator== (const Type *pPointer) const
 
bool operator!= (const VgRefPtr &pRefPtr) const
 
bool operator!= (const Type *pPointer) const
 
bool operator< (const VgRefPtr &pRefPtr) const
 
Type & operator* () const
 
Type * operator-> () const
 
Type * get () const
 
bool operator! () const
 
bool isValid () const
 
 operator bool ()
 

Static Public Member Functions

static VgRefPtr< Type > getNull ()
 

Friends

class VgEngine::VgObjectBridge
 
template<typename >
class VgConstRefPtr
 
template<typename >
class VgRefPtr
 
bool operator== (const Type *pPointer, const VgRefPtr &pRefPtr)
 
bool operator!= (const Type *pPointer, const VgRefPtr &pRefPtr)
 

Detailed Description

template<class Type>
class VgEngine::VgRefPtr< Type >

The VgRefPtr class is used to automatically reference and unreference reference counted objects (VgReferenced).

A documentation can be found here: http://andesengineering.com/OSG_ProducerArticles/RefPointers/RefPointers.html

Here is the summary of rules defined in this document.

  • Rule #1: Always use VgRefPtr<> to point to classes that are derived from VgReferenced
  • Rule #2: Never return the address VgRefPtr<> points to in the return value of a function. Return the VgRefPtr<> itself.
  • Rule #3: Never use ref() or unref() (unless you really, really (really) know what you are doing.
  • Rule #4: When subclassing from VgReferenced (directly or indirectly), always protect the destructor so the object cannot be allocated on the stack.
  • Rule #5 (exception of rule #1): If circular referencing is possible, it is necessary to carefully use simple pointers when it is known that the the object will be referenced by another ref_ptr in the current scope.
Template Parameters
TypeThe type wrapped by the VgRefPtr.

Constructor & Destructor Documentation

template<class Type>
VgEngine::VgRefPtr< Type >::VgRefPtr ( )
inline

Constructor.

template<class Type>
VgEngine::VgRefPtr< Type >::VgRefPtr ( Type *  pPointer)
inline

Constructor.

template<class Type>
VgEngine::VgRefPtr< Type >::VgRefPtr ( const VgRefPtr< Type > &  pRefPtr)
inline

Copy constructor.

template<class Type>
template<class OtherType >
VgEngine::VgRefPtr< Type >::VgRefPtr ( const VgRefPtr< OtherType > &  pRefPtr)
inline

Cross-type constructor.

template<class Type>
VgEngine::VgRefPtr< Type >::~VgRefPtr ( )
inline

Destructor.

Member Function Documentation

template<class Type>
Type* VgEngine::VgRefPtr< Type >::get ( ) const
inline

Retrieves the encapsulated pointer.

template<class Type>
static VgRefPtr<Type> VgEngine::VgRefPtr< Type >::getNull ( )
inlinestatic
template<class Type>
bool VgEngine::VgRefPtr< Type >::isValid ( ) const
inline
template<class Type>
VgEngine::VgRefPtr< Type >::operator bool ( )
inline
template<class Type>
template<typename OtherType >
VgEngine::VgRefPtr< Type >::operator VgEngine::VgConstRefPtr< OtherType > ( ) const
inline

Cross-type conversion operator to VgConstRefPtr

template<class Type>
VgEngine::VgRefPtr< Type >::operator VgEngine::VgConstRefPtr< Type > ( )
inline

Conversion operator to VgConstRefPtr

template<class Type>
VgEngine::VgRefPtr< Type >::operator VgEngine::VgConstRefPtr< Type > ( ) const
inline

Conversion operator to VgConstRefPtr

template<class Type>
bool VgEngine::VgRefPtr< Type >::operator! ( ) const
inline

Logical negation operator (used to test the pointer validity).

template<class Type>
bool VgEngine::VgRefPtr< Type >::operator!= ( const VgRefPtr< Type > &  pRefPtr) const
inline

Not equal to operator (VgRefPtr acts like a pointer).

template<class Type>
bool VgEngine::VgRefPtr< Type >::operator!= ( const Type *  pPointer) const
inline

Not equal to operator (VgRefPtr acts like a pointer).

template<class Type>
Type& VgEngine::VgRefPtr< Type >::operator* ( ) const
inline

Dereference the pointer.

template<class Type>
Type* VgEngine::VgRefPtr< Type >::operator-> ( ) const
inline

Allow the access to encapsulated pointer's members.

template<class Type>
bool VgEngine::VgRefPtr< Type >::operator< ( const VgRefPtr< Type > &  pRefPtr) const
inline

Greater than operator (VgRefPtr acts like a pointer).

template<class Type>
VgRefPtr& VgEngine::VgRefPtr< Type >::operator= ( const VgRefPtr< Type > &  pRefPtr)
inline

Assignation operator.

template<class Type>
template<class OtherType >
VgRefPtr< Type >& VgEngine::VgRefPtr< Type >::operator= ( const VgRefPtr< OtherType > &  pRefPtr)
inline

Cross-type assignation operator.

template<class Type>
VgRefPtr& VgEngine::VgRefPtr< Type >::operator= ( Type *  pPointer)
inline

Assignation operator with a pointer.

template<class Type>
bool VgEngine::VgRefPtr< Type >::operator== ( const VgRefPtr< Type > &  pRefPtr) const
inline

Equal to operator (VgRefPtr acts like a pointer).

template<class Type>
bool VgEngine::VgRefPtr< Type >::operator== ( const Type *  pPointer) const
inline

Equal to operator (VgRefPtr acts like a pointer).

template<class Type>
VgRefPtr& VgEngine::VgRefPtr< Type >::set ( Type *  pPointer)
inline

Friends And Related Function Documentation

template<class Type>
bool operator!= ( const Type *  pPointer,
const VgRefPtr< Type > &  pRefPtr 
)
friend

Not equal to operator (VgRefPtr acts like a pointer).

template<class Type>
bool operator== ( const Type *  pPointer,
const VgRefPtr< Type > &  pRefPtr 
)
friend

Equal to operator (VgRefPtr acts like a pointer).

template<class Type>
template<typename >
friend class VgConstRefPtr
friend
template<class Type>
friend class VgEngine::VgObjectBridge
friend
template<class Type>
template<typename >
friend class VgRefPtr
friend

The documentation for this class was generated from the following file:
VisioMove 2.1.22, Visioglobe® 2016