maxscript/foundation/functions.h File Reference

functions.h File Reference
+ This reference page is linked to from the following overview topics:

#include "arrays.h"
#include "../../ifnpub.h"
#include "../../GetCOREInterface.h"

Classes

struct  DumpValueData
 
class  CallContext
 
class  StructMethod
 
class  SMCallContext
 
class  PluginMethod
 
class  UserProp
 
class  UserGeneric
 
class  ValueConverter
 
class  InterfaceMethod
 
class  StaticInterfaceMethod
 

Macros

#define def_generic(fn, name)   ScripterExport Value* fn##_vf(Value** arglist, int arg_count)
 
#define FPS_CACHE_SIZE   512
 
#define is_function(v)   ((v)->_is_function())
 
#define is_maxscriptfunction(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(MAXScriptFunction))
 
#define FN_MAPPED_FN   0x0001
 
#define FN_BODY_FN   0x0002
 
#define FN_HAS_REFARGS   0x0004
 
#define FN_MAPPED_EVAL   0x0008
 
#define is_structMethod(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_STRUCT_METHOD_TAG)
 
#define is_pluginMethod(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_MSPLUGIN_METHOD_TAG)
 
#define def_user_prop(_prop, _cls, _getter, _setter)   _cls##_class.add_user_prop(_M(#_prop), _getter, _setter)
 
#define def_user_generic(_fn, _cls, _name)   _cls##_class.add_user_generic(#_name, _fn)
 
#define VALUECONVERTER_INTERFACE_ID   Interface_ID(0x19f37b9f, 0x39ed5680)
 
#define is_iobject(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(IObjectValue))
 
#define is_fpstaticinterface(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(FPInterfaceValue))
 
#define is_fpmixininterface(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(FPMixinInterfaceValue))
 
#define is_fpstaticmethodinterface(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(FPStaticMethodInterfaceValue))
 

Enumerations

enum  primitive_flag { LAZY_PRIMITIVE = 0x0001, DEBUGGER_SAFE = 0x0002 }
 

Functions

 Function ()
 
ScripterExport Function (const MCHAR *name, const MCHAR *struct_name=NULL)
 
ScripterExport Function (const MCHAR *name, const MCHAR *struct_name, bool debuggerSafe)
 
ScripterExport ~Function ()
 
 classof_methods (Function, Value)
 
BOOL _is_function ()
 
ScripterExport void sprin1 (CharStream *s)
 
ScripterExport void export_to_scripter ()
 
visible_class(Generic) class
Generic 
Generic ()
 
ScripterExport Generic (const MCHAR *name, value_vf fn, const MCHAR *struct_name=NULL)
 
ScripterExport Generic (const MCHAR *name, value_vf fn, const MCHAR *struct_name, short init_flags=0)
 
 Generic (const MCHAR *name)
 
 classof_methods (Generic, Function)
 
ScripterExport void collect ()
 
ScripterExport Valueapply (Value **arglist, int count, CallContext *cc=NULL)
 
 visible_class (MappedGeneric) class MappedGeneric
 
ScripterExport MappedGeneric (const MCHAR *name, value_vf fn)
 
ScripterExport MappedGeneric (const MCHAR *name, value_vf fn, short init_flags)
 
 MappedGeneric (const MCHAR *name)
 
 classof_methods (MappedGeneric, Generic)
 
visible_class(NodeGeneric)
class NodeGeneric
ScripterExport 
NodeGeneric (const MCHAR *name, value_vf fn, short init_flags)
 
 NodeGeneric (const MCHAR *name)
 
 classof_methods (NodeGeneric, MappedGeneric)
 
 Primitive ()
 
ScripterExport Primitive (const MCHAR *name, value_cf fn, short init_flags=0)
 
ScripterExport Primitive (const MCHAR *name, const MCHAR *structure, value_cf fn, short init_flags=0)
 
 Primitive (const MCHAR *name)
 
 classof_methods (Primitive, Function)
 
visible_class(MappedPrimitive)
class MappedPrimitive
ScripterExport 
MappedPrimitive (const MCHAR *name, value_cf fn, short init_flags)
 
 classof_methods (MappedPrimitive, Primitive)
 
