maxscript/kernel/value.h File Reference

#include "../ScripterExport.h"
#include "collectable.h"
#include "interupts.h"
#include "MAXScript_TLS.h"
#include "../macros/value_locals.h"
#include "MaxscriptTypedefs.h"
#include "../../matrix3.h"
#include "../../box2.h"
#include "../../acolor.h"
#include "../../interval.h"
#include "../../quat.h"
#include "../../ifnpub.h"

Classes

class  Value
 
class  ValueMetaClass
 
class  Boolean
 
class  Undefined
 
class  Ok
 
class  Empty
 
class  Unsupplied
 
class  NoValue
 

Macros

#define is_valueclass(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == (ValueMetaClass*)&value_metaclass)
 
#define CHECK_ARG_COUNT(fn, w, g)   if ((w) != (g)) throw ArgCountError (_M(#fn), w, g)
 
#define classof_methods(_cls, _super)
 
#define visible_class(_cls)
 
#define visible_class_debug_ok(_cls)
 
#define visible_class_s(_cls, _super)
 
#define applyable_class(_cls)
 
#define applyable_class_debug_ok(_cls)
 
#define applyable_class_s(_cls, _super)
 
#define visible_class_instance(_cls, _name)   ScripterExport _cls##Class _cls##_class (_M(_name));
 
#define invisible_class(_cls)
 
#define invisible_class_instance(_cls, _name)   ScripterExport _cls##Class _cls##_class (_M(_name));
 
#define class_tag(_cls)   &_cls##_class
 
#define INTERNAL_CLASS_TAG   ((ValueMetaClass*)0L)
 
#define INTERNAL_INDEX_THUNK_TAG   ((ValueMetaClass*)1L)
 
#define INTERNAL_PROP_THUNK_TAG   ((ValueMetaClass*)2L)
 
#define INTERNAL_LOCAL_THUNK_TAG   ((ValueMetaClass*)3L)
 
#define INTERNAL_FREE_THUNK_TAG   ((ValueMetaClass*)4L)
 
#define INTERNAL_RO_LOCAL_THUNK_TAG   ((ValueMetaClass*)5L)
 
#define INTERNAL_CODE_TAG   ((ValueMetaClass*)6L)
 
#define INTERNAL_SOURCEFILEWRAPPER_TAG   ((ValueMetaClass*)7L)
 
#define INTERNAL_PIPE_TAG   ((ValueMetaClass*)8L)
 
#define INTERNAL_TOOL_LOCAL_THUNK_TAG   ((ValueMetaClass*)9L)
 
#define INTERNAL_GLOBAL_THUNK_TAG   ((ValueMetaClass*)10L)
 
#define INTERNAL_CONST_GLOBAL_THUNK_TAG   ((ValueMetaClass*)11L)
 
#define INTERNAL_SYS_GLOBAL_THUNK_TAG   ((ValueMetaClass*)12L)
 
#define INTERNAL_PLUGIN_LOCAL_THUNK_TAG   ((ValueMetaClass*)13L)
 
#define INTERNAL_PLUGIN_PARAM_THUNK_TAG   ((ValueMetaClass*)14L)
 
#define INTERNAL_RCMENU_LOCAL_THUNK_TAG   ((ValueMetaClass*)15L)
 
#define INTERNAL_STRUCT_MEM_THUNK_TAG   ((ValueMetaClass*)16L)
 
#define INTERNAL_MSPLUGIN_TAG   ((ValueMetaClass*)17L)
 
#define INTERNAL_STRUCT_TAG   ((ValueMetaClass*)18L)
 
#define INTERNAL_MAKER_TAG   ((ValueMetaClass*)19L)
 
#define INTERNAL_CODEBLOCK_LOCAL_TAG   ((ValueMetaClass*)20L)
 
#define INTERNAL_CODEBLOCK_TAG   ((ValueMetaClass*)21L)
 
#define INTERNAL_THUNK_REF_TAG   ((ValueMetaClass*)22L)
 
#define INTERNAL_THUNK_DEREF_TAG   ((ValueMetaClass*)23L)
 
#define INTERNAL_STRUCT_METHOD_TAG   ((ValueMetaClass*)24L)
 
#define INTERNAL_MSPLUGIN_METHOD_TAG   ((ValueMetaClass*)25L)
 
#define INTERNAL_CONTEXT_THUNK_TAG   ((ValueMetaClass*)26L)
 
#define INTERNAL_OWNER_THUNK_TAG   ((ValueMetaClass*)27L)
 
