Template class to assist in handling thread local storage data This class is to be used ONLY from a local static variable in a static function or method. More...
#include <mi32/thrlcstr.h>

Public Member Functions | |
| virtual | ~LOCALSTORAGE_T () |
| _CT * | GetValue () |
Template class to assist in handling thread local storage data This class is to be used ONLY from a local static variable in a static function or method.
Any other use will cause memory leaks and / or process instability.
class GETERRSTRDATA : public MITHREAD::LOCALSTORAGE::BASE { public: GETERRSTRDATA ( ) {} virtual ~GETERRSTRDATA ( ) {} ERRORSTATE& GetErrorStateRef ( ) { return (m_ErrorState); } static void TLSSystemClose ( ) { s_ErrorSystemDisabled = true; } // Do not allow any more calls to the error system private: ERRORSTATE m_ErrorState; }; ERRORSTATE& ERRORSTATE::GetThreadErrStateRef ( ) { static MITHREAD::LOCALSTORAGE_T<GETERRSTRDATA> s_ErrTLS; return (s_ErrTLS.GetValue()->GetErrorStateRef()); }
| virtual MITHREAD::LOCALSTORAGE_T< _CT >::~LOCALSTORAGE_T | ( | ) | [inline, virtual] |
Default virtual dtor Makes a call to a 'static' method on the template class called TLSSystemClose().
There is no default method for this, nor can it be virtual or non-static. This tells the class in question that the dtor for the THREADLOCALSTORAGE class is being called. The error reporting system uses this to determine that it cannot handle any more errors.
| _CT* MITHREAD::LOCALSTORAGE_T< _CT >::GetValue | ( | ) | [inline] |
Get the TLS data from the presumably global variable.
I considered replacing this with operator->(), but that would cause more overhead than simply getting the pointer and using it
1.6.1