3ds Max C++ API Reference
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
MAXScript_TLS.h File Reference

Classes

struct  MAXScript_TLS
 

Macros

#define def_thread_local(type, lcl, init_on_reset, init_val)   type lcl
 
#define thread_local(x)   (((MAXScript_TLS*)TlsGetValue(thread_locals_index))->x)
 
#define MAXScript_time()    (thread_local(use_time_context) ? thread_local(current_time) : GetCOREInterface()->GetTime())
 
#define MAXScript_time_tls()    (_tls->use_time_context ? _tls->current_time : GetCOREInterface()->GetTime())
 

Functions

void needs_redraw_set (MAXScript_TLS *tls=nullptr)
 
void needs_complete_redraw_set (MAXScript_TLS *tls=nullptr)
 
void needs_redraw_clear (MAXScript_TLS *tls=nullptr)
 
void alloc_thread_locals ()
 
ScripterExport void init_thread_locals ()
 
void free_thread_locals ()
 
void copy_thread_locals (MAXScript_TLS *source, MAXScript_TLS *target)
 

Variables

ScripterExport int thread_locals_index
 
int thread_id_index
 
MAXScript_TLSMAXScript_TLS_list
 

Macro Definition Documentation

◆ def_thread_local

#define def_thread_local (   type,
  lcl,
  init_on_reset,
  init_val 
)    type lcl

◆ thread_local

#define thread_local (   x)    (((MAXScript_TLS*)TlsGetValue(thread_locals_index))->x)

◆ MAXScript_time

#define MAXScript_time ( )     (thread_local(use_time_context) ? thread_local(current_time) : GetCOREInterface()->GetTime())

◆ MAXScript_time_tls

#define MAXScript_time_tls ( )     (_tls->use_time_context ? _tls->current_time : GetCOREInterface()->GetTime())

Function Documentation

◆ needs_redraw_set()

void needs_redraw_set ( MAXScript_TLS tls = nullptr)
inline
56{
57 if (tls == nullptr)
58 tls = (MAXScript_TLS*)TlsGetValue(thread_locals_index);
59 if (tls->redraw_mode && tls->needs_redraw == 0)
60 tls->needs_redraw = 1;
61}
ScripterExport int thread_locals_index
Definition: MAXScript_TLS.h:34

◆ needs_complete_redraw_set()

void needs_complete_redraw_set ( MAXScript_TLS tls = nullptr)
inline
63{
64 if (tls == nullptr)
65 tls = (MAXScript_TLS*)TlsGetValue(thread_locals_index);
66 if (tls->redraw_mode)
67 tls->needs_redraw = 2;
68}

◆ needs_redraw_clear()

void needs_redraw_clear ( MAXScript_TLS tls = nullptr)
inline
71{
72 if (tls == nullptr)
73 tls = (MAXScript_TLS*)TlsGetValue(thread_locals_index);
74 tls->needs_redraw = 0;
75}

◆ alloc_thread_locals()

void alloc_thread_locals ( )

◆ init_thread_locals()

ScripterExport void init_thread_locals ( )

◆ free_thread_locals()

void free_thread_locals ( )

◆ copy_thread_locals()

void copy_thread_locals ( MAXScript_TLS source,
MAXScript_TLS target 
)

Variable Documentation

◆ thread_locals_index

ScripterExport int thread_locals_index
extern

◆ thread_id_index

int thread_id_index
extern

◆ MAXScript_TLS_list

MAXScript_TLS* MAXScript_TLS_list
extern