Base Framework
Public Member Functions | List of all members
Pointer< TYPE > Class Template Reference

Simple pointer. More...

#include <base/mem/Pointer.h>

Public Member Functions

 Pointer () noexcept
 
 Pointer (TYPE *_value) noexcept
 
 Pointer (const Pointer &copy) noexcept
 
template<class POLY >
 Pointer (const Pointer< POLY > &copy) noexcept
 
Pointeroperator= (const Pointer &assign) noexcept
 
template<class POLY >
Pointeroperator= (const Pointer< POLY > &assign) noexcept
 
TYPE *const getValue () noexcept
 
const TYPE *const getValue () const noexcept
 
void invalidate () noexcept
 
bool isValid () const noexcept
 
template<class POLY >
bool isType () const noexcept
 
template<class POLY >
Pointer< POLY > cast () const
 
bool operator== (const Pointer &compare) const noexcept
 
bool operator!= (const Pointer &compare) const noexcept
 
TYPE *const operator-> ()
 
const TYPE *const operator-> () const noexcept
 
 operator bool () const noexcept
 

Detailed Description

template<class TYPE>
class Pointer< TYPE >

Simple pointer.

Simple automation pointer which guarantees proper initialization.

Version
1.0

Constructor & Destructor Documentation

◆ Pointer() [1/4]

template<class TYPE >
Pointer< TYPE >::Pointer ( )
inlinenoexcept

Initializes the automation pointer as invalid (i.e. nullptr).

◆ Pointer() [2/4]

template<class TYPE >
Pointer< TYPE >::Pointer ( TYPE *  _value)
inlinenoexcept

Initializes the automation pointer.

Parameters
valueThe object pointer to be automated.

◆ Pointer() [3/4]

template<class TYPE >
Pointer< TYPE >::Pointer ( const Pointer< TYPE > &  copy)
inlinenoexcept

Initialization of automation pointer from other automation pointer.

◆ Pointer() [4/4]

template<class TYPE >
template<class POLY >
Pointer< TYPE >::Pointer ( const Pointer< POLY > &  copy)
inlinenoexcept

Initialization of automation pointer from other automation pointer using compile time polymorphism.

Member Function Documentation

◆ cast()

template<class TYPE >
template<class POLY >
Pointer<POLY> Pointer< TYPE >::cast ( ) const
inline

Dynamic cast to the specified type.

◆ getValue() [1/2]

template<class TYPE >
const TYPE* const Pointer< TYPE >::getValue ( ) const
inlinenoexcept

Returns the pointer value for non-modifying access.

◆ getValue() [2/2]

template<class TYPE >
TYPE* const Pointer< TYPE >::getValue ( )
inlinenoexcept

Returns the pointer value for modifying access.

◆ invalidate()

template<class TYPE >
void Pointer< TYPE >::invalidate ( )
inlinenoexcept

Invalidates the pointer.

◆ isType()

template<class TYPE >
template<class POLY >
bool Pointer< TYPE >::isType ( ) const
inlinenoexcept

Returns true if the object may be cast to the specified type.

◆ isValid()

template<class TYPE >
bool Pointer< TYPE >::isValid ( ) const
inlinenoexcept

Returns true if the pointer is valid (not nullptr).

◆ operator bool()

template<class TYPE >
Pointer< TYPE >::operator bool ( ) const
inlinenoexcept

Returns true if the pointer is valid (not nullptr).

◆ operator!=()

template<class TYPE >
bool Pointer< TYPE >::operator!= ( const Pointer< TYPE > &  compare) const
inlinenoexcept

Returns true if the pointers are non-equal.

◆ operator->() [1/2]

template<class TYPE >
TYPE* const Pointer< TYPE >::operator-> ( )
inline

Dereference the automation pointer for modifying access.

◆ operator->() [2/2]

template<class TYPE >
const TYPE* const Pointer< TYPE >::operator-> ( ) const
inlinenoexcept

Dereferences the automation pointer for non-modifying access.

◆ operator=() [1/2]

template<class TYPE >
Pointer& Pointer< TYPE >::operator= ( const Pointer< TYPE > &  assign)
inlinenoexcept

Assignment of automation pointer to this automation pointer.

◆ operator=() [2/2]

template<class TYPE >
template<class POLY >
Pointer& Pointer< TYPE >::operator= ( const Pointer< POLY > &  assign)
inlinenoexcept

Assignment of automation pointer to this automation pointer using compile time polymorphism.

◆ operator==()

template<class TYPE >
bool Pointer< TYPE >::operator== ( const Pointer< TYPE > &  compare) const
inlinenoexcept

Returns true if the pointers are equal.