Tizen Native API  3.0
Dali::IntrusivePtr< T > Class Template Reference

Templated intrusive pointer class. More...

Public Types

typedef void(IntrusivePtr::* BooleanType )() const
 Pointer-to-member type.

Public Member Functions

 IntrusivePtr ()
 Standard constructor to unassigned object.
 IntrusivePtr (T *p)
 Constructor to attach existing object.
template<typename U >
 IntrusivePtr (IntrusivePtr< U > const &rhs)
 Copy constructor.
 IntrusivePtr (IntrusivePtr const &rhs)
 Copy constructor.
 ~IntrusivePtr ()
 Destructor.
T * Get () const
 Gets pointer to reference counted object.
T * operator-> () const
 Pointer operator override.
T & operator* () const
 Dereference operator override.
IntrusivePtroperator= (IntrusivePtr const &rhs)
 Assignment operator.
IntrusivePtroperator= (T *rhs)
 Assignment operator.
void Reset ()
 Reset intrusive pointer.
void Reset (T *rhs)
 Reset intrusive pointer with reference counted object.
 operator BooleanType () const
 Converts an object handle to a BooleanType.
T * Detach ()
 Detaches pointer from intrusive ptr counting.

Detailed Description

template<typename T>
class Dali::IntrusivePtr< T >

Templated intrusive pointer class.

Uses the Dali:RefObject type with actual reference counting. The object is responsible for destroying itself.

Since:
3.0, DALi version 1.0.0

Member Typedef Documentation

template<typename T>
typedef void(IntrusivePtr::* Dali::IntrusivePtr< T >::BooleanType)() const

Pointer-to-member type.

Objects can be implicitly converted to this for validity checks.


Constructor & Destructor Documentation

template<typename T>
Dali::IntrusivePtr< T >::IntrusivePtr ( )

Standard constructor to unassigned object.

Since:
3.0, DALi version 1.0.0
template<typename T>
Dali::IntrusivePtr< T >::IntrusivePtr ( T *  p)

Constructor to attach existing object.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]pPointer to object
template<typename T>
template<typename U >
Dali::IntrusivePtr< T >::IntrusivePtr ( IntrusivePtr< U > const &  rhs)

Copy constructor.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]rhsConst reference to an IntrusivePtr
Template Parameters:
UReference counter object type
template<typename T>
Dali::IntrusivePtr< T >::IntrusivePtr ( IntrusivePtr< T > const &  rhs)

Copy constructor.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]rhsConst reference to an IntrusivePtr
template<typename T>
Dali::IntrusivePtr< T >::~IntrusivePtr ( )

Destructor.

Object will self-destruct if reference count is zero.

Since:
3.0, DALi version 1.0.0

Member Function Documentation

template<typename T>
T* Dali::IntrusivePtr< T >::Detach ( )

Detaches pointer from intrusive ptr counting.

Use with care.

Since:
3.0, DALi version 1.0.0
Returns:
Pointer to reference counted object
template<typename T>
T* Dali::IntrusivePtr< T >::Get ( ) const

Gets pointer to reference counted object.

Since:
3.0, DALi version 1.0.0
Returns:
Pointer to reference counted object
template<typename T>
Dali::IntrusivePtr< T >::operator BooleanType ( ) const

Converts an object handle to a BooleanType.

This is useful for checking whether the handle is NULL.

Since:
3.0, DALi version 1.0.0
template<typename T>
T& Dali::IntrusivePtr< T >::operator* ( ) const

Dereference operator override.

Since:
3.0, DALi version 1.0.0
Returns:
Reference to reference counted object
template<typename T>
T* Dali::IntrusivePtr< T >::operator-> ( ) const

Pointer operator override.

Since:
3.0, DALi version 1.0.0
Returns:
Pointer to reference counted object
template<typename T>
IntrusivePtr& Dali::IntrusivePtr< T >::operator= ( IntrusivePtr< T > const &  rhs)

Assignment operator.

Since:
3.0, DALi version 1.0.0
Parameters:
rhsConst reference to intrusive pointer
Returns:
Reference to reference counted object
template<typename T>
IntrusivePtr& Dali::IntrusivePtr< T >::operator= ( T *  rhs)

Assignment operator.

Since:
3.0, DALi version 1.0.0
Parameters:
rhsPointer to object to wrap
Returns:
A Reference to this object
template<typename T>
void Dali::IntrusivePtr< T >::Reset ( )

Reset intrusive pointer.

Since:
3.0, DALi version 1.0.0
template<typename T>
void Dali::IntrusivePtr< T >::Reset ( T *  rhs)

Reset intrusive pointer with reference counted object.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]rhsPointer to object