#define INTERNAL_RCMENU_ITEM_THUNK_TAG   ((ValueMetaClass*)28L)
 
#define INTERNAL_STANDINMSPLUGINCLASS_TAG   ((ValueMetaClass*)29L)
 
#define INTERNAL_SOURCEPOSWRAPPER_TAG   ((ValueMetaClass*)30L)
 
#define INTERNAL_PYWRAPPERBASE_TAG   ((ValueMetaClass*)31L)
 
#define INTERNAL_TAGS   ((ValueMetaClass*)100L)
 
#define is_sourcepositionwrapper(v)   ((v)->tag == INTERNAL_SOURCEPOSWRAPPER_TAG)
 
#define is_pywrapperbase(v)   ((v)->tag == INTERNAL_PYWRAPPERBASE_TAG)
 
#define pywrapperbase_equal(va, vb)
 
#define is_bool(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == &Boolean_class)
 

Functions

Valueheap_ptr (Value *v)
 
Valuelive_ptr (Value *v)
 

Variables

ScripterExport Undefined undefined
 
ScripterExport bool dontThrowAccessorError
 
ScripterExport MetaClassClass value_metaclass
 
ScripterExport Boolean true_value
 
ScripterExport Boolean false_value
 
ScripterExport Undefined dontCollect
 
ScripterExport Undefined loopExit
 
ScripterExport Ok ok
 
ScripterExport Empty empty
 
ScripterExport Unsupplied unsupplied
 
ScripterExport NoValue noValue
 

Macro Definition Documentation

