Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::cThreadLocalSys Class Reference

#include <cThreadLocalSys.h>

Inheritance diagram for Gray::cThreadLocalSys:
Gray::cThreadLocalSysT< GrayLib::cExpressionContext * > Gray::cThreadLocalSysT< bool > Gray::cThreadLocalSysT< TYPE * > Gray::cThreadLocalSysT< TYPE > Gray::cThreadLocalSysNew< TYPE > Gray::cThreadLocalSysNew< Gray::cTempPool >

Public Member Functions

 cThreadLocalSys (PFLS_CALLBACK_FUNCTION pDestruct=nullptr) noexcept
 
 ~cThreadLocalSys ()
 
bool isInit () const noexcept
 
void * GetData () const noexcept
 
bool PutData (void *pData) noexcept
 

Detailed Description

Store a sizeof(void*) value separate/local for each thread.

Note
Must manually supply PFLS_CALLBACK_FUNCTION thread destructor for this type else pointer leaks!
can't get data for thread other than current! NO GetDataForThreadId similar to MFC cThreadLocalObject<> cThreadLocal<>

Constructor & Destructor Documentation

◆ cThreadLocalSys()

Gray::cThreadLocalSys::cThreadLocalSys ( PFLS_CALLBACK_FUNCTION  pDestruct = nullptr)
inlinenoexcept

Allocate new (void*) to be stored for EACH thread. Associate this type with m_nTypeSlot

  • pDestruct = supply a destructor if i think i need one when a thread is destroyed. (e.g. delete)

◆ ~cThreadLocalSys()

Gray::cThreadLocalSys::~cThreadLocalSys ( )
inline

Member Function Documentation

◆ GetData()

void* Gray::cThreadLocalSys::GetData ( ) const
inlinenoexcept

Get info stored for the current thread. from LPVOID Same as MFC::cThreadLocal<>:GetData()

◆ isInit()

bool Gray::cThreadLocalSys::isInit ( ) const
inlinenoexcept

Before static init?

◆ PutData()

bool Gray::cThreadLocalSys::PutData ( void *  pData)
inlinenoexcept

Store something unique to this thread. from LPVOID


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