- /* map::size_type map::erase( const key_type& key );
- * returns the number of elements removed, std::map
- * is single-associative so this should only be 0 or 1
- */
- if(this->Extension_Items.erase(key))
+ if (this != last_heap)
+ throw CoreException("Reference allocate on the stack!");
+}
+
+refcountbase::~refcountbase()
+{
+ if (refcount && ServerInstance)
+ ServerInstance->Logs->Log("CULLLIST", LOG_DEBUG, "refcountbase::~ @%p with refcount %d",
+ (void*)this, refcount);
+}
+
+usecountbase::~usecountbase()
+{
+ if (usecount && ServerInstance)
+ ServerInstance->Logs->Log("CULLLIST", LOG_DEBUG, "usecountbase::~ @%p with refcount %d",
+ (void*)this, usecount);
+}
+
+ServiceProvider::~ServiceProvider()
+{
+}
+
+ExtensionItem::ExtensionItem(const std::string& Key, ExtensibleType exttype, Module* mod)
+ : ServiceProvider(mod, Key, SERVICE_METADATA)
+ , type(exttype)
+{
+}
+
+ExtensionItem::~ExtensionItem()
+{
+}
+
+void* ExtensionItem::get_raw(const Extensible* container) const
+{
+ Extensible::ExtensibleStore::const_iterator i =
+ container->extensions.find(const_cast<ExtensionItem*>(this));
+ if (i == container->extensions.end())
+ return NULL;
+ return i->second;
+}
+
+void* ExtensionItem::set_raw(Extensible* container, void* value)
+{
+ std::pair<Extensible::ExtensibleStore::iterator,bool> rv =
+ container->extensions.insert(std::make_pair(this, value));
+ if (rv.second)