# Frost::s_ptr< T > Class Template Reference

Smart pointer. More...

`#include <frost_utils_ptr.h>`

List of all members.

## Public Types

typedef void(s_ptr::* | MemberFn )()

## Public Member Functions

| s_ptr ()
| Default constructor.
| s_ptr (T *pValue)
| Constructor.
| s_ptr (const s_nullptr &pNull)
| Conversion from nullptr.
| s_ptr (const s_ptr &mPointer)
| Copy constructor.
template<class N >
| s_ptr (const s_ptr< N > &mPointer)
| Conversion constructor.
const T * | Get () const
| Returns the contained pointer.
T * | Get ()
| Returns the contained pointer.
s_bool | IsValid () const
| Checks if this pointer is usable.
void | SetNull ()
| Sets this pointer to NULL.
void | Delete ()
| Deletes the content of the pointer;.
PtrTraits< T >::CRef | operator* () const
| Returns a reference to the contained value.
PtrTraits< T >::Ref | operator* ()
| Returns a reference to the contained value.
const T * | operator-> () const
| Dereferences the pointer.
T * | operator-> ()
| Dereferences the pointer.
s_ptr< T > & | operator= (const s_nullptr &pPtr)
| nullptr assignation operator.
template<class N >
s_ptr< T > & | operator= (const s_ptr< N > &pValue)
| Assign a new pointer to this smart pointer.
s_ptr< T > & | operator= (T *pValue)
| Assign a new pointer to this smart pointer.
template<class N >
s_bool | operator== (const s_ptr< N > &pValue) const
| Checks if this pointer equals another.
template<class N >
s_bool | operator== (N *pValue) const
| Checks if this pointer equals another.
s_bool | operator== (s_nullptr pValue) const
| Checks if this pointer is null.
template<class N >
s_bool | operator!= (const s_ptr< N > &pValue) const
| Checks if this pointer is different from another.
template<class N >
s_bool | operator!= (N *pValue) const
| Checks if this pointer is different from another.
s_bool | operator!= (s_nullptr pValue) const
| Checks if this pointer is not null.
template<class N >
s_bool | operator< (const s_ptr< N > &pValue) const
| Checks if this pointer's value is lower than the other.
template<class N >
s_bool | operator< (N *pValue) const
| Checks if this pointer's value is lower than the other.
template<class N >
s_bool | operator<= (const s_ptr< N > &pValue) const
| Checks if this pointer's value is lower or equal than the other.
template<class N >
s_bool | operator<= (N *pValue) const
| Checks if this pointer's value is lower or equal than the other.
template<class N >
s_bool | operator> (const s_ptr< N > &pValue) const
| Checks if this pointer's value is greater than the other.
template<class N >
s_bool | operator> (N *pValue) const
| Checks if this pointer's value is greater than the other.
template<class N >
s_bool | operator>= (const s_ptr< N > &pValue) const
| Checks if this pointer's value is greater or equal than the other.
template<class N >
s_bool | operator>= (N *pValue) const
| Checks if this pointer's value is greater or equal than the other.
bool | operator! () const
| Allows : "if (!pPointer)".
| operator MemberFn () const
| Allows : "if (pPointer)".
template<class N >
| operator s_ptr< N > ()
| Allows limited implicit inheritance conversion.
template<class N >
| operator s_ptr< const N > () const
| Allows limited implicit inheritance conversion.
s_ctnr< s_ptr< T > > | operator, (const s_ptr< T > &pValue) const

## Static Public Member Functions

template<class N >
static s_ptr< T > | StaticCast (const s_ptr< N > &pValue)
| Casts the provided pointer to this one's type.
template<class N >
static s_ptr< T > | StaticCast (N *pValue)
| Casts the provided pointer to this one's type.
template<class N >
static s_ptr< T > | DynamicCast (const s_ptr< N > &pValue)
| Tries to dynamic cast the provided pointer to this one's type.
template<class N >
static s_ptr< T > | DynamicCast (N *pValue)
| Tries to dynamic cast the provided pointer to this one's type.

## Private Attributes

T * | pValue_

## Friends

class | s_ptr

## Detailed Description

