Yate

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

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 >:

## 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

  value | Original RefPointer

References RefPointer< Obj >::assign().

RefPointer | ( | Obj * | object | ) |
| inline

Constructs an initialized smart pointer, references the object

Parameters

  object | Pointer 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` | ) |
| inline protected

Set a new stored pointer

Parameters

  object | Pointer 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
| inline protected

Retrieve the stored pointer

Returns
  A typed pointer

References RefPointerBase::m_pointer.

Referenced by RefPointer< Obj >::assign(), RefPointer< Obj >::operator Obj *(), RefPointer< Obj >::operator*(), RefPointer< Obj >::operator->(), and RefPointer< Obj >::operator=().

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

- yateclass.h