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

Protected pointer. More...

#include <base/mem/ProtectedPointer.h>

Public Member Functions

 ProtectedPointer (TYPE *_value)
 
 ProtectedPointer (const ProtectedPointer &copy) noexcept
 
template<class POLY >
 ProtectedPointer (const ProtectedPointer< POLY > &copy) noexcept
 
ProtectedPointeroperator= (const ProtectedPointer &assign) noexcept
 
template<class POLY >
ProtectedPointeroperator= (const ProtectedPointer< POLY > &assign) noexcept
 
bool operator== (const ProtectedPointer &compare) const noexcept
 
bool operator!= (const ProtectedPointer &compare) const noexcept
 
TYPE * operator-> ()
 
const TYPE * operator-> () const
 

Detailed Description

template<class TYPE>
class ProtectedPointer< TYPE >

Protected pointer.

Automation pointer which protects the pointer value from direct access. The automation pointer may only be used with valid pointers (i.e. not nullptr).

Version
1.0

Constructor & Destructor Documentation

◆ ProtectedPointer() [1/3]

template<class TYPE >
ProtectedPointer< TYPE >::ProtectedPointer ( TYPE *  _value)
inline

Initializes the automation pointer.

Parameters
valueThe object pointer to be automated.

◆ ProtectedPointer() [2/3]

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

Initialization of automation pointer from other automation pointer.

◆ ProtectedPointer() [3/3]

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

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

Member Function Documentation

◆ operator!=()

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

Returns true if the pointers are non-equal.

◆ operator->() [1/2]

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

Returns object for modifying access.

◆ operator->() [2/2]

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

Returns object for non-modifying access.

◆ operator=() [1/2]

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

Assignment of automation pointer to this automation pointer.

◆ operator=() [2/2]

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

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

◆ operator==()

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

Returns true if the pointers are equal.