Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

# Keos::CSmartPtr< T, Ownership > Class Template Reference

Smart pointers using policies. More...

`#include <KeosSmartPtr.h>`

Inheritance diagram for Keos::CSmartPtr< T, Ownership >:

List of all members.

## Public Member Functions

| CSmartPtr ()
| Default constructor.
| CSmartPtr (const CSmartPtr &Copy)
| Copy constructor.
| CSmartPtr (T *pPointer)
| Constructor from a pointer.
| ~CSmartPtr ()
| Destructor.
T & | operator * () const
| Star operator.
T * | operator-> () const
| Access operator.
const CSmartPtr & | operator= (const CSmartPtr &Pointer)
| Affectation operator.
| operator T * () const
| Operator of cast in T*.

## Private Member Functions

void | Swap (CSmartPtr &Ptr)
| Swap two CSmartPtr.

## Private Attributes

T * | m_pData
| Pointer on the datum.

## Detailed Description

### template<class T, template< class > class Ownership = CRefCount>
class Keos::CSmartPtr< T, Ownership >

Smart pointers using policies.

Definition at line 35 of file KeosSmartPtr.h.

## Constructor & Destructor Documentation

template<class T, template< class > class Ownership>
Keos::CSmartPtr< T, Ownership >::CSmartPtr | ( |  | ) | `[inline]`

| Default constructor. Definition at line 98 of file KeosSmartPtr.h.

template<class T, template< class > class Ownership>
Keos::CSmartPtr< T, Ownership >::CSmartPtr | ( | const CSmartPtr< T, Ownership > & | Copy | ) | `[inline]`

| Copy constructor.

Parameters:

  | Copy | Object to be copied.

Definition at line 106 of file KeosSmartPtr.h.

template<class T, template< class > class Ownership>
Keos::CSmartPtr< T, Ownership >::CSmartPtr | ( | T * | pPointer | ) | `[inline]`

| Constructor from a pointer.

Parameters:

  | pPointer | Pointer to store.

Definition at line 115 of file KeosSmartPtr.h.

template<class T, template< class > class Ownership>
Keos::CSmartPtr< T, Ownership >::~CSmartPtr | ( |  | ) | `[inline]`

| Destructor. Definition at line 123 of file KeosSmartPtr.h. References Keos::CSmartPtr< T, Ownership >::m_pData.

## Member Function Documentation

template<class T, template< class > class Ownership>
T & Keos::CSmartPtr< T, Ownership >::operator * | ( |  | ) | const`[inline]`

| Star operator.

Returns:
  Reference on the datum.

Definition at line 138 of file KeosSmartPtr.h.

References Assert, and Keos::CSmartPtr< T, Ownership >::m_pData.

template<class T, template< class > class Ownership>
Keos::CSmartPtr< T, Ownership >::operator T * | ( |  | ) | const`[inline]`

| Operator of cast in T*.

Returns:
  Constant pointer on the datum.

Definition at line 165 of file KeosSmartPtr.h.

References Keos::CSmartPtr< T, Ownership >::m_pData.

template<class T, template< class > class Ownership>
T * Keos::CSmartPtr< T, Ownership >::operator-> | ( |  | ) | const`[inline]`

| Access operator.

Returns:
  Pointer on the datum.

Definition at line 147 of file KeosSmartPtr.h.

References Assert, and Keos::CSmartPtr< T, Ownership >::m_pData.

template<class T, template< class > class Ownership>
const CSmartPtr< T, Ownership > & Keos::CSmartPtr< T, Ownership >::operator= | ( | const CSmartPtr< T, Ownership > & | Pointer | ) | `[inline]`

| Affectation operator.

Parameters:

  | Pointer | Pointer to affect

Returns:
  Constant reference on the current object.

Definition at line 156 of file KeosSmartPtr.h.

template<class T, template< class > class Ownership>
void Keos::CSmartPtr< T, Ownership >::Swap | ( | CSmartPtr< T, Ownership > & | Ptr | ) | `[inline, private]`

| Swap two CSmartPtr.

Parameters:

  | Ptr | Pointer to swap.

Definition at line 130 of file KeosSmartPtr.h.

References Keos::CSmartPtr< T, Ownership >::m_pData.

## Member Data Documentation

template<class T, template< class > class Ownership = CRefCount>
T* Keos::CSmartPtr< T, Ownership >::m_pData`[private]`

| Pointer on the datum. Definition at line 88 of file KeosSmartPtr.h. Referenced by Keos::CSmartPtr< T, Ownership >::operator *(), Keos::CSmartPtr< T, Ownership >::operator T *(), Keos::CSmartPtr< T, Ownership >::operator->(), Keos::CSmartPtr< T, Ownership >::Swap(), and Keos::CSmartPtr< T, Ownership >::~CSmartPtr().

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

- KeosEngine/KeosSmartPtr.h