### template<class T>
class Frost::s_ptr< T >

Smart pointer.

This is very basic pointer.
Its only advantage is that it is initialized to nullptr automatically.
There is no automatic deletion.

Definition at line 25 of file frost_utils_ptr.h.

## Member Typedef Documentation

template<class T>

typedef void(s_ptr::* Frost::s_ptr< T >::MemberFn)()

Definition at line 303 of file frost_utils_ptr.h.

## Constructor & Destructor Documentation

template<class T>

Frost::s_ptr< T >::s_ptr | ( |  | ) | `[inline]`

Default constructor.

Note:
  Initializes the pointer to NULL.

Definition at line 34 of file frost_utils_ptr.h.

template<class T>

Frost::s_ptr< T >::s_ptr | ( | T * | pValue | ) | `[inline]`

Constructor.

Definition at line 40 of file frost_utils_ptr.h.

template<class T>

Frost::s_ptr< T >::s_ptr | ( | const s_nullptr & | pNull | ) | `[inline]`

Conversion from nullptr.

Definition at line 46 of file frost_utils_ptr.h.

template<class T>

Frost::s_ptr< T >::s_ptr | ( | const s_ptr< T > & | mPointer | ) | `[inline]`

Copy constructor.

Definition at line 52 of file frost_utils_ptr.h.

template<class T>
template<class N >

Frost::s_ptr< T >::s_ptr | ( | const s_ptr< N > & | mPointer | ) | `[inline, explicit]`

Conversion constructor.

Definition at line 59 of file frost_utils_ptr.h.

## Member Function Documentation

template<class T>

void Frost::s_ptr< T >::Delete | ( |  | ) | `[inline]`

Deletes the content of the pointer;.

Definition at line 95 of file frost_utils_ptr.h.

template<class T>
template<class N >

static s_ptr<T> Frost::s_ptr< T >::DynamicCast | ( | N * | pValue | ) | `[inline, static]`

Tries to dynamic cast the provided pointer to this one's type.

Parameters:

  | pValue | The pointer to cast

Returns:
  The new casted pointer

Note:
  Dynamic cast can fail, and in this case, will result in a NULL pointer.

Definition at line 374 of file frost_utils_ptr.h.

template<class T>
template<class N >

static s_ptr<T> Frost::s_ptr< T >::DynamicCast | ( | const s_ptr< N > & | pValue | ) | `[inline, static]`

Tries to dynamic cast the provided pointer to this one's type.

Parameters:

  | pValue | The pointer to cast

Returns:
  The new casted pointer

Note:
  Dynamic cast can fail, and in this case, will result in a NULL pointer.

Definition at line 362 of file frost_utils_ptr.h.

template<class T>

T* Frost::s_ptr< T >::Get | ( |  | ) | `[inline]`

Returns the contained pointer.

Returns:
  The contained pointer

Definition at line 75 of file frost_utils_ptr.h.

template<class T>

const T* Frost::s_ptr< T >::Get | ( |  | ) | const`[inline]`

Returns the contained pointer.

Returns:
  The contained pointer

Definition at line 67 of file frost_utils_ptr.h.

template<class T>

s_bool Frost::s_ptr< T >::IsValid | ( |  | ) | const`[inline]`

Checks if this pointer is usable.

Returns:
  'true' is this pointer is usable

Definition at line 83 of file frost_utils_ptr.h.

template<class T>

Frost::s_ptr< T >::operator MemberFn | ( |  | ) | const`[inline]`

Allows : "if (pPointer)".

Definition at line 305 of file frost_utils_ptr.h.

template<class T>
template<class N >

Frost::s_ptr< T >::operator s_ptr< const N > | ( |  | ) | const`[inline]`

Allows limited implicit inheritance conversion.

Definition at line 322 of file frost_utils_ptr.h.

template<class T>
template<class N >

Frost::s_ptr< T >::operator s_ptr< N > | ( |  | ) | `[inline]`

Allows limited implicit inheritance conversion.

Definition at line 315 of file frost_utils_ptr.h.

template<class T>

bool Frost::s_ptr< T >::operator! | ( |  | ) | const`[inline]`

