internal override void AttachSingleton(RObjectBase obj) { if (iv_tbl == null) { iv_tbl = new st_table(); } iv_tbl[ruby.intern("__attached__")] = obj; }
public override object IVarSet(uint uid, object val) { IVarCheck(); if (iv_tbl == null) { iv_tbl = new st_table(); } iv_tbl[uid] = val; return(val); }
internal RMetaObject(NetRuby rb, string name, RMetaObject sp, RMetaObject meta) : base(rb, meta) { super = sp; m_tbl = new st_table(); if (name != null) { uint id = rb.intern(name); IVarSet("__classid__", Symbol.ID2SYM(id)); } }
internal object FindClassPath() { fc_result arg = new fc_result(0, this, ruby.cObject, null); if (ruby.cObject.iv_tbl != null) { lock (ruby.cObject.iv_tbl.SyncRoot) { foreach (DictionaryEntry entry in ruby.cObject.iv_tbl) { if (fc_i((uint)entry.Key, entry.Value, arg)) { break; } } } } if (arg.path == null) { lock (ruby.class_tbl.SyncRoot) { foreach (DictionaryEntry entry in ruby.class_tbl) { if (fc_i((uint)entry.Key, entry.Value, arg)) { break; } } } } if (arg.path != null) { lock (this) { if (iv_tbl == null) { iv_tbl = new st_table(); } iv_tbl[ruby.intern("__classpath__")] = arg.path; } } return((string)arg.path); }
internal object LocalASet(uint key, object val) { lock (this) { if (locals == null) { locals = new st_table(); } if (val == null) { locals.Remove(id); } else { locals[id] = val; } } return(val); }
void valSet(uint id, object val, bool isconst) { string dest = (isconst) ? "constant" : "class variable"; CVarCheck(dest); lock (this) { if (iv_tbl == null) { iv_tbl = new st_table(); } else if (isconst) { if (iv_tbl.ContainsKey(id) || (this == ruby.cObject && ruby.class_tbl.ContainsKey(id))) { ruby.warn(String.Format("already initialized {0} {1}", dest, ruby.id2name(id))); } } iv_tbl[id] = val; } }