Yate: RefPointer< Obj > Class Template Reference

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

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

Templated smart pointer class.

## Constructor & Destructor Documentation

## ◆ RefPointer() [1/3]

template<class Obj = RefObject>

RefPointer | ( |  | ) |
| inline

Default constructor - creates a null smart pointer

## ◆ RefPointer() [2/3]

template<class Obj = RefObject>

RefPointer | ( | const RefPointer< Obj > & | value | ) |
| inline

Copy constructor, references the object

Parameters

  value | Original RefPointer

## ◆ RefPointer() [3/3]

template<class Obj = RefObject>

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

Constructs an initialized smart pointer, references the object

Parameters

  object | Pointer to object

## ◆ ~RefPointer()

template<class Obj = RefObject>

~RefPointer | ( |  | ) |
| inline

Destructs the pointer and dereferences the object

## Member Function Documentation

## ◆ assign()

template<class Obj = RefObject>

void assign | ( | Obj * | object = 0 | ) |
| inlineprotected

Set a new stored pointer

Parameters

  object | Pointer to the new stored object

References RefPointerBase::assign().

## ◆ operator Obj *()

template<class Obj = RefObject>

operator Obj * | ( |  | ) | const
| inline

Conversion to regular pointer operator

Returns
  The stored pointer

## ◆ operator*()

template<class Obj = RefObject>

Obj & operator* | ( |  | ) | const
| inline

Dereferencing operator

## ◆ operator->()

template<class Obj = RefObject>

Obj * operator-> | ( |  | ) | const
| inline

Member access operator

## ◆ operator=() [1/2]

template<class Obj = RefObject>

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

Assignment from smart pointer

References RefPointer< Obj >::pointer().

## ◆ operator=() [2/2]

template<class Obj = RefObject>

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

Assignment from regular pointer

## ◆ pointer()

template<class Obj = RefObject>

Obj * pointer | ( |  | ) | const
| inlineprotected

Retrieve the stored pointer

Returns
  A typed pointer

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

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

- yateclass.h