3ds Max C++ API Reference
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_PROP_EX_THUNK_TAG   ((ValueMetaClass*)32L)
 
#define INTERNAL_READONLY_THUNK_TAG   ((ValueMetaClass*)33L)
 
#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

ScripterExport Value_get_key_arg_or_default (Value **arg_list, int count, Value *key_name, Value *def)
 
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

◆ is_valueclass

#define is_valueclass (   v)    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == (ValueMetaClass*)&value_metaclass)

◆ CHECK_ARG_COUNT

#define CHECK_ARG_COUNT (   fn,
  w,
 
)    if ((w) != (g)) throw ArgCountError (_M(#fn), w, g)

◆ classof_methods

#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:107
Definition: value.h:379
ScripterExport Boolean true_value

◆ visible_class

#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;
#define ScripterExport
Definition: ScripterExport.h:7
virtual void collect()=0
#define MCHAR
MBCS/Unicode helper defines std::wofstream doesn't mix well with Unicode.
Definition: strbasic.h:42

◆ visible_class_debug_ok

#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;
@ VALUE_FLAGBIT_0
Definition: collectable.h:65

◆ visible_class_s

#define visible_class_s (   _cls,
  _super 
)

◆ applyable_class

#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;
#define NULL
Definition: autoptr.h:18
Definition: functions.h:56
virtual ScripterExport Value * apply(Value **arglist, int count, CallContext *cc=NULL)

◆ applyable_class_debug_ok

#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;

◆ applyable_class_s

#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;

◆ visible_class_instance

#define visible_class_instance (   _cls,
  _name 
)     ScripterExport _cls##Class _cls##_class (_M(_name));

◆ invisible_class

#define invisible_class (   _cls)
Value:
class _cls##Class : public ValueMetaClass \
{ \
public: \
_cls##Class(const MCHAR* name) : ValueMetaClass (name) { } \
void collect() { delete this; } \
void export_to_scripter() { } \
}; \
extern ScripterExport _cls##Class _cls##_class;
ScripterExport void export_to_scripter()

◆ invisible_class_instance

#define invisible_class_instance (   _cls,
  _name 
)     ScripterExport _cls##Class _cls##_class (_M(_name));

◆ class_tag

#define class_tag (   _cls)    &_cls##_class

◆ INTERNAL_CLASS_TAG

#define INTERNAL_CLASS_TAG   ((ValueMetaClass*)0L)

◆ INTERNAL_INDEX_THUNK_TAG

#define INTERNAL_INDEX_THUNK_TAG   ((ValueMetaClass*)1L)

◆ INTERNAL_PROP_THUNK_TAG

#define INTERNAL_PROP_THUNK_TAG   ((ValueMetaClass*)2L)

◆ INTERNAL_LOCAL_THUNK_TAG

#define INTERNAL_LOCAL_THUNK_TAG   ((ValueMetaClass*)3L)

◆ INTERNAL_FREE_THUNK_TAG

#define INTERNAL_FREE_THUNK_TAG   ((ValueMetaClass*)4L)

◆ INTERNAL_RO_LOCAL_THUNK_TAG

#define INTERNAL_RO_LOCAL_THUNK_TAG   ((ValueMetaClass*)5L)

◆ INTERNAL_CODE_TAG

#define INTERNAL_CODE_TAG   ((ValueMetaClass*)6L)

◆ INTERNAL_SOURCEFILEWRAPPER_TAG

#define INTERNAL_SOURCEFILEWRAPPER_TAG   ((ValueMetaClass*)7L)

◆ INTERNAL_PIPE_TAG

#define INTERNAL_PIPE_TAG   ((ValueMetaClass*)8L)

◆ INTERNAL_TOOL_LOCAL_THUNK_TAG

#define INTERNAL_TOOL_LOCAL_THUNK_TAG   ((ValueMetaClass*)9L)

◆ INTERNAL_GLOBAL_THUNK_TAG

#define INTERNAL_GLOBAL_THUNK_TAG   ((ValueMetaClass*)10L)

◆ INTERNAL_CONST_GLOBAL_THUNK_TAG

#define INTERNAL_CONST_GLOBAL_THUNK_TAG   ((ValueMetaClass*)11L)

◆ INTERNAL_SYS_GLOBAL_THUNK_TAG

#define INTERNAL_SYS_GLOBAL_THUNK_TAG   ((ValueMetaClass*)12L)

◆ INTERNAL_PLUGIN_LOCAL_THUNK_TAG

#define INTERNAL_PLUGIN_LOCAL_THUNK_TAG   ((ValueMetaClass*)13L)

◆ INTERNAL_PLUGIN_PARAM_THUNK_TAG

#define INTERNAL_PLUGIN_PARAM_THUNK_TAG   ((ValueMetaClass*)14L)

◆ INTERNAL_RCMENU_LOCAL_THUNK_TAG

#define INTERNAL_RCMENU_LOCAL_THUNK_TAG   ((ValueMetaClass*)15L)

◆ INTERNAL_STRUCT_MEM_THUNK_TAG

