Simplygon C++ API  8.3.35800.0
SimplygonSDK::CountedPointer< T > Class Template Reference

#include <SimplygonSDK.h>

Public Member Functions

 CountedPointer (const CountedPointer< T > &p)
 
 CountedPointer (T *p=NULL)
 
T * GetPointer () const
 
bool IsNull () const
 
 operator T* () const
 
T & operator* () const
 
T * operator-> () const
 
CountedPointer< T > & operator= (const CountedPointer< T > &p)
 
 ~CountedPointer ()
 

Detailed Description

template<class T>
class SimplygonSDK::CountedPointer< T >

CountedPointer is a template class for pointers to API objects. All API interface classes have typedefs for counted pointers that points at the specific class. All such typedefs are prefixed with 'sp'. An example of this is 'spObject', which is a typedef for CountedPointer<IObject>. The CountedPointer can be used for any object that supports reference counting, and exports the AddRef and Release methods. See the IObject class for an example.

Definition at line 44 of file SimplygonSDK.h.

Constructor & Destructor Documentation

◆ CountedPointer() [1/2]

template<class T>
SimplygonSDK::CountedPointer< T >::CountedPointer ( T *  p = NULL)
inline

Constructs a CountedPointer from a standard pointer. If the source pointer points at an API object, a reference to the API object is added.

Parameters
pis a pointer to an API object, or NULL to make the CountedPointer point at nothing.

Definition at line 51 of file SimplygonSDK.h.

◆ CountedPointer() [2/2]

template<class T>
SimplygonSDK::CountedPointer< T >::CountedPointer ( const CountedPointer< T > &  p)
inline

Constructs a CountedPointer from another CountedPointer. If the source pointer points at an API object, a reference to the API object is added.

Parameters
pis a CountedPointer that points at an API object.

Definition at line 60 of file SimplygonSDK.h.

◆ ~CountedPointer()

template<class T>
SimplygonSDK::CountedPointer< T >::~CountedPointer ( )
inline

Destructs the CountedPointer, and releases one reference to the API object, if the CountedPointer does currently point at an object.

Definition at line 68 of file SimplygonSDK.h.

Member Function Documentation

◆ GetPointer()

template<class T>
T* SimplygonSDK::CountedPointer< T >::GetPointer ( ) const
inline

Method that returns a standard pointer to the object the pointer is pointing at.

Returns
a pointer to the object the pointer is pointing at

Definition at line 129 of file SimplygonSDK.h.

◆ IsNull()

template<class T>
bool SimplygonSDK::CountedPointer< T >::IsNull ( ) const
inline

Tells whether the CountedPointer points at an object, or nothing.

Returns
true if the pointer points at nothing, of false if the pointer points at an object

Definition at line 77 of file SimplygonSDK.h.

◆ operator T*()

template<class T>
SimplygonSDK::CountedPointer< T >::operator T* ( ) const
inline

Operator that returns a standard pointer to the object the pointer is pointing at.

Returns
a pointer to the object the pointer is pointing at

Definition at line 120 of file SimplygonSDK.h.

◆ operator*()

template<class T>
T& SimplygonSDK::CountedPointer< T >::operator* ( ) const
inline

Operator that returns the reference of the object the pointer is pointing at. Note! Do not use this operator if the pointer is not pointing at an object.

Returns
a referece to the object the pointer is pointing at

Definition at line 102 of file SimplygonSDK.h.

◆ operator->()

template<class T>
T* SimplygonSDK::CountedPointer< T >::operator-> ( ) const
inline

Operator that returns a standard pointer to the object the pointer is pointing at.

Returns
a pointer to the object the pointer is pointing at

Definition at line 111 of file SimplygonSDK.h.

◆ operator=()

template<class T>
CountedPointer<T>& SimplygonSDK::CountedPointer< T >::operator= ( const CountedPointer< T > &  p)
inline

Sets the pointer to point at the same object as another CountedPointer

Parameters
pis the source CountedPointer object
Returns
a referece to this object

Definition at line 87 of file SimplygonSDK.h.


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