Go to the
documentation of this file.
00001
00002
00003
00004
00005
00006
00007 #pragma once
00008
00009 #include "..\kernel\value.h"
00010 #include "functions.h"
00011
00012 class HashTabMapper;
00013 class StructMemberThunk;
00014
00015 visible_class_debug_ok (StructDef)
00016
00017 class StructDef : public Value
00018 {
00019 friend StructMemberThunk;
00020 friend Struct;
00021 friend void Function::export_to_scripter();
00022 private:
00023 Value* name;
00024 Value** member_inits;
00025 int member_count;
00026 HashTable* members;
00027 HashTable* member_isPublicAccess;
00028 HashTable* handlers;
00029
00030 public:
00031
00032
00033
00034 ScripterExport StructDef(Value* name, int member_count, Value** inits, HashTable* members, HashTable* member_isPublicAccess, HashTable* handlers);
00035 ~StructDef();
00036 classof_methods (StructDef, Value);
00037 # define is_structdef(v) ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == class_tag(StructDef))
00038
00039 void collect() { delete this; }
00040 void gc_trace();
00041 ScripterExport void sprin1(CharStream* s);
00042
00043 #include "..\macros\define_implementations.h"
00044 def_generic ( get_props, "getPropNames");
00045 def_generic ( show_props, "showProperties");
00046
00047 ScripterExport Value* apply(Value** arglist, int count, CallContext* cc=NULL);
00048 ScripterExport Value* get_property(Value** arg_list, int count);
00049 ScripterExport Value* set_property(Value** arg_list, int count);
00050 ScripterExport bool IsPropertyPublic(Value* prop);
00051 ScripterExport Value* Name();
00052 ScripterExport void map_members(HashTabMapper* mapper);
00053 ScripterExport void map_members(void (*fn)(const void* key, const void* val, void* arg), void* arg);
00054 ScripterExport Value* get_member_value(Value* key);
00055 ScripterExport Value* put_member_value(Value* key, Value* value);
00056 };
00057
00058 class Struct : public Value
00059 {
00060 public:
00061 StructDef* definition;
00062 Value** member_data;
00063
00064 ScripterExport Struct(StructDef* idef, int mem_count);
00065 ~Struct();
00066
00067 # define is_struct(v) ((DbgVerify(!is_sourcepositionwrapper(v)), (v))->tag == INTERNAL_STRUCT_TAG)
00068 Value* classOf_vf(Value** arg_list, int count);
00069 Value* superClassOf_vf(Value** arg_list, int count);
00070 Value* isKindOf_vf(Value** arg_list, int count);
00071 BOOL is_kind_of(ValueMetaClass* c) { return (c == class_tag(StructDef)) ? 1 : Value::is_kind_of(c); }
00072
00073 void collect() { delete this; }
00074 void gc_trace();
00075 ScripterExport void sprin1(CharStream* s);
00076
00077 #include "..\macros\define_implementations.h"
00078 use_generic ( copy, "copy" );
00079 def_generic ( get_props, "getPropNames");
00080 def_generic ( show_props, "showProperties");
00081
00082 Value* get_property(Value** arg_list, int count);
00083 Value* set_property(Value** arg_list, int count);
00084
00085
00086 IOResult Save(ISave* isave);
00087 static Value* Load(ILoad* iload, USHORT chunkID, ValueLoader* vload);
00088
00089
00090 void dump_local_vars(int indentLevel);
00091
00092
00093 Value* call_handler(Value* handler, Value** arg_list, int count);
00094 };
00095
00096