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

#include <cSingletonPtr.h>

Inheritance diagram for Gray::cSingletonPtr< TYPE >:
Gray::cRefPtr< TYPE > Gray::cPtrFacade< TYPE >

Public Member Functions

 cSingletonPtr (bool bInit=true)
 
void InitPtr ()
 
void ReleasePtr ()
 
bool isValidPtr () const
 
TYPEoperator-> () const
 
TYPEget_Ptr () const
 

Additional Inherited Members

- Protected Member Functions inherited from Gray::cRefPtr< TYPE >
void IncRefFirst ()
 
 cRefPtr () noexcept
 
 cRefPtr (const TYPE *p2)
 
 cRefPtr (const THIS_t &ref)
 
 cRefPtr (const TYPE *p2, TIMESYSD_t dwWaitMS)
 
 ~cRefPtr ()
 
bool isValidPtr () const
 
bool isCorruptPtr () const
 
void put_Ptr (TYPE *p)
 
void ReleasePtr ()
 
int get_RefCount () const
 
THIS_toperator= (const TYPE *p2)
 
THIS_toperator= (const THIS_t &ref)
 
 operator cRefPtr< _TYPE_2 > () const
 
- Protected 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 Attributes inherited from Gray::cPtrFacade< TYPE >
TYPEm_p
 Pointer to some object of TYPE. More...
 

Detailed Description

template<class TYPE>
class Gray::cSingletonPtr< TYPE >

A reference to a cSingletonSmart<> based TYPE or a type that has both cSingleton and cRefBase.

Constructor & Destructor Documentation

◆ cSingletonPtr()

template<class TYPE >
Gray::cSingletonPtr< TYPE >::cSingletonPtr ( bool  bInit = true)
inline
  • bInit = Allocate a reference automatically by default. Attach to cSingletonSmart, false = defer init until later.

Member Function Documentation

◆ get_Ptr()

template<class TYPE >
TYPE* Gray::cSingletonPtr< TYPE >::get_Ptr ( ) const
inline

For use with SMARTS_CAST(x) and SMART_CAST(x) or just use TYPE::get_Single() ?

◆ InitPtr()

template<class TYPE >
void Gray::cSingletonPtr< TYPE >::InitPtr ( )
inline

If i created an empty cSingletonPtr(false) (as part of some class) this is how I populate it on that classes constructor. Attach to cSingletonSmart

◆ isValidPtr()

template<class TYPE >
bool Gray::cSingletonPtr< TYPE >::isValidPtr ( ) const
inline

◆ operator->()

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

◆ ReleasePtr()

template<class TYPE >
void Gray::cSingletonPtr< TYPE >::ReleasePtr ( )
inline

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