ScripterExport MAXScriptFunction (const MCHAR *name, int parm_count, int keyparm_count, Value **keyparms, int local_count, Value *body, HashTable *local_scope, short flags=0)
 
ScripterExport MAXScriptFunction (const MCHAR *name, int parm_count, int keyparm_count, Value **keyparms, int local_count, Value *body, HashTable *local_scope, Array *param_names, Value *owner, short flags=0)
 
 ~MAXScriptFunction ()
 
 classof_methods (MAXScriptFunction, Function)
 
void gc_trace ()
 
Valueapply_no_alloc_frame (Value **arglist, int count, CallContext *cc=NULL)
 
value_cf get_c_callable_fn ()
 
Valueoperator() (Value **arg_list, int count)
 
void dump_local_vars_params_and_externals (Value **paramsFrame, Value **localsFrame, int indentLevel)
 
Valuewrap_arg (Value *arg)
 
ScripterExport UserGenericValue (Value *name, Value *old_fn)
 
 classof_methods (UserGenericValue, Function)
 
 InterfaceFunction (FPInterface *fpi, FPFunctionDef *fd)
 
 ~InterfaceFunction ()
 
 classof_methods (InterfaceFunction, Function)
 
Valueget_property (Value **arg_list, int count)
 
static ScripterExport void val_to_FPValue (Value *v, ParamType2 type, FPValue &fpv, FPEnum *e, Tab< void * > *stringStorage, Array *valueStore)
 
static ScripterExport void val_to_FPValue (Value *v, ParamType2 type, FPValue &fpv, FPEnum *e, Tab< void * > *stringStorage)
 
static ScripterExport void val_to_FPValue (Value *v, ParamType2 type, FPValue &fpv, FPEnum *e=NULL)
 
static ScripterExport ValueFPValue_to_val (FPValue &fpv, FPEnum *e=NULL)
 
static ScripterExport void release_param (FPValue &fpv, ParamType2 type, Value *v, FPEnum *e=NULL)
 
static ScripterExport void init_param (FPValue &fpv, ParamType2 type)
 
static ScripterExport void validate_params (FPInterface *fpi, FunctionID fid, FPParamDef *pd, ParamType2 type, int paramNum, FPValue &val, Value *v)
 
static ScripterExport FPEnumFindEnum (short id, FPInterfaceDesc *fpid)
 
visible_class(ActionPredicate)
class ActionPredicate 
ActionPredicate (FPInterface *fpi, FPFunctionDef *fd, short pred)
 
 classof_methods (ActionPredicate, Function)
 
visible_class(IObjectValue)
class IObjectValue 
IObjectValue (IObject *io)
 
 ~IObjectValue ()
 
 classof_methods (IObjectValue, Value)
 
MSTR to_filename ()
 
void to_fpvalue (FPValue &v)
 
 def_generic (show_interfaces,"showInterfaces")
 
 def_generic (get_interfaces,"getInterfaces")
 
 def_generic (get_interface,"getInterface")
 
BaseInterfaceGetInterface (Interface_ID id)
 
Valueset_property (Value **arg_list, int count)
 
ScripterExport FPInterfaceValue (FPInterface *fpi)
 
 FPInterfaceValue (FPInterfaceProxy *proxy)
 
 ~FPInterfaceValue ()
 
 classof_methods (FPInterfaceValue, Value)
 
 def_generic (show_interface,"showInterface")
 
 def_generic (get_props,"getPropNames")
 
 def_generic (isDeleted,"isDeleted")
 
 use_generic (eq,"=")
 
 use_generic (ne,"!=")
 
void InterfaceDeleted (BaseInterface *bi)
 
Value_get_property (Value *prop)
 
Value_set_property (Value *prop, Value *val)
 
static void UpdateEditorOnResolve (bool update=true)
 
static ScripterExport
FPMixinInterfaceValue * 
intern (Value *prop_name, Value *target)
 
static ScripterExport
FPMixinInterfaceValue * 
intern (FPInterface *fpi)
 
 classof_methods (FPMixinInterfaceValue, Value)
 
visible_class(FPStaticMethodInterfaceValue)
class
FPStaticMethodInterfaceValue 
~FPStaticMethodInterfaceValue ()
 
