State (PluginInfo &theInfo, Log *theLog) : Plugin (theInfo), RuntimeModule (theInfo), info (theInfo), discovered (False), started (False), levelsHead (0), levelsTail (0), maxLevel (1), log (theLog) { externTable.store (get_plugin_handle (), this); }
dataStruct *get_data (const Handle AttrHandle, const attrStruct *AttrPtr = 0) { dataStruct *ds (0); if (cache && (cache->AttrHandle == AttrHandle)) { ds = cache; } if (!ds) { ds = dataTable.lookup (AttrHandle); if (!ds && AttrPtr && AttrHandle) { ds = new dataStruct (AttrHandle, *AttrPtr); if (!dataTable.store (AttrHandle, ds)) { delete ds; ds = 0; } } if (ds) { cache = ds; } } return ds; }
State (PluginInfo &theInfo, Log *theLog) : Plugin (theInfo), RuntimeModule (theInfo), MessageObserver (theInfo), observerContext (0), convert (theInfo), info (theInfo), discovered (False), started (False), levelsHead (0), levelsTail (0), maxLevel (1), log (theLog) { externTable.store (get_plugin_handle (), this); RuntimeContext *rt = info.get_context (); if (rt) { observerContext = rt->get_plugin_observer_context (); Definitions defs (rt); Message msg; defs.create_message (PluginObserverActivateMessageName, msg); subscribe_to_message (msg); } if (observerContext) { observerContext->ref (); observerContext->moduleTable.store (info.get_handle (), this); } }
dmz::Boolean dmz::JsExtV8Archive::_register_callback ( const Handle Instance, const String &Name, const Handle Archive, V8Object self, V8Function func, HashTableHandleTemplate<CallbackTable> &table) { Boolean result (False); if (Instance && Archive && (func.IsEmpty () == false)) { InstanceStruct *is = _instanceTable.lookup (Instance); if (!is) { is = new InstanceStruct (Instance, Name); if (!_instanceTable.store (Instance, is)) { delete is; is = 0; } } if (is) { CallbackTable *ct = table.lookup (Archive); if (!ct) { ct = new CallbackTable (Archive); if (!table.store (Archive, ct)) { delete ct; ct = 0; } } if (ct) { CallbackStruct *cs = ct->table.lookup (Instance); if (!cs) { cs = new CallbackStruct (*is, *ct); if (ct->table.store (Instance, cs)) { cs->next = is->list; is->list = cs; } else if (cs) { delete cs; cs = 0; } } if (cs) { result = True; cs->self.Dispose (); cs->self.Clear (); cs->func.Dispose (); cs->func.Clear (); cs->self = V8ObjectPersist::New (self); cs->func = V8FunctionPersist::New (func); if (!is_active_archive_handle (Archive)) { activate_archive (Archive); } } } } } return result; }