Allows : "if (!pPointer)".

Definition at line 298 of file frost_utils_ptr.h.

template<class T>

s_bool Frost::s_ptr< T >::operator!= | ( | s_nullptr | pValue | ) | const`[inline]`

Checks if this pointer is not null.

Parameters:

  | pValue | The null pointer

Returns:
  'true' if this pointer is not null

Definition at line 212 of file frost_utils_ptr.h.

template<class T>
template<class N >

s_bool Frost::s_ptr< T >::operator!= | ( | N * | pValue | ) | const`[inline]`

Checks if this pointer is different from another.

Parameters:

  | pValue | The pointer to test

Returns:
  'true' if this pointer is different from another

Definition at line 203 of file frost_utils_ptr.h.

template<class T>
template<class N >

s_bool Frost::s_ptr< T >::operator!= | ( | const s_ptr< N > & | pValue | ) | const`[inline]`

Checks if this pointer is different from another.

Parameters:

  | pValue | The pointer to test

Returns:
  'true' if this pointer is different from another

Definition at line 193 of file frost_utils_ptr.h.

template<class T>

PtrTraits<T>::Ref Frost::s_ptr< T >::operator* | ( |  | ) | `[inline]`

Returns a reference to the contained value.

Returns:
  A reference to the contained value

Definition at line 112 of file frost_utils_ptr.h.

template<class T>

PtrTraits<T>::CRef Frost::s_ptr< T >::operator* | ( |  | ) | const`[inline]`

Returns a reference to the contained value.

Returns:
  A reference to the contained value

Definition at line 104 of file frost_utils_ptr.h.

template<class T>

s_ctnr< s_ptr<T> > Frost::s_ptr< T >::operator, | ( | const s_ptr< T > & | pValue | ) | const`[inline]`

Definition at line 327 of file frost_utils_ptr.h.

template<class T>

T* Frost::s_ptr< T >::operator-> | ( |  | ) | `[inline]`

Dereferences the pointer.

Returns:
  The contained pointer

Definition at line 128 of file frost_utils_ptr.h.

template<class T>

const T* Frost::s_ptr< T >::operator-> | ( |  | ) | const`[inline]`

Dereferences the pointer.

Returns:
  The contained pointer

Definition at line 120 of file frost_utils_ptr.h.

template<class T>
template<class N >

s_bool Frost::s_ptr< T >::operator< | ( | N * | pValue | ) | const`[inline]`

Checks if this pointer's value is lower than the other.

Parameters:

  | pValue | The pointer to test

Returns:
  'true' if this pointer's value is lower than the other

Definition at line 232 of file frost_utils_ptr.h.

template<class T>
template<class N >

s_bool Frost::s_ptr< T >::operator< | ( | const s_ptr< N > & | pValue | ) | const`[inline]`

Checks if this pointer's value is lower than the other.

Parameters:

  | pValue | The pointer to test

Returns:
  'true' if this pointer's value is lower than the other

Definition at line 222 of file frost_utils_ptr.h.

template<class T>
template<class N >

s_bool Frost::s_ptr< T >::operator<= | ( | N * | pValue | ) | const`[inline]`

Checks if this pointer's value is lower or equal than the other.

Parameters:

  | pValue | The pointer to test

Returns:
  'true' if this pointer's value is lower or equal than the other

Definition at line 252 of file frost_utils_ptr.h.

template<class T>
template<class N >

s_bool Frost::s_ptr< T >::operator<= | ( | const s_ptr< N > & | pValue | ) | const`[inline]`

Checks if this pointer's value is lower or equal than the other.

Parameters:

  | pValue | The pointer to test

Returns:
  'true' if this pointer's value is lower or equal than the other

Definition at line 242 of file frost_utils_ptr.h.

template<class T>

s_ptr<T>& Frost::s_ptr< T >::operator= | ( | T * | pValue | ) | `[inline]`

Assign a new pointer to this smart pointer.

Parameters:

  | pValue | The new pointer

Definition at line 155 of file frost_utils_ptr.h.

template<class T>
template<class N >

s_ptr<T>& Frost::s_ptr< T >::operator= | ( | const s_ptr< N > & | pValue | ) | `[inline]`