#define INTERNAL_STRUCT_MEM_THUNK_TAG   ((ValueMetaClass*)16L)

◆ INTERNAL_MSPLUGIN_TAG

#define INTERNAL_MSPLUGIN_TAG   ((ValueMetaClass*)17L)

◆ INTERNAL_STRUCT_TAG

#define INTERNAL_STRUCT_TAG   ((ValueMetaClass*)18L)

◆ INTERNAL_MAKER_TAG

#define INTERNAL_MAKER_TAG   ((ValueMetaClass*)19L)

◆ INTERNAL_CODEBLOCK_LOCAL_TAG

#define INTERNAL_CODEBLOCK_LOCAL_TAG   ((ValueMetaClass*)20L)

◆ INTERNAL_CODEBLOCK_TAG

#define INTERNAL_CODEBLOCK_TAG   ((ValueMetaClass*)21L)

◆ INTERNAL_THUNK_REF_TAG

#define INTERNAL_THUNK_REF_TAG   ((ValueMetaClass*)22L)

◆ INTERNAL_THUNK_DEREF_TAG

#define INTERNAL_THUNK_DEREF_TAG   ((ValueMetaClass*)23L)

◆ INTERNAL_STRUCT_METHOD_TAG

#define INTERNAL_STRUCT_METHOD_TAG   ((ValueMetaClass*)24L)

◆ INTERNAL_MSPLUGIN_METHOD_TAG

#define INTERNAL_MSPLUGIN_METHOD_TAG   ((ValueMetaClass*)25L)

◆ INTERNAL_CONTEXT_THUNK_TAG

#define INTERNAL_CONTEXT_THUNK_TAG   ((ValueMetaClass*)26L)

◆ INTERNAL_OWNER_THUNK_TAG

#define INTERNAL_OWNER_THUNK_TAG   ((ValueMetaClass*)27L)

◆ INTERNAL_RCMENU_ITEM_THUNK_TAG

#define INTERNAL_RCMENU_ITEM_THUNK_TAG   ((ValueMetaClass*)28L)

◆ INTERNAL_STANDINMSPLUGINCLASS_TAG

#define INTERNAL_STANDINMSPLUGINCLASS_TAG   ((ValueMetaClass*)29L)

◆ INTERNAL_SOURCEPOSWRAPPER_TAG

#define INTERNAL_SOURCEPOSWRAPPER_TAG   ((ValueMetaClass*)30L)

◆ INTERNAL_PYWRAPPERBASE_TAG

#define INTERNAL_PYWRAPPERBASE_TAG   ((ValueMetaClass*)31L)

◆ INTERNAL_PROP_EX_THUNK_TAG

#define INTERNAL_PROP_EX_THUNK_TAG   ((ValueMetaClass*)32L)

◆ INTERNAL_READONLY_THUNK_TAG

#define INTERNAL_READONLY_THUNK_TAG   ((ValueMetaClass*)33L)

◆ INTERNAL_TAGS

#define INTERNAL_TAGS   ((ValueMetaClass*)100L)

◆ is_sourcepositionwrapper

#define is_sourcepositionwrapper (   v)    ((v)->tag == INTERNAL_SOURCEPOSWRAPPER_TAG)

◆ is_pywrapperbase

#define is_pywrapperbase (   v)    ((v)->tag == INTERNAL_PYWRAPPERBASE_TAG)

◆ pywrapperbase_equal

#define pywrapperbase_equal (   va,
  vb 
)
Value:
( \
is_pywrapperbase(va) && \
is_pywrapperbase(vb) && \
(va)->eq_vf(&(vb), 1) \
)

◆ is_bool

#define is_bool (   v)    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == &Boolean_class)

Function Documentation

◆ _get_key_arg_or_default()

ScripterExport Value* _get_key_arg_or_default ( Value **  arg_list,
int  count,
Value key_name,
Value def 
)

◆ heap_ptr()

Value* heap_ptr ( Value v)
inline
370 { return v ? v->get_heap_ptr() : NULL; } // ensure v is in heap, migrate if not, return heap pointer
ScripterExport Value * get_heap_ptr()
Definition: value.h:316

◆ live_ptr()

Value* live_ptr ( Value v)
inline
371 { return v->get_live_ptr(); } // get live pointer, if on stack & migrated, heap copy is live
ScripterExport Value * get_live_ptr()
Definition: value.h:319

Variable Documentation

◆ undefined

ScripterExport Undefined undefined
extern

◆ dontThrowAccessorError

ScripterExport bool dontThrowAccessorError
extern

◆ value_metaclass

ScripterExport MetaClassClass value_metaclass
extern

◆ true_value

ScripterExport Boolean true_value
extern

◆ false_value

ScripterExport Boolean false_value
extern

◆ dontCollect

ScripterExport Undefined dontCollect
extern

◆ loopExit

ScripterExport Undefined loopExit
extern

◆ ok

ScripterExport Ok ok
extern

◆ empty

ScripterExport Empty empty
extern

◆ unsupplied

ScripterExport Unsupplied unsupplied
extern

◆ noValue

ScripterExport NoValue noValue
extern