value.h File Reference

Go to the source code of this file.

Classes

class   Value
class   ValueMetaClass
class   Boolean

Defines

#define  def_generic(fn, name)   ScripterExport virtual Value* fn##_vf(Value** arglist, int arg_count);
#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_TAGS   ((ValueMetaClass*)100L)
#define  is_sourcepositionwrapper(v)   ((v)->tag == INTERNAL_SOURCEPOSWRAPPER_TAG)
#define  is_bool(v)   ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == &Boolean_class)

Functions

Value heap_ptr (Value *v)
Value live_ptr (Value *v)
  visible_class_debug_ok (Value) visible_class_debug_ok(Boolean) class Boolean
  visible_class_debug_ok (Undefined) class Undefined
  visible_class_debug_ok (Ok) class Ok
  visible_class_debug_ok (Empty) class Empty
  visible_class_debug_ok (Unsupplied) class Unsupplied

Variables

ScripterExport Undefined  undefined
ScripterExport bool  dontThrowAccessorError
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

Define Documentation

#define def_generic (   fn,
  name 
)    ScripterExport virtual Value* fn##_vf(Value** arglist, int arg_count);

Definition at line 166 of file value.h.

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

Definition at line 298 of file value.h.

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

Definition at line 311 of file value.h.

#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) ?         \
            &true_value :                               \
            _super::isKindOf_vf(arg_list, count);       \
    }                                                   \
    BOOL is_kind_of(ValueMetaClass* c)                  \
    {                                                   \
        return (c == &_cls##_class) ? 1                 \
                    : _super::is_kind_of(c);            \
    }

Definition at line 313 of file value.h.

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

Definition at line 339 of file value.h.

#define visible_class_debug_ok (   _cls )
Value:
class _cls##Class : public ValueMetaClass                           \
    {                                                                   \
    public:                                                             \
                    _cls##Class(MCHAR* name) : ValueMetaClass (name) { flags3 |= VALUE_FLAGBIT_0; } \
        void        collect() { delete this; }                          \
    };                                                                  \
    extern ScripterExport _cls##Class _cls##_class;

Definition at line 348 of file value.h.

#define visible_class_s (   _cls,
  _super 
)
Value:
class _cls##Class : public ValueMetaClass                           \
    {                                                                   \
    public:                                                             \
                    _cls##Class(MCHAR* name) : ValueMetaClass (name) { }    \
        void        collect() { delete this; }                          \
        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);                  \
        }                                                               \
    };                                                                  \
    extern ScripterExport _cls##Class _cls##_class;

Definition at line 357 of file value.h.

#define applyable_class (   _cls )
Value:
class _cls##Class : public ValueMetaClass                           \
    {                                                                   \
    public:                                                             \
                    _cls##Class(MCHAR* name) : ValueMetaClass (name) { }\
        void        collect() { delete this; }                          \
        ScripterExport Value* apply(Value** arglist, int count, CallContext* cc=NULL); \
    };                                                                  \
    extern ScripterExport _cls##Class _cls##_class;

Definition at line 378 of file value.h.

