Yate
Public Member Functions | Protected Member Functions | List of all members
RefPointer< Obj > Class Template Reference

Templated smart pointer class. More...

#include <yateclass.h>

Inheritance diagram for RefPointer< Obj >:
RefPointerBase

Public Member Functions

 RefPointer ()
 
 RefPointer (const RefPointer< Obj > &value)
 
 RefPointer (Obj *object)
 
 ~RefPointer ()
 
RefPointer< Obj > & operator= (const RefPointer< Obj > &value)
 
RefPointer< Obj > & operator= (Obj *object)
 
 operator Obj * () const
 
Obj * operator-> () const
 
Obj & operator* () const
 

Protected Member Functions

Obj * pointer () const
 
void assign (Obj *object=0)
 
- Protected Member Functions inherited from RefPointerBase
 RefPointerBase ()
 
void assign (RefObject *oldptr, RefObject *newptr, void *pointer)
 

Additional Inherited Members

- Protected Attributes inherited from RefPointerBase
void * m_pointer
 

Detailed Description

template<class Obj = RefObject>
class TelEngine::RefPointer< Obj >

Templated smart pointer class.

Constructor & Destructor Documentation

RefPointer ( )
inline

Default constructor - creates a null smart pointer

RefPointer ( const RefPointer< Obj > &  value)
inline

Copy constructor, references the object

Parameters
valueOriginal RefPointer

References RefPointer< Obj >::assign().

RefPointer ( Obj *  object)
inline

Constructs an initialized smart pointer, references the object

Parameters
objectPointer to object

References RefPointer< Obj >::assign().

~RefPointer ( )
inline

Destructs the pointer and dereferences the object

References RefPointer< Obj >::assign().

Member Function Documentation

void assign ( Obj *  object = 0)
inlineprotected

Set a new stored pointer

Parameters
objectPointer to the new stored object

References RefPointerBase::assign(), and RefPointer< Obj >::pointer().

Referenced by RefPointer< Obj >::operator=(), RefPointer< Obj >::RefPointer(), and RefPointer< Obj >::~RefPointer().

operator Obj * ( ) const
inline

Conversion to regular pointer operator

Returns
The stored pointer

References RefPointer< Obj >::pointer().

Obj& operator* ( ) const
inline

Dereferencing operator

References RefPointer< Obj >::pointer().

Obj* operator-> ( ) const
inline

Member access operator

References RefPointer< Obj >::pointer().

RefPointer<Obj>& operator= ( const RefPointer< Obj > &  value)
inline

Assignment from smart pointer

References RefPointer< Obj >::assign(), and RefPointer< Obj >::pointer().

RefPointer<Obj>& operator= ( Obj *  object)
inline

Assignment from regular pointer

References RefPointer< Obj >::assign().

Obj* pointer ( ) const
inlineprotected

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