Assign a new pointer to this smart pointer.

Parameters:

  | pValue | The new pointer

Definition at line 146 of file frost_utils_ptr.h.

template<class T>

s_ptr<T>& Frost::s_ptr< T >::operator= | ( | const s_nullptr & | pPtr | ) | `[inline]`

nullptr assignation operator.

Parameters:

  | pPtr | The value to copy

Definition at line 136 of file frost_utils_ptr.h.

template<class T>

s_bool Frost::s_ptr< T >::operator== | ( | s_nullptr | pValue | ) | const`[inline]`

Checks if this pointer is null.

Parameters:

  | pValue | The null pointer

Returns:
  'true' if this pointer is null

Definition at line 183 of file frost_utils_ptr.h.

template<class T>
template<class N >

s_bool Frost::s_ptr< T >::operator== | ( | N * | pValue | ) | const`[inline]`

Checks if this pointer equals another.

Parameters:

  | pValue | The pointer to test

Definition at line 174 of file frost_utils_ptr.h.

template<class T>
template<class N >

s_bool Frost::s_ptr< T >::operator== | ( | const s_ptr< N > & | pValue | ) | const`[inline]`

Checks if this pointer equals another.

Parameters:

  | pValue | The pointer to test

Definition at line 165 of file frost_utils_ptr.h.

template<class T>
template<class N >

s_bool Frost::s_ptr< T >::operator> | ( | N * | pValue | ) | const`[inline]`

Checks if this pointer's value is greater than the other.

Parameters:

  | pValue | The pointer to test

Returns:
  'true' if this pointer's value is greater than the other

Definition at line 272 of file frost_utils_ptr.h.

template<class T>
template<class N >

s_bool Frost::s_ptr< T >::operator> | ( | const s_ptr< N > & | pValue | ) | const`[inline]`

Checks if this pointer's value is greater than the other.

Parameters:

  | pValue | The pointer to test

Returns:
  'true' if this pointer's value is greater than the other

Definition at line 262 of file frost_utils_ptr.h.

template<class T>
template<class N >

s_bool Frost::s_ptr< T >::operator>= | ( | N * | pValue | ) | const`[inline]`

Checks if this pointer's value is greater or equal than the other.

Parameters:

  | pValue | The pointer to test

Returns:
  'true' if this pointer's value is greater or equal than the other

Definition at line 292 of file frost_utils_ptr.h.

template<class T>
template<class N >

s_bool Frost::s_ptr< T >::operator>= | ( | const s_ptr< N > & | pValue | ) | const`[inline]`

Checks if this pointer's value is greater or equal than the other.

Parameters:

  | pValue | The pointer to test

Returns:
  'true' if this pointer's value is greater or equal than the other

Definition at line 282 of file frost_utils_ptr.h.

template<class T>

void Frost::s_ptr< T >::SetNull | ( |  | ) | `[inline]`

Sets this pointer to NULL.

Definition at line 89 of file frost_utils_ptr.h.

template<class T>
template<class N >

static s_ptr<T> Frost::s_ptr< T >::StaticCast | ( | N * | pValue | ) | `[inline, static]`

Casts the provided pointer to this one's type.

Parameters:

  | pValue | The pointer to cast

Returns:
  The new casted pointer

Definition at line 350 of file frost_utils_ptr.h.

template<class T>
template<class N >

static s_ptr<T> Frost::s_ptr< T >::StaticCast | ( | const s_ptr< N > & | pValue | ) | `[inline, static]`

Casts the provided pointer to this one's type.

Parameters:

  | pValue | The pointer to cast

Returns:
  The new casted pointer

Definition at line 340 of file frost_utils_ptr.h.

## Friends And Related Function Documentation

template<class T>

friend class s_ptr`[friend]`

Definition at line 29 of file frost_utils_ptr.h.

## Member Data Documentation

template<class T>

T* Frost::s_ptr< T >::pValue_`[private]`

Definition at line 381 of file frost_utils_ptr.h.

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

- D:/Programmation/Sources/Tensor2/Utils/include/frost_utils_ptr.h