static ScripterExport
FPStaticMethodInterfaceValue * 
intern (FPInterface *fpi, ParamType2 type, void *object)
 
 classof_methods (FPStaticMethodInterfaceValue, Value)
 

Variables

visible_class(Function) class
Function const MCHAR
struct_name
 
visible_class(Primitive) class
Primitive value_cf 
fn_ptr
 
visible_class(MAXScriptFunction)
class MAXScriptFunction short 
local_count
 
short keyparm_count
 
short flags
 
Value ** keyparms
 
Valuebody
 
HashTablelocal_scope
 
value_cf c_callable_fn
 
ArrayparamNames
 
Valueowner
 
visible_class(UserGenericValue)
class UserGenericValue Value
old_fn
 
visible_class(InterfaceFunction)
class InterfaceFunction
FPFunctionDef
fd
 
visible_class(FPInterfaceValue)
class FPInterfaceValue
HashTable
fns
 
HashTableprops
 
FPInterface::LifetimeType lifetime
 
static bool enable_test_interfaces
 
FPInterfaceProxy * m_fpip
 
static bool s_updateEditorOnResolve
 
FPInterfacefpi
 
static
FPStaticMethodInterfaceValue * 
interface_cache [FPS_CACHE_SIZE]
 
FPValue value
 

Macro Definition Documentation

#define def_generic (   fn,
  name 
)    ScripterExport Value* fn##_vf(Value** arglist, int arg_count)
#define FPS_CACHE_SIZE   512
#define is_function (   v)    ((v)->_is_function())
#define is_maxscriptfunction (   v)    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(MAXScriptFunction))
#define FN_MAPPED_FN   0x0001
#define FN_BODY_FN   0x0002
#define FN_HAS_REFARGS   0x0004
#define FN_MAPPED_EVAL   0x0008
#define is_structMethod (   v)    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_STRUCT_METHOD_TAG)
#define is_pluginMethod (   v)    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_MSPLUGIN_METHOD_TAG)
#define def_user_prop (   _prop,
  _cls,
  _getter,
  _setter 
)    _cls##_class.add_user_prop(_M(#_prop), _getter, _setter)
#define def_user_generic (   _fn,
  _cls,
  _name 
)    _cls##_class.add_user_generic(#_name, _fn)
#define VALUECONVERTER_INTERFACE_ID   Interface_ID(0x19f37b9f, 0x39ed5680)
#define is_iobject (   v)    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(IObjectValue))
#define is_fpstaticinterface (   v)    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(FPInterfaceValue))
#define is_fpmixininterface (   v)    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(FPMixinInterfaceValue))
#define is_fpstaticmethodinterface (   v)    ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(FPStaticMethodInterfaceValue))

Enumeration Type Documentation

Enumerator
LAZY_PRIMITIVE 
DEBUGGER_SAFE 
124 {
125  LAZY_PRIMITIVE = 0x0001, // don't pre-evaluate args for lazy primitives
126  DEBUGGER_SAFE = 0x0002, // safe to call from debugger
127 };
Definition: functions.h:126
Definition: functions.h:125

Function Documentation

Function ( )
40 { name = NULL; struct_name = NULL; }
Value * name
Definition: structs.h:25
#define NULL
Definition: autoptr.h:20
visible_class(Function) class Function const MCHAR * struct_name
Definition: functions.h:31
ScripterExport Function ( const MCHAR name,
const MCHAR struct_name = NULL 
)
ScripterExport Function ( const MCHAR name,
const MCHAR struct_name,
bool  debuggerSafe 
)
classof_methods ( Function  ,
Value   
)
BOOL _is_function ( )
47 { DbgAssert(!is_sourcepositionwrapper(this)); return 1; }
#define DbgAssert(expr)
Definition: assert1.h:74
#define is_sourcepositionwrapper(v)
ScripterExport void sprin1 ( CharStream s)
351 { s->printf(_M("LabelControl:%s"), name->to_string()); }
Value * name
Definition: structs.h:25
#define _M(x)
Used to wrap string literals.
Definition: strbasic.h:122
virtual const MCHAR * to_string()
Definition: value.h:171
void export_to_scripter ( )
visible_class (Generic) class Generic Generic ( )
76 { }
ScripterExport Generic ( const MCHAR name,
value_vf  fn,
const MCHAR struct_name = NULL 
)
ScripterExport Generic ( const MCHAR name,
value_vf  fn,
const MCHAR struct_name,
short  init_flags = 0 
)
Generic ( const MCHAR name)
79 : Function(name) { }
Value * name
Definition: structs.h:25
Function()
Definition: functions.h:40
classof_methods ( Generic  ,
Function   
)
ScripterExport void collect ( )
Value * apply ( Value **  arglist,
int  count,
CallContext cc = NULL 
)
visible_class ( MappedGeneric  )
90  : public Generic
91 {
92 public:
93  MappedGeneric() { }
ScripterExport MappedGeneric(const MCHAR *name, value_vf fn)
visible_class(Generic) class Generic Generic()
Definition: functions.h:76
ScripterExport MappedGeneric ( const MCHAR name,
value_vf  fn 
)
ScripterExport MappedGeneric ( const MCHAR name,
value_vf  fn,
short  init_flags 
)
MappedGeneric ( const MCHAR name)
96 : Generic(name) { }
Value * name
Definition: structs.h:25
visible_class(Generic) class Generic Generic()
Definition: functions.h:76
classof_methods ( MappedGeneric  ,
Generic   
)
visible_class (NodeGeneric) class NodeGeneric ScripterExport NodeGeneric ( const MCHAR name,
value_vf  fn,
short  init_flags 
)
NodeGeneric ( const MCHAR name)
112 : MappedGeneric(name) { }
Value * name
Definition: structs.h:25
ScripterExport MappedGeneric(const MCHAR *name, value_vf fn)
classof_methods ( NodeGeneric  ,
MappedGeneric   
)
Primitive ( )
137 { flags=0; }
short flags
Definition: functions.h:174
ScripterExport Primitive ( const MCHAR name,
value_cf  fn,
short  init_flags = 0 
)
ScripterExport Primitive ( const MCHAR name,
const MCHAR structure,
value_cf  fn,
short  init_flags = 0 
)
Primitive ( const MCHAR name)
140 : Function(name) { flags=0; }
Value * name
Definition: structs.h:25
Function()
Definition: functions.h:40
short flags
Definition: functions.h:174
classof_methods ( Primitive  ,
Function   
)
visible_class (MappedPrimitive) class MappedPrimitive ScripterExport MappedPrimitive ( const MCHAR name,
value_cf  fn,
short  init_flags 
)
classof_methods ( MappedPrimitive  ,
Primitive   
)
ScripterExport MAXScriptFunction ( const MCHAR name,
int  parm_count,
int  keyparm_count,
Value **  keyparms,
int  local_count,
Value body,
HashTable local_scope,
short  flags = 0 
)
ScripterExport MAXScriptFunction ( const MCHAR name,
int  parm_count,
int  keyparm_count,
Value **  keyparms,
int  local_count,
Value body,
HashTable local_scope,
Array param_names,
Value owner,
short  flags = 0 
)
classof_methods ( MAXScriptFunction  ,
Function   
)
void gc_trace ( )
Value* apply_no_alloc_frame ( Value **  arglist,
int  count,
CallContext cc = NULL 
)
value_cf get_c_callable_fn ( )
Value* operator() ( Value **  arg_list,
int  count 
)
void dump_local_vars_params_and_externals ( Value **  paramsFrame,
Value **  localsFrame,
int  indentLevel 
)
Value* wrap_arg ( Value arg)
protected
ScripterExport UserGenericValue ( Value name,
Value old_fn 
)
protected
classof_methods ( UserGenericValue  ,
Function   
)
protected
InterfaceFunction ( FPInterface fpi,
FPFunctionDef fd 
)
protected
~InterfaceFunction ( )
protected
classof_methods ( InterfaceFunction  ,
Function   
)
protected
Value* get_property ( Value **  arg_list,
int  count 
)
protected
static ScripterExport void val_to_FPValue ( Value v,
ParamType2  type,
FPValue fpv,
FPEnum e,
Tab< void * > *  stringStorage,
Array valueStore 
)
staticprotected
static ScripterExport void val_to_FPValue ( Value v,
ParamType2  type,
FPValue fpv,
FPEnum e,
Tab< void * > *  stringStorage 
)
staticprotected
static ScripterExport void val_to_FPValue ( Value v,
ParamType2  type,
FPValue fpv,
FPEnum e = NULL 
)
staticprotected
static ScripterExport Value* FPValue_to_val ( FPValue fpv,
FPEnum e = NULL 
)
staticprotected
static ScripterExport void release_param ( FPValue fpv,
ParamType2  type,
Value v,
FPEnum e = NULL 
)
staticprotected
static ScripterExport void init_param ( FPValue fpv,
ParamType2  type 
)
staticprotected
static ScripterExport void validate_params ( FPInterface fpi,
FunctionID  fid,
FPParamDef pd,
ParamType2  type,
int  paramNum,
FPValue val,
Value v 
)
staticprotected
static ScripterExport FPEnum* FindEnum ( short  id,
FPInterfaceDesc fpid 
)
staticprotected
visible_class (ActionPredicate) class ActionPredicate ActionPredicate ( FPInterface fpi,
FPFunctionDef fd,
short  pred 
)
protected
classof_methods ( ActionPredicate  ,
Function   
)
protected
visible_class (IObjectValue) class IObjectValue IObjectValue ( IObject io)
protected
~IObjectValue ( )
protected
classof_methods ( IObjectValue  ,
Value   
)
protected
MSTR to_filename ( )
protected
void to_fpvalue ( FPValue v)
protected
467 { v.iobj = iobj; v.type = TYPE_IOBJECT; }
Definition: paramtype.h:95
IObject * iobj
Definition: ifnpub.h:1193
ParamType2 type
Definition: ifnpub.h:1152
def_generic ( show_interfaces  ,
"showInterfaces"   
)
protected
def_generic ( get_interfaces  ,
"getInterfaces"   
)
protected
def_generic ( get_interface  ,
"getInterface"   
)
protected
BaseInterface* GetInterface ( Interface_ID  id)
protected
475 { return iobj->GetInterface(id); }
Value* set_property ( Value **  arg_list,
int  count 
)
protected
ScripterExport FPInterfaceValue ( FPInterface fpi)
protected
FPInterfaceValue ( FPInterfaceProxy *  proxy)
protected
~FPInterfaceValue ( )
protected
classof_methods ( FPInterfaceValue  ,
Value   
)
protected
def_generic ( show_interface  ,
"showInterface"   
)
protected
def_generic ( get_props  ,
"getPropNames"   
)
protected
def_generic ( isDeleted  ,
"isDeleted"   
)
protected
use_generic ( eq  )
protected
use_generic ( ne  )
protected
void InterfaceDeleted ( BaseInterface bi)
protected
531 { UNUSED_PARAM(bi); fpi = NULL; }
#define NULL
Definition: autoptr.h:20
FPInterface * fpi
Definition: functions.h:569
#define UNUSED_PARAM(x)
Definition: BuildWarnings.h:20
Value * _get_property ( Value prop)
protected
Value * _set_property ( Value prop,
Value val 
)
protected
static void UpdateEditorOnResolve ( bool  update = true)
staticprotected
static ScripterExport FPMixinInterfaceValue* intern ( Value prop_name,
Value target 
)
static
static ScripterExport FPMixinInterfaceValue* intern ( FPInterface fpi)
static
classof_methods ( FPMixinInterfaceValue  ,
Value   
)
visible_class (FPStaticMethodInterfaceValue) class FPStaticMethodInterfaceValue ~FPStaticMethodInterfaceValue ( )
static ScripterExport FPStaticMethodInterfaceValue* intern ( FPInterface fpi,
ParamType2  type,
void object 
)
static
classof_methods ( FPStaticMethodInterfaceValue  ,
Value   
)

Variable Documentation

visible_class (Function) class Function const MCHAR* struct_name
short keyparm_count
short flags
Value** keyparms
Value* body
HashTable* local_scope
value_cf c_callable_fn
Array* paramNames
Value* owner
HashTable* props
bool enable_test_interfaces
static
FPInterfaceProxy* m_fpip
bool s_updateEditorOnResolve
static
FPInterface * fpi
static FPMixinInterfaceValue * interface_cache
static
FPValue value