#define applyable_class_debug_ok (   _cls )
Value:
class _cls##Class : public ValueMetaClass                           \
    {                                                                   \
    public:                                                             \
                    _cls##Class(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;

Definition at line 388 of file value.h.

#define applyable_class_s (   _cls,
  _super 
)
Value:
class _cls##Class : public ValueMetaClass                           \
    {                                                                   \
    public:                                                             \
                    _cls##Class(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;

Definition at line 398 of file value.h.

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

Definition at line 420 of file value.h.

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

Definition at line 423 of file value.h.

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

Definition at line 433 of file value.h.

#define class_tag (   _cls )    &_cls##_class

Definition at line 437 of file value.h.

#define INTERNAL_CLASS_TAG   ((ValueMetaClass*)0L)

Definition at line 439 of file value.h.

#define INTERNAL_INDEX_THUNK_TAG   ((ValueMetaClass*)1L)

Definition at line 440 of file value.h.

#define INTERNAL_PROP_THUNK_TAG   ((ValueMetaClass*)2L)

Definition at line 441 of file value.h.

#define INTERNAL_LOCAL_THUNK_TAG   ((ValueMetaClass*)3L)

Definition at line 442 of file value.h.

#define INTERNAL_FREE_THUNK_TAG   ((ValueMetaClass*)4L)

Definition at line 443 of file value.h.

#define INTERNAL_RO_LOCAL_THUNK_TAG   ((ValueMetaClass*)5L)

Definition at line 444 of file value.h.

#define INTERNAL_CODE_TAG   ((ValueMetaClass*)6L)

Definition at line 445 of file value.h.

#define INTERNAL_SOURCEFILEWRAPPER_TAG   ((ValueMetaClass*)7L)

Definition at line 446 of file value.h.

#define INTERNAL_PIPE_TAG   ((ValueMetaClass*)8L)

Definition at line 447 of file value.h.

#define INTERNAL_TOOL_LOCAL_THUNK_TAG   ((ValueMetaClass*)9L)

Definition at line 448 of file value.h.

#define INTERNAL_GLOBAL_THUNK_TAG   ((ValueMetaClass*)10L)

Definition at line 449 of file value.h.

#define INTERNAL_CONST_GLOBAL_THUNK_TAG   ((ValueMetaClass*)11L)

Definition at line 450 of file value.h.

#define INTERNAL_SYS_GLOBAL_THUNK_TAG   ((ValueMetaClass*)12L)

Definition at line 451 of file value.h.

#define INTERNAL_PLUGIN_LOCAL_THUNK_TAG   ((ValueMetaClass*)13L)

Definition at line 452 of file value.h.

#define INTERNAL_PLUGIN_PARAM_THUNK_TAG   ((ValueMetaClass*)14L)

Definition at line 453 of file value.h.

#define INTERNAL_RCMENU_LOCAL_THUNK_TAG   ((ValueMetaClass*)15L)

Definition at line 454 of file value.h.

#define INTERNAL_STRUCT_MEM_THUNK_TAG   ((ValueMetaClass*)16L)

Definition at line 455 of file value.h.

#define INTERNAL_MSPLUGIN_TAG   ((ValueMetaClass*)17L)

Definition at line 456 of file value.h.

#define INTERNAL_STRUCT_TAG   ((ValueMetaClass*)18L)

Definition at line 457 of file value.h.

#define INTERNAL_MAKER_TAG   ((ValueMetaClass*)19L)

Definition at line 458 of file value.h.

#define INTERNAL_CODEBLOCK_LOCAL_TAG   ((ValueMetaClass*)20L)

Definition at line 459 of file value.h.

#define INTERNAL_CODEBLOCK_TAG   ((ValueMetaClass*)21L)

Definition at line 460 of file value.h.

#define INTERNAL_THUNK_REF_TAG   ((ValueMetaClass*)22L)

Definition at line 461 of file value.h.

#define INTERNAL_THUNK_DEREF_TAG   ((ValueMetaClass*)23L)

Definition at line 462 of file value.h.

#define INTERNAL_STRUCT_METHOD_TAG   ((ValueMetaClass*)24L)

Definition at line 463 of file value.h.

#define INTERNAL_MSPLUGIN_METHOD_TAG   ((ValueMetaClass*)25L)

Definition at line 464 of file value.h.

#define INTERNAL_CONTEXT_THUNK_TAG   ((ValueMetaClass*)26L)

Definition at line 465 of file value.h.

#define INTERNAL_OWNER_THUNK_TAG   ((ValueMetaClass*)27L)

Definition at line 466 of file value.h.

#define INTERNAL_RCMENU_ITEM_THUNK_TAG   ((ValueMetaClass*)28L)

Definition at line 467 of file value.h.

#define INTERNAL_STANDINMSPLUGINCLASS_TAG   ((ValueMetaClass*)29L)

Definition at line 468 of file value.h.

#define INTERNAL_SOURCEPOSWRAPPER_TAG   ((ValueMetaClass*)30L)

Definition at line 469 of file value.h.

#define INTERNAL_TAGS   ((ValueMetaClass*)100L)

Definition at line 471 of file value.h.

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

Definition at line 496 of file value.h.


Function Documentation

Value* heap_ptr ( Value v ) [inline]

Definition at line 273 of file value.h.

{ return v ? v->get_heap_ptr() : NULL; }    // ensure v is in heap, migrate if not, return heap pointer
Value* live_ptr ( Value v ) [inline]

Definition at line 274 of file value.h.

{ return  v->get_live_ptr(); }              // get live pointer, if on stack & migrated, heap copy is live
visible_class_debug_ok ( Value  )
visible_class_debug_ok ( Undefined  )

Definition at line 509 of file value.h.

                : public Value
{
public:
            Undefined() { tag = &Undefined_class; }
            classof_methods (Undefined, Value);
    void    collect() { delete this; }
    ScripterExport void sprin1(CharStream* s);
    Value*  copy_vf(Value** arg_list, int count) { return this; }

    // scene I/O 
    IOResult Save(ISave* isave);
    static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
    Mtl*    to_mtl() { return NULL; }       // undefined is a NULL material
    void    to_fpvalue(FPValue& v);
};
visible_class_debug_ok ( Ok  )

Definition at line 533 of file value.h.

         : public Value
{
public:
            Ok() { tag = &Ok_class; }
            classof_methods (Ok, Value);
    void    collect() { delete this; }
    ScripterExport void sprin1(CharStream* s);
    Value*  copy_vf(Value** arg_list, int count) { return this; }

    // scene I/O 
    IOResult Save(ISave* isave);
    static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
    void    to_fpvalue(FPValue& v);
};
visible_class_debug_ok ( Empty  )

Definition at line 554 of file value.h.

            : public Value
{
public:
            Empty() { tag = &Empty_class; }
            classof_methods (Empty, Value);
    void    collect() { delete this; }
    ScripterExport void sprin1(CharStream* s);
    Value*  copy_vf(Value** arg_list, int count) { return this; }

    // scene I/O 
    IOResult Save(ISave* isave);
    static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
    void    to_fpvalue(FPValue& v);
};
visible_class_debug_ok ( Unsupplied  )

Definition at line 575 of file value.h.

                 : public Value
{
public:
            Unsupplied() { tag = &Unsupplied_class; }
            classof_methods (Unsupplied, Value);
    void    collect() { delete this; }
    ScripterExport void sprin1(CharStream* s);
    Value*  copy_vf(Value** arg_list, int count) { return this; }

    // scene I/O 
    IOResult Save(ISave* isave);
    static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
    void    to_fpvalue(FPValue& v);
};

Variable Documentation

ScripterExport Undefined undefined

Definition at line 525 of file value.h.

ScripterExport Undefined dontCollect
ScripterExport Undefined loopExit
ScripterExport Ok ok
ScripterExport Empty empty
ScripterExport Unsupplied unsupplied