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

#include <cThreadLocalSys.h>

Inheritance diagram for Gray::cThreadLocalSysNew< TYPE >:
Gray::cThreadLocalSysT< TYPE * > Gray::IThreadLocal Gray::cThreadLocalSys

Public Member Functions

 cThreadLocalSysNew () noexcept
 
TYPEGetDataNew ()
 
virtual void * GetDataNewV ()
 
void FreeDataManually ()
 
- Public Member Functions inherited from Gray::cThreadLocalSysT< TYPE * >
 cThreadLocalSysT (PFLS_CALLBACK_FUNCTION pDestruct=nullptr) noexcept
 
TYPEGetData () const noexcept
 
bool PutData (TYPE * nData) noexcept
 
- Public Member Functions inherited from Gray::cThreadLocalSys
 cThreadLocalSys (PFLS_CALLBACK_FUNCTION pDestruct=nullptr) noexcept
 
 ~cThreadLocalSys ()
 
bool isInit () const noexcept
 
void * GetData () const noexcept
 
bool PutData (void *pData) noexcept
 

Static Protected Member Functions

static void NTAPI OnThreadClose (IN void *pData)
 

Detailed Description

template<class TYPE>
class Gray::cThreadLocalSysNew< TYPE >

like cThreadLocalSysT but with auto create/allocate/new TYPE if it doesn't already exist. Will delete when thread closes.

Constructor & Destructor Documentation

◆ cThreadLocalSysNew()

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

Member Function Documentation

◆ FreeDataManually()

template<class TYPE >
void Gray::cThreadLocalSysNew< TYPE >::FreeDataManually ( )
inline

Manually free. reverse of GetDataNewV

◆ GetDataNew()

template<class TYPE >
TYPE* Gray::cThreadLocalSysNew< TYPE >::GetDataNew ( )
inline

Create new if not yet exist.

◆ GetDataNewV()

template<class TYPE >
virtual void* Gray::cThreadLocalSysNew< TYPE >::GetDataNewV ( )
inlinevirtual

override IThreadLocal This allows smarter usage and cleanup of this TYPE.

Implements Gray::IThreadLocal.

◆ OnThreadClose()

template<class TYPE >
static void NTAPI Gray::cThreadLocalSysNew< TYPE >::OnThreadClose ( IN void *  pData)
inlinestaticprotected

The thread has closed (or cThreadLocalSys was destroyed) so destroy/free/delete my TYPE pointer object.


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