#define is_valueclass (   v)    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == (ValueMetaClass*)&value_metaclass)
#define CHECK_ARG_COUNT (   fn,
  w,
 
)    if ((w) != (g)) throw ArgCountError (_M(#fn), w, g)
#define classof_methods (   _cls,
  _super 
)
Value:
Value* classOf_vf(Value** arg_list, int count) \
{ \
UNUSED_PARAM(arg_list); \
CHECK_ARG_COUNT(classOf, 1, count + 1); \
return &_cls##_class; \
} \
Value* superClassOf_vf(Value** arg_list, int count) \
{ \
UNUSED_PARAM(arg_list); \
CHECK_ARG_COUNT(superClassOf, 1, count + 1); \
return &_super##_class; \
} \
Value* isKindOf_vf(Value** arg_list, int count) \
{ \
CHECK_ARG_COUNT(isKindOf, 2, count + 1); \
return (arg_list[0] == &_cls##_class) ? \
_super::isKindOf_vf(arg_list, count); \
} \
BOOL is_kind_of(ValueMetaClass* c) \
{ \
return (c == &_cls##_class) ? 1 \
: _super::is_kind_of(c); \
}
Definition: value.h:319
Definition: value.h:105
ScripterExport Boolean true_value
#define UNUSED_PARAM(x)
Definition: BuildWarnings.h:18
#define CHECK_ARG_COUNT(fn, w, g)
Definition: value.h:349
#define visible_class (   _cls)
Value:
class _cls##Class : public ValueMetaClass \
{ \
public: \
_cls##Class(const MCHAR* name) : ValueMetaClass (name) { } \
void collect() { delete this; } \
}; \
extern ScripterExport _cls##Class _cls##_class;
MAXMEM_EXTERN_C UtilExport void(__cdecl *MAX_free)(void *memblock)
Definition: value.h:319
#define ScripterExport
Definition: ScripterExport.h:7
#define MCHAR
MBCS/Unicode helper defines std::wofstream doesn't mix well with Unicode.
Definition: strbasic.h:42
virtual void collect()=0
#define visible_class_debug_ok (   _cls)
Value:
class _cls##Class : public ValueMetaClass \
{ \
public: \
_cls##Class(const MCHAR* name) : ValueMetaClass (name) { flags3 |= VALUE_FLAGBIT_0; } \
void collect() { delete this; } \
}; \
extern ScripterExport _cls##Class _cls##_class;
MAXMEM_EXTERN_C UtilExport void(__cdecl *MAX_free)(void *memblock)
Definition: value.h:319
#define ScripterExport
Definition: ScripterExport.h:7
#define MCHAR
MBCS/Unicode helper defines std::wofstream doesn't mix well with Unicode.
Definition: strbasic.h:42
virtual void collect()=0
Definition: collectable.h:61
#define visible_class_s (   _cls,
  _super 
)
#define applyable_class (   _cls)
Value:
class _cls##Class : public ValueMetaClass \
{ \
public: \
_cls##Class(const MCHAR* name) : ValueMetaClass (name) { }\
void collect() { delete this; } \
ScripterExport Value* apply(Value** arglist, int count, CallContext* cc=NULL); \
}; \
extern ScripterExport _cls##Class _cls##_class;
MAXMEM_EXTERN_C UtilExport void(__cdecl *MAX_free)(void *memblock)
Definition: value.h:319
#define ScripterExport
Definition: ScripterExport.h:7
#define NULL
Definition: autoptr.h:18
Definition: functions.h:55
#define MCHAR
MBCS/Unicode helper defines std::wofstream doesn't mix well with Unicode.
Definition: strbasic.h:42
Definition: value.h:105
virtual ScripterExport Value * apply(Value **arglist, int count, CallContext *cc=NULL)
virtual void collect()=0
#define applyable_class_debug_ok (   _cls)
Value:
class _cls##Class : public ValueMetaClass \
{ \
public: \
_cls##Class(const MCHAR* name) : ValueMetaClass (name) { flags3 |= VALUE_FLAGBIT_0; }\
void collect() { delete this; } \
ScripterExport Value* apply(Value** arglist, int count, CallContext* cc=NULL); \
}; \
extern ScripterExport _cls##Class _cls##_class;
MAXMEM_EXTERN_C UtilExport void(__cdecl *MAX_free)(void *memblock)
Definition: value.h:319
#define ScripterExport
Definition: ScripterExport.h:7
#define NULL
Definition: autoptr.h:18
Definition: functions.h:55
#define MCHAR
MBCS/Unicode helper defines std::wofstream doesn't mix well with Unicode.
Definition: strbasic.h:42
Definition: value.h:105
virtual ScripterExport Value * apply(Value **arglist, int count, CallContext *cc=NULL)
virtual void collect()=0
Definition: collectable.h:61
#define applyable_class_s (   _cls,
  _super 
)
Value:
class _cls##Class : public ValueMetaClass \
{ \
public: \
_cls##Class(const MCHAR* name) : ValueMetaClass (name) { }\
Value* classOf_vf(Value** arg_list, int count) \
{ \
UNUSED_PARAM(arg_list); \
CHECK_ARG_COUNT(classOf, 1, count + 1); \
return &_super##_class; \
} \
Value* superClassOf_vf(Value** arg_list, int count) \
{ \
UNUSED_PARAM(arg_list); \
UNUSED_PARAM(count); \
return _super##_class.classOf_vf(NULL, 0); \
} \
void collect() { delete this; } \
ScripterExport Value* apply(Value** arglist, int count, CallContext* cc=NULL); \
}; \
extern ScripterExport _cls##Class _cls##_class;
MAXMEM_EXTERN_C UtilExport void(__cdecl *MAX_free)(void *memblock)
Definition: value.h:319
#define ScripterExport
Definition: ScripterExport.h:7
#define NULL
Definition: autoptr.h:18
Definition: functions.h:55
#define MCHAR
MBCS/Unicode helper defines std::wofstream doesn't mix well with Unicode.
Definition: strbasic.h:42
Definition: value.h:105
#define UNUSED_PARAM(x)
Definition: BuildWarnings.h:18
virtual ScripterExport Value * apply(Value **arglist, int count, CallContext *cc=NULL)
#define CHECK_ARG_COUNT(fn, w, g)
Definition: value.h:349
virtual void collect()=0
#define visible_class_instance (   _cls,
  _name 
)    ScripterExport _cls##Class _cls##_class (_M(_name));
#define invisible_class (   _cls)
Value:
class _cls##Class : public ValueMetaClass \
{ \
public: \
_cls##Class(const MCHAR* name) : ValueMetaClass (name) { } \
void collect() { delete this; } \
}; \
extern ScripterExport _cls##Class _cls##_class;
MAXMEM_EXTERN_C UtilExport void(__cdecl *MAX_free)(void *memblock)
Definition: value.h:319
#define ScripterExport
Definition: ScripterExport.h:7
ScripterExport void export_to_scripter()
#define MCHAR
MBCS/Unicode helper defines std::wofstream doesn't mix well with Unicode.
Definition: strbasic.h:42
virtual void collect()=0
#define invisible_class_instance (   _cls,
  _name 
)    ScripterExport _cls##Class _cls##_class (_M(_name));
#define class_tag (   _cls)    &_cls##_class
#define INTERNAL_CLASS_TAG   ((ValueMetaClass*)0L)
#define INTERNAL_INDEX_THUNK_TAG   ((ValueMetaClass*)1L)
#define INTERNAL_PROP_THUNK_TAG   ((ValueMetaClass*)2L)
#define INTERNAL_LOCAL_THUNK_TAG   ((ValueMetaClass*)3L)
#define INTERNAL_FREE_THUNK_TAG   ((ValueMetaClass*)4L)
#define INTERNAL_RO_LOCAL_THUNK_TAG   ((ValueMetaClass*)5L)
#define INTERNAL_CODE_TAG   ((ValueMetaClass*)6L)
#define INTERNAL_SOURCEFILEWRAPPER_TAG   ((ValueMetaClass*)7L)
#define INTERNAL_PIPE_TAG   ((ValueMetaClass*)8L)
#define INTERNAL_TOOL_LOCAL_THUNK_TAG   ((ValueMetaClass*)9L)
#define INTERNAL_GLOBAL_THUNK_TAG   ((ValueMetaClass*)10L)
#define INTERNAL_CONST_GLOBAL_THUNK_TAG   ((ValueMetaClass*)11L)
#define INTERNAL_SYS_GLOBAL_THUNK_TAG   ((ValueMetaClass*)12L)
#define INTERNAL_PLUGIN_LOCAL_THUNK_TAG   ((ValueMetaClass*)13L)
#define INTERNAL_PLUGIN_PARAM_THUNK_TAG   ((ValueMetaClass*)14L)
#define INTERNAL_RCMENU_LOCAL_THUNK_TAG   ((ValueMetaClass*)15L)
#define INTERNAL_STRUCT_MEM_THUNK_TAG   ((ValueMetaClass*)16L)
#define INTERNAL_MSPLUGIN_TAG   ((ValueMetaClass*)17L)
#define INTERNAL_STRUCT_TAG   ((ValueMetaClass*)18L)
#define INTERNAL_MAKER_TAG   ((ValueMetaClass*)19L)
#define INTERNAL_CODEBLOCK_LOCAL_TAG   ((ValueMetaClass*)20L)
#define INTERNAL_CODEBLOCK_TAG   ((ValueMetaClass*)21L)
#define INTERNAL_THUNK_REF_TAG   ((ValueMetaClass*)22L)
#define INTERNAL_THUNK_DEREF_TAG   ((ValueMetaClass*)23L)
#define INTERNAL_STRUCT_METHOD_TAG   ((ValueMetaClass*)24L)
#define INTERNAL_MSPLUGIN_METHOD_TAG   ((ValueMetaClass*)25L)
#define INTERNAL_CONTEXT_THUNK_TAG   ((ValueMetaClass*)26L)
#define INTERNAL_OWNER_THUNK_TAG   ((ValueMetaClass*)27L)
#define INTERNAL_RCMENU_ITEM_THUNK_TAG   ((ValueMetaClass*)28L)
#define INTERNAL_STANDINMSPLUGINCLASS_TAG   ((ValueMetaClass*)29L)
#define INTERNAL_SOURCEPOSWRAPPER_TAG   ((ValueMetaClass*)30L)
#define INTERNAL_PYWRAPPERBASE_TAG   ((ValueMetaClass*)31L)
#define INTERNAL_TAGS   ((ValueMetaClass*)100L)
#define is_sourcepositionwrapper (   v)    ((v)->tag == INTERNAL_SOURCEPOSWRAPPER_TAG)
#define is_pywrapperbase (   v)    ((v)->tag == INTERNAL_PYWRAPPERBASE_TAG)
#define pywrapperbase_equal (   va,
  vb 
)
Value:
( \
(va)->eq_vf(&(vb), 1) \
)
#define is_pywrapperbase(v)
Definition: value.h:532
#define is_bool (   v)    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == &Boolean_class)

Function Documentation

Value* heap_ptr ( Value v)
inline
311 { return v ? v->get_heap_ptr() : NULL; } // ensure v is in heap, migrate if not, return heap pointer
#define NULL
Definition: autoptr.h:18
ScripterExport Value * get_heap_ptr()
Definition: value.h:304
Value* live_ptr ( Value v)
inline
312 { return v->get_live_ptr(); } // get live pointer, if on stack & migrated, heap copy is live
ScripterExport Value * get_live_ptr()
Definition: value.h:307

Variable Documentation

ScripterExport bool dontThrowAccessorError
ScripterExport MetaClassClass value_metaclass
ScripterExport Boolean true_value
ScripterExport Boolean false_value