maxscript/macros/value_locals.h File Reference

Classes

class  MXS_Exit_ValueLocal_Scope
 Class that uses the RAII idiom to push/pop the thread local current_locals_frame. More...
 
class  ScopedValueTempArray
 Class that uses the RAII idiom to allocate and deallocate value temp arrays. More...
 
class  ScopedSaveCurrentFrames
 Class that uses the RAII idiom to save and restore the current frame data. More...
 
class  ScopedMaxScriptSEHandler
 Class that uses the RAII idiom to push/pop setting a structured error handler. More...
 
class  ScopedMaxScriptEvaluationContext
 Class that uses the RAII idiom to create a maxscript visible stack frame. More...
 
class  ScopedPushControl
 Class that uses the RAII idiom to push/pop the thread local current_controller. More...
 

Macros

#define one_value_local(n1)
 
#define one_value_local_noFrameValidate(n1)
 
#define one_typed_value_local(n1)
 
#define one_typed_value_local_noFrameValidate(n1)
 
#define two_value_locals(n1, n2)
 
#define two_typed_value_locals(n1, n2)
 
#define three_value_locals(n1, n2, n3)
 
#define three_typed_value_locals(n1, n2, n3)
 
#define four_value_locals(n1, n2, n3, n4)
 
#define four_typed_value_locals(n1, n2, n3, n4)
 
#define five_value_locals(n1, n2, n3, n4, n5)
 
#define five_typed_value_locals(n1, n2, n3, n4, n5)
 
#define six_value_locals(n1, n2, n3, n4, n5, n6)
 
#define six_typed_value_locals(n1, n2, n3, n4, n5, n6)
 
#define seven_value_locals(n1, n2, n3, n4, n5, n6, n7)
 
#define seven_typed_value_locals(n1, n2, n3, n4, n5, n6, n7)
 
#define eight_value_locals(n1, n2, n3, n4, n5, n6, n7, n8)
 
#define eight_typed_value_locals(n1, n2, n3, n4, n5, n6, n7, n8)
 
#define nine_value_locals(n1, n2, n3, n4, n5, n6, n7, n8, n9)
 
#define nine_typed_value_locals(n1, n2, n3, n4, n5, n6, n7, n8, n9)
 
#define ten_value_locals(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10)
 
#define ten_typed_value_locals(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10)
 
#define eleven_value_locals(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11)
 
#define eleven_typed_value_locals(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11)
 
#define value_local_array(var, count)
 
#define return_value(r)   { return templated_return_value_fn(r); }
 
#define save_current_source()
 
#define restore_current_source()
 
#define save_current_source_no_pos()
 
#define restore_current_source_no_pos()
 
#define save_current_source_pos()
 
#define restore_current_source_pos()
 
#define save_current_source_to_frame()
 
#define save_current_source_to_frame_no_pos()
 
#define save_current_source_to_frame_pos()
 
#define save_current_source_to_frame_no_file()
 

Functions

template<typename Type >
Type templated_return_value_fn (Type r)
 
ScripterExport void save_error_source_data ()
 
ScripterExport void clear_error_source_data ()
 

Macro Definition Documentation

#define one_value_local (   n1)
Value:
struct { int count; Value** link; Value* n1; } vl = \
{ 1, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define one_value_local_noFrameValidate (   n1)
Value:
struct { int count; Value** link; Value* n1; } vl = \
{ 1, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope(false);
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define one_typed_value_local (   n1)
Value:
struct { int count; Value** link; n1; } vl = \
{ 1, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define one_typed_value_local_noFrameValidate (   n1)
Value:
struct { int count; Value** link; n1; } vl = \
{ 1, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope(false);
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define two_value_locals (   n1,
  n2 
)
Value:
struct { int count; Value** link; Value *n1, *n2; } vl = \
{ 2, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define two_typed_value_locals (   n1,
  n2 
)
Value:
struct { int count; Value** link; n1; n2; } vl = \
{ 2, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define three_value_locals (   n1,
  n2,
  n3 
)
Value:
struct { int count; Value** link; Value *n1, *n2, *n3; } vl = \
{ 3, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define three_typed_value_locals (   n1,
  n2,
  n3 
)
Value:
struct { int count; Value** link; n1; n2; n3; } vl = \
{ 3, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define four_value_locals (   n1,
  n2,
  n3,
  n4 
)
Value:
struct { int count; Value** link; Value *n1, *n2, *n3, *n4; } vl = \
{ 4, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define four_typed_value_locals (   n1,
  n2,
  n3,
  n4 
)
Value:
struct { int count; Value** link; n1; n2; n3; n4; } vl = \
{ 4, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define five_value_locals (   n1,
  n2,
  n3,
  n4,
  n5 
)
Value:
struct { int count; Value** link; Value *n1, *n2, *n3, *n4, *n5; } vl = \
{ 5, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define five_typed_value_locals (   n1,
  n2,
  n3,
  n4,
  n5 
)
Value:
struct { int count; Value** link; n1; n2; n3; n4; n5; } vl = \
{ 5, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define six_value_locals (   n1,
  n2,
  n3,
  n4,
  n5,
  n6 
)
Value:
struct { int count; Value** link; Value *n1, *n2, *n3, *n4, *n5, *n6; } vl = \
{ 6, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define six_typed_value_locals (   n1,
  n2,
  n3,
  n4,
  n5,
  n6 
)
Value:
struct { int count; Value** link; n1; n2; n3; n4; n5; n6; } vl = \
{ 6, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define seven_value_locals (   n1,
  n2,
  n3,
  n4,
  n5,
  n6,
  n7 
)
Value:
struct { int count; Value** link; Value *n1, *n2, *n3, *n4, *n5, *n6, *n7; } vl = \
{ 7, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define seven_typed_value_locals (   n1,
  n2,
  n3,
  n4,
  n5,
  n6,
  n7 
)
Value:
struct { int count; Value** link; n1; n2; n3; n4; n5; n6; n7; } vl = \
{ 7, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define eight_value_locals (   n1,
  n2,
  n3,
  n4,
  n5,
  n6,
  n7,
  n8 
)
Value:
struct { int count; Value** link; Value *n1, *n2, *n3, *n4, *n5, *n6, *n7, *n8; } vl = \
{ 8, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define eight_typed_value_locals (   n1,
  n2,
  n3,
  n4,
  n5,
  n6,
  n7,
  n8 
)
Value:
struct { int count; Value** link; n1; n2; n3; n4; n5; n6; n7; n8; } vl = \
{ 8, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define nine_value_locals (   n1,
  n2,
  n3,
  n4,
  n5,
  n6,
  n7,
  n8,
  n9 
)
Value:
struct { int count; Value** link; Value *n1, *n2, *n3, *n4, *n5, *n6, *n7, *n8, *n9; } vl = \
{ 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define nine_typed_value_locals (   n1,
  n2,
  n3,
  n4,
  n5,
  n6,
  n7,
  n8,
  n9 
)
Value:
struct { int count; Value** link; n1; n2; n3; n4; n5; n6; n7; n8; n9; } vl = \
{ 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define ten_value_locals (   n1,
  n2,
  n3,
  n4,
  n5,
  n6,
  n7,
  n8,
  n9,
  n10 
)
Value:
struct { int count; Value** link; Value *n1, *n2, *n3, *n4, *n5, *n6, *n7, *n8, *n9, *n10; } vl = \
{ 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define ten_typed_value_locals (   n1,
  n2,
  n3,
  n4,
  n5,
  n6,
  n7,
  n8,
  n9,
  n10 
)
Value:
struct { int count; Value** link; n1; n2; n3; n4; n5; n6; n7; n8; n9; n10; } vl = \
{ 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define eleven_value_locals (   n1,
  n2,
  n3,
  n4,
  n5,
  n6,
  n7,
  n8,
  n9,
  n10,
  n11 
)
Value:
struct { int count; Value** link; Value *n1, *n2, *n3, *n4, *n5, *n6, *n7, *n8, *n9, *n10, *n11; } vl = \
{ 11, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define eleven_typed_value_locals (   n1,
  n2,
  n3,
  n4,
  n5,
  n6,
  n7,
  n8,
  n9,
  n10,
  n11 
)
Value:
struct { int count; Value** link; n1; n2; n3; n4; n5; n6; n7; n8; n9; n10; n11; } vl = \
{ 11, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; \
vl.link = thread_local(current_locals_frame); \
thread_local(current_locals_frame) = (Value**)&vl; \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define NULL
Definition: autoptr.h:18
Definition: value.h:106
#define value_local_array (   var,
  count 
)
Value:
{ \
var = &((Value**)_alloca(((count) + 2) * sizeof(Value*)))[2]; \
memset(var, 0, (count) * sizeof(Value*)); \
var[-2] = (Value*)(static_cast<INT_PTR>(count)); \
var[-1] = (Value*)thread_local(current_locals_frame); \
thread_local(current_locals_frame) = &var[-2]; } \
MXS_Exit_ValueLocal_Scope mxs_Exit_ValueLocal_Scope_##var;
#define thread_local(x)
Definition: MAXScript_TLS.h:44
Definition: value.h:106
#define return_value (   r)    { return templated_return_value_fn(r); }
#define save_current_source ( )
Value:
Value* _save_source = thread_local(source_file); \
MSZipPackage* _save_pkg = thread_local(current_pkg); \
unsigned int _save_pos = thread_local(source_pos); \
unsigned int _save_line = thread_local(source_line); \
DWORD _save_flags = thread_local(source_flags);
#define thread_local(x)
Definition: MAXScript_TLS.h:44
Definition: value.h:106
#define restore_current_source ( )
Value:
{ \
thread_local(source_file) = _save_source; \
thread_local(current_pkg) = _save_pkg; \
thread_local(source_pos) = _save_pos; \
thread_local(source_line) = _save_line; \
thread_local(source_flags) = _save_flags;}
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define save_current_source_no_pos ( )
Value:
Value* _save_source = thread_local(source_file); \
MSZipPackage* _save_pkg = thread_local(current_pkg); \
DWORD _save_flags = thread_local(source_flags);
#define thread_local(x)
Definition: MAXScript_TLS.h:44
Definition: value.h:106
#define restore_current_source_no_pos ( )
Value:
{ \
thread_local(source_file) = _save_source; \
thread_local(current_pkg) = _save_pkg; \
thread_local(source_flags) = _save_flags;}
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define save_current_source_pos ( )
Value:
unsigned int _save_pos = thread_local(source_pos); \
unsigned int _save_line = thread_local(source_line); \
DWORD _save_flags = thread_local(source_flags);
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define restore_current_source_pos ( )
Value:
{ \
thread_local(source_pos) = _save_pos; \
thread_local(source_line) = _save_line; \
thread_local(source_flags) = _save_flags;}
#define thread_local(x)
Definition: MAXScript_TLS.h:44
#define save_current_source_to_frame ( )
Value:
{ \
Value** _frame = thread_local(current_scan_frame); \
if (_frame) _frame[3] = thread_local(source_file); \
if (_frame) _frame[4] = (Value*)thread_local(source_pos); \
if (_frame) _frame[8] = (Value*)thread_local(source_line); \
if (_frame) _frame[7] = (Value*)static_cast<DWORD_PTR>(thread_local(source_flags));}
#define thread_local(x)
Definition: MAXScript_TLS.h:44
Definition: value.h:106
#define save_current_source_to_frame_no_pos ( )
Value:
{ \
Value** _frame = thread_local(current_scan_frame); \
if (_frame) _frame[3] = thread_local(source_file); \
if (_frame) _frame[7] = (Value*)static_cast<DWORD_PTR>(thread_local(source_flags));}
#define thread_local(x)
Definition: MAXScript_TLS.h:44
Definition: value.h:106
#define save_current_source_to_frame_pos ( )
Value:
{ \
Value** _frame = thread_local(current_scan_frame); \
if (_frame) _frame[4] = (Value*)thread_local(source_pos); \
if (_frame) _frame[8] = (Value*)thread_local(source_line);}
#define thread_local(x)
Definition: MAXScript_TLS.h:44
Definition: value.h:106
#define save_current_source_to_frame_no_file ( )
Value:
{ \
Value** _frame = thread_local(current_scan_frame); \
if (_frame) _frame[4] = (Value*)thread_local(source_pos); \
if (_frame) _frame[8] = (Value*)thread_local(source_line);}
#define thread_local(x)
Definition: MAXScript_TLS.h:44
Definition: value.h:106

Function Documentation

Type templated_return_value_fn ( Type  r)
Deprecated:
Deprecated as of 3ds Max 2017. value local storage handled by MXS_Exit_ValueLocal_Scope instances
213 {
214  thread_local(current_result) = r;
215  return r;
216 }
#define thread_local(x)
Definition: MAXScript_TLS.h:44
ScripterExport void save_error_source_data ( )
Deprecated:
Deprecated as of 3ds Max 2017. Use ScopedPushControl instead.
ScripterExport void clear_error_source_data ( )