//**************************************************************************************************
//
// THREAD LOCAL STORAGE INDEX (CLASS):
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// RuntimeForStatic base library | C+- (SysRoutine) | Author: Sergei Y.Kitáev
#pragma once
#include "include_restrictions.h"
namespace RuntimeForStatic {

//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//
// "$TLSIndex" CLASS:
//
//==================================================================================================
class $TLSIndex: public $Disposable $thread_safe_object
{
public:
   $TLSIndex();
private:
   $TLSIndex& operator = (const $TLSIndex& instance) = delete; //$not_implemented;
public:
   void Allocate($O) $fatal_error_on_failure;
   bool AllocateNS($O) $last_error;
public:
   __declspec(property(get = GetIsAllocated)) bool IsAllocated;
public:
   DWORD SlotIdx($O) const;
   void VerifyAllocated($O) const;
   void VerifyNotAllocated($O) const;
   void Finalize();
public:
   bool GetIsAllocated() const;
protected:
   virtual void DoDispose($CI_REF) override;
   void ResetSuperstructure();
private:
#include "..\private\TLSIndex.private.h"
}; // $TLSIndex
typedef $TLSIndex*         $PTLSIndex;
typedef const $TLSIndex*   $PCTLSIndex;
//==================================================================================================

} // RuntimeForStatic
