maxscript/compiler/thunks.h File Reference
 
 
 
maxscript/compiler/thunks.h File Reference
#include "../kernel/value.h"
#include "../foundation/streams.h"
#include "../ui/rollouts.h"
#include "../ui/uiextend.h"

Classes

class   GlobalThunk
class   ConstGlobalThunk
class   SystemGlobalThunk
class   LocalThunk
class   IndirectLocalThunk
class   ContextThunk
class   FreeThunk
class   IndirectFreeThunk
class   PropertyThunk
class   FnCallPropertyThunk
class   IndexThunk
class   RolloutControlThunk
class   RolloutLocalThunk
class   ConstRolloutLocalThunk
class   ToolLocalThunk
class   CodeBlockLocalThunk
class   RCMenuItemThunk
class   RCMenuLocalThunk
class   PluginLocalThunk
class   ConstPluginLocalThunk
class   PluginParamThunk
class   StructMemberThunk
class   ThunkReference
class   DerefThunk
class   OwnerThunk

Defines

#define  is_thunk(v)   ((v)->_is_thunk())
#define  is_indirect_thunk(v)   ((v)->_is_indirect_thunk())
#define  is_globalthunk(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_GLOBAL_THUNK_TAG)
#define  is_constglobalthunk(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_CONST_GLOBAL_THUNK_TAG)
#define  is_systemglobalthunk(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_SYS_GLOBAL_THUNK_TAG)
#define  is_localthunk(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_LOCAL_THUNK_TAG)
#define  is_contextthunk(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_CONTEXT_THUNK_TAG)
#define  is_freethunk(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_FREE_THUNK_TAG)
#define  is_propertythunk(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_PROP_THUNK_TAG)
#define  is_indexthunk(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_INDEX_THUNK_TAG)
#define  is_rolloutthunk(v)   ((v)->_is_rolloutthunk())
#define  is_rolloutlocalthunk(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_RO_LOCAL_THUNK_TAG)
#define  is_toollocalthunk(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_TOOL_LOCAL_THUNK_TAG)
#define  is_codeblocklocalthunk(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_CODEBLOCK_LOCAL_TAG)
#define  is_rcmenuitemthunk(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_RCMENU_ITEM_THUNK_TAG)
#define  is_rcmenulocalthunk(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_RCMENU_LOCAL_THUNK_TAG)
#define  is_rcmenuthunk(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_RCMENU_LOCAL_THUNK_TAG || (v)->tag == INTERNAL_RCMENU_ITEM_THUNK_TAG)
#define  is_pluginlocalthunk(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_PLUGIN_LOCAL_THUNK_TAG)
#define  is_pluginparamthunk(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_PLUGIN_PARAM_THUNK_TAG)
#define  push_plugin(_pi)
#define  pop_plugin()   thread_local(current_plugin) = _save_cp;
#define  push_struct(_struct)
#define  pop_struct()   thread_local(current_struct) = _save_struct;
#define  is_structmemberthunk(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_STRUCT_MEM_THUNK_TAG)
#define  is_thunkref(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_THUNK_REF_TAG)
#define  is_derefthunk(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_THUNK_DEREF_TAG)
#define  is_ownerthunk(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_OWNER_THUNK_TAG)

Functions

  visible_class (Thunk) class Thunk

Define Documentation

#define is_thunk (   v )    ((v)->_is_thunk())
#define is_indirect_thunk (   v )    ((v)->_is_indirect_thunk())
#define is_globalthunk (   v )    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_GLOBAL_THUNK_TAG)
#define is_constglobalthunk (   v )    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_CONST_GLOBAL_THUNK_TAG)
#define is_systemglobalthunk (   v )    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_SYS_GLOBAL_THUNK_TAG)
#define is_localthunk (   v )    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_LOCAL_THUNK_TAG)
#define is_contextthunk (   v )    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_CONTEXT_THUNK_TAG)
#define is_freethunk (   v )    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_FREE_THUNK_TAG)
#define is_propertythunk (   v )    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_PROP_THUNK_TAG)
#define is_indexthunk (   v )    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_INDEX_THUNK_TAG)
#define is_rolloutthunk (   v )    ((v)->_is_rolloutthunk())
#define is_rolloutlocalthunk (   v )    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_RO_LOCAL_THUNK_TAG)
#define is_toollocalthunk (   v )    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_TOOL_LOCAL_THUNK_TAG)
#define is_codeblocklocalthunk (   v )    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_CODEBLOCK_LOCAL_TAG)
#define is_rcmenuitemthunk (   v )    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_RCMENU_ITEM_THUNK_TAG)
#define is_rcmenulocalthunk (   v )    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_RCMENU_LOCAL_THUNK_TAG)
#define is_rcmenuthunk (   v )    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_RCMENU_LOCAL_THUNK_TAG || (v)->tag == INTERNAL_RCMENU_ITEM_THUNK_TAG)
#define is_pluginlocalthunk (   v )    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_PLUGIN_LOCAL_THUNK_TAG)
#define is_pluginparamthunk (   v )    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_PLUGIN_PARAM_THUNK_TAG)
#define push_plugin (   _pi )
Value:
MSPlugin* _save_cp = thread_local(current_plugin);      \
        thread_local(current_plugin) = _pi;
#define pop_plugin ( )    thread_local(current_plugin) = _save_cp;
#define push_struct (   _struct )
Value:
Struct* _save_struct = thread_local(current_struct);    \
        thread_local(current_struct) = _struct;
#define pop_struct ( )    thread_local(current_struct) = _save_struct;
#define is_structmemberthunk (   v )    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_STRUCT_MEM_THUNK_TAG)
#define is_thunkref (   v )    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_THUNK_REF_TAG)
#define is_derefthunk (   v )    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_THUNK_DEREF_TAG)
#define is_ownerthunk (   v )    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_OWNER_THUNK_TAG)

Function Documentation

visible_class ( Thunk  )
            : public Value
{
public:
        Value*  name;
        BOOL    clear_container; // outer-level prop in a prop sequence, clear current_container when done

                        classof_methods (Thunk, Value);
#       define  is_thunk(v) ((v)->_is_thunk())
#       define  is_indirect_thunk(v) ((v)->_is_indirect_thunk())
        BOOL    _is_thunk() { DbgAssert(!is_sourcepositionwrapper(this)); return TRUE; }
        ScripterExport void     gc_trace();
        Thunk() : clear_container(FALSE), name(NULL) { }

        Thunk*  to_thunk() {return this; }
        virtual Thunk* make_free_thunk(int level) { return NULL; }
        void    assign(Value* val) { assign_vf(&val, 1); }

        ScripterExport Value*   get_property(Value** arg_list, int count);
        ScripterExport Value*   set_property(Value** arg_list, int count);
};