2 #include "inspircd_config.h"
7 bool Extensible::Extend(std::string key, VoidPointer p)
9 // only add an item if it doesnt already exist
10 if (this->Extension_Items.find(key) == this->Extension_Items.end())
12 this->Extension_Items[key] == p;
15 // item already exists, return false
19 bool Extensible::Shrink(std::string key)
21 // only attempt to remove a map item that exists
22 if (this->Extension_Items.find(key) != this->Extension_Items.end())
24 this->Extension_Items.erase(this->Extension_Items.find(key));
30 VoidPointer Extensible::GetExt(std::string key)
32 if (this->Extension_Items.find(key) != this->Extension_Items.end())
34 return (this->Extension_Items.find(key))->second;