VisioMove  2.1.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Friends Pages
VgEngine::VgConstRefPtr< Type > Class Template Reference

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

Public Member Functions

 VgConstRefPtr ()
 Constructor. More...
 
 VgConstRefPtr (Type const *pPointer)
 Constructor. More...
 
 VgConstRefPtr (const VgConstRefPtr &pConstRefPtr)
 Copy constructor. More...
 
template<class OtherType >
 VgConstRefPtr (const VgConstRefPtr< OtherType > &pConstRefPtr)
 Cross-type constructor. More...
 
 ~VgConstRefPtr ()
 Destructor. More...
 
VgConstRefPtroperator= (const VgConstRefPtr &pConstRefPtr)
 Assignation operator. More...
 
template<class OtherType >
VgConstRefPtr< Type > & operator= (const VgConstRefPtr< OtherType > &pConstRefPtr)
 Cross-type assignation operator. More...
 
template<typename OtherType >
 operator VgConstRefPtr< OtherType > ()
 
VgConstRefPtrset (Type const *pPointer)
 
VgConstRefPtroperator= (Type const *pPointer)
 Assignation operator with a pointer. More...
 
bool operator== (const VgConstRefPtr &pConstRefPtr) const
 Equal to operator (VgRefPtr acts like a pointer). More...
 
bool operator== (Type const *pPointer) const
 Equal to operator (VgRefPtr acts like a pointer). More...
 
bool operator!= (const VgConstRefPtr &pRefPtr) const
 Not equal to operator (VgRefPtr acts like a pointer). More...
 
bool operator!= (Type const *pPointer) const
 Not equal to operator (VgRefPtr acts like a pointer). More...
 
bool operator< (const VgConstRefPtr &pRefPtr) const
 Greater than operator (VgRefPtr acts like a pointer). More...
 
Type const & operator* () const
 Dereference the pointer. More...
 
Type const * operator-> () const
 Allow the access to encapsulated pointer's members. More...
 
Type const * get () const
 Retrieves the encapsulated pointer. More...
 
bool operator! () const
 Logical negation operator (used to test the pointer validity). More...
 
bool isValid () const
 Tell if the pointer is valid. More...
 
 operator bool ()
 

Static Public Member Functions

static VgConstRefPtr< Type > getNull ()
 

Friends

class VgEngine::VgObjectBridge
 
template<typename >
class VgConstRefPtr
 
template<typename >
class VgRefPtr
 
bool operator== (Type const *pPointer, const VgConstRefPtr &pRefPtr)
 Equal to operator (VgRefPtr acts like a pointer). More...
 
bool operator!= (Type const *pPointer, const VgConstRefPtr< Type > &pRefPtr)
 Not equal to operator (VgRefPtr acts like a pointer). More...
 

Detailed Description

template<typename Type>
class VgEngine::VgConstRefPtr< 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.

Constructor & Destructor Documentation

template<typename Type>
VgEngine::VgConstRefPtr< Type >::VgConstRefPtr ( )
inline

Constructor.

template<typename Type>
VgEngine::VgConstRefPtr< Type >::VgConstRefPtr ( Type const *  pPointer)
inline

Constructor.

template<typename Type>
VgEngine::VgConstRefPtr< Type >::VgConstRefPtr ( const VgConstRefPtr< Type > &  pConstRefPtr)
inline

Copy constructor.

template<typename Type>
template<class OtherType >
VgEngine::VgConstRefPtr< Type >::VgConstRefPtr ( const VgConstRefPtr< OtherType > &  pConstRefPtr)
inline

Cross-type constructor.

template<typename Type>
VgEngine::VgConstRefPtr< Type >::~VgConstRefPtr ( )
inline

Destructor.

Member Function Documentation

template<typename Type>
Type const* VgEngine::VgConstRefPtr< Type >::get ( ) const
inline

Retrieves the encapsulated pointer.

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

Tell if the pointer is valid.

template<typename Type>
VgEngine::VgConstRefPtr< Type >::operator bool ( )
inline
template<typename Type>
template<typename OtherType >
VgEngine::VgConstRefPtr< Type >::operator VgConstRefPtr< OtherType > ( )
inline
template<typename Type>
bool VgEngine::VgConstRefPtr< Type >::operator! ( ) const
inline

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

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

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

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

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

template<typename Type>
Type const& VgEngine::VgConstRefPtr< Type >::operator* ( ) const
inline

Dereference the pointer.

template<typename Type>
Type const* VgEngine::VgConstRefPtr< Type >::operator-> ( ) const
inline

Allow the access to encapsulated pointer's members.

template<typename Type>
bool VgEngine::VgConstRefPtr< Type >::operator< ( const VgConstRefPtr< Type > &  pRefPtr) const
inline

Greater than operator (VgRefPtr acts like a pointer).

template<typename Type>
VgConstRefPtr& VgEngine::VgConstRefPtr< Type >::operator= ( const VgConstRefPtr< Type > &  pConstRefPtr)
inline

Assignation operator.

template<typename Type>
template<class OtherType >
VgConstRefPtr< Type >& VgEngine::VgConstRefPtr< Type >::operator= ( const VgConstRefPtr< OtherType > &  pConstRefPtr)
inline

Cross-type assignation operator.

template<typename Type>
VgConstRefPtr& VgEngine::VgConstRefPtr< Type >::operator= ( Type const *  pPointer)
inline

Assignation operator with a pointer.

template<typename Type>
bool VgEngine::VgConstRefPtr< Type >::operator== ( const VgConstRefPtr< Type > &  pConstRefPtr) const
inline

Equal to operator (VgRefPtr acts like a pointer).

template<typename Type>
bool VgEngine::VgConstRefPtr< Type >::operator== ( Type const *  pPointer) const
inline

Equal to operator (VgRefPtr acts like a pointer).

template<typename Type>
VgConstRefPtr& VgEngine::VgConstRefPtr< Type >::set ( Type const *  pPointer)
inline

Friends And Related Function Documentation

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

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

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

Equal to operator (VgRefPtr acts like a pointer).

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

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