Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::cNewPtr< TYPE > Class Template Reference

#include <cNewPtr.h>

Inheritance diagram for Gray::cNewPtr< TYPE >:
Gray::cPtrFacade< TYPE > Gray::cNewPtr2< TYPE >

Public Member Functions

 cNewPtr () noexcept
 
 cNewPtr (TYPE *pObj) noexcept
 
 ~cNewPtr ()
 
void AllocArray (size_t nSize=1) noexcept
 
void AllocArray (size_t nSize, const TYPE *p) noexcept
 
void ReleasePtr () noexcept
 
THIS_toperator= (TYPE *p2) noexcept
 
THIS_toperator= (THIS_t &ref) noexcept
 
TYPEoperator* () const
 
TYPEoperator-> () const
 
bool operator!= (const TYPE *p2) const noexcept
 
bool operator== (const TYPE *p2) const noexcept
 
- Public Member Functions inherited from Gray::cPtrFacade< TYPE >
 cPtrFacade (TYPE *p=nullptr) noexcept
 
 cPtrFacade (THIS_t &&ref) noexcept
 
bool isValidPtr () const noexcept
 
TYPE ** get_PPtr ()
 
TYPEget_Ptr () const noexcept
 
void put_Ptr (TYPE *p) noexcept
 
void ReleasePtr () noexcept
 
void AttachPtr (TYPE *p) noexcept
 
TYPEDetachPtr () noexcept
 
THIS_toperator= (TYPE *p) noexcept
 
THIS_toperator= (THIS_t &&ref) noexcept
 
 operator TYPE * () const noexcept
 
TYPEget_Ref () const
 
TYPEoperator* () const
 
TYPEoperator-> () const
 
bool operator! () const noexcept
 Comparison ops. More...
 
bool operator!= (TYPE *p2) const noexcept
 
bool operator== (TYPE *p2) const noexcept
 

Protected Member Functions

void AsignPtr (TYPE *p2) noexcept
 
void AsignRef (THIS_t &ref) noexcept
 
void FreeLast () noexcept
 

Additional Inherited Members

- Protected Attributes inherited from Gray::cPtrFacade< TYPE >
TYPEm_p
 Pointer to some object of TYPE. More...
 

Detailed Description

template<class TYPE>
class Gray::cNewPtr< TYPE >

These are sort of dumb "smart pointers" but assume a single reference. A single reference to a dynamically allocated (heap) class not based on cRefBase. Free on destruct. Works like STL "auto_ptr<TYPE>" or boost::unique_ptr<>, std::unique_ptr<>

Constructor & Destructor Documentation

◆ cNewPtr() [1/2]

template<class TYPE >
Gray::cNewPtr< TYPE >::cNewPtr ( )
inlinenoexcept

◆ cNewPtr() [2/2]

template<class TYPE >
Gray::cNewPtr< TYPE >::cNewPtr ( TYPE pObj)
inlineexplicitnoexcept

◆ ~cNewPtr()

template<class TYPE >
Gray::cNewPtr< TYPE >::~cNewPtr ( )
inline

Member Function Documentation

◆ AllocArray() [1/2]

template<class TYPE >
void Gray::cNewPtr< TYPE >::AllocArray ( size_t  nSize,
const TYPE p 
)
inlinenoexcept

◆ AllocArray() [2/2]

template<class TYPE >
void Gray::cNewPtr< TYPE >::AllocArray ( size_t  nSize = 1)
inlinenoexcept

◆ AsignPtr()

template<class TYPE >
void Gray::cNewPtr< TYPE >::AsignPtr ( TYPE p2)
inlineprotectednoexcept

◆ AsignRef()

template<class TYPE >
void Gray::cNewPtr< TYPE >::AsignRef ( THIS_t ref)
inlineprotectednoexcept

◆ FreeLast()

template<class TYPE >
void Gray::cNewPtr< TYPE >::FreeLast ( )
inlineprotectednoexcept

◆ operator!=()

template<class TYPE >
bool Gray::cNewPtr< TYPE >::operator!= ( const TYPE p2) const
inlinenoexcept

◆ operator*()

template<class TYPE >
TYPE& Gray::cNewPtr< TYPE >::operator* ( ) const
inline

◆ operator->()

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

◆ operator=() [1/2]

template<class TYPE >
THIS_t& Gray::cNewPtr< TYPE >::operator= ( THIS_t ref)
inlinenoexcept

◆ operator=() [2/2]

template<class TYPE >
THIS_t& Gray::cNewPtr< TYPE >::operator= ( TYPE p2)
inlinenoexcept

◆ operator==()

template<class TYPE >
bool Gray::cNewPtr< TYPE >::operator== ( const TYPE p2) const
inlinenoexcept

◆ ReleasePtr()

template<class TYPE >
void Gray::cNewPtr< TYPE >::ReleasePtr ( )
inlinenoexcept

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