void cConfMySQL::AddPrimaryKey(const char *key) { string Key(key); tItemHashType Hash = msHasher(Key); cConfigItemBase *item = mhItems.GetByHash(Hash); if (item != NULL) mPrimaryKey.AddWithHash(item, Hash); }
/** add existing item pointed by the argument at the end of mvItems , and bind a nick to it*/ cConfigItemBase * cConfigBaseBase::Add(const string &nick, cConfigItemBase *ci) { tItemHashType Hash = msHasher(nick); if (!mhItems.AddWithHash(ci, Hash)) { if (Log(1)) { cConfigItemBase *other = mhItems.GetByHash(Hash); LogStream() << "Error adding " << nick << " because of " << (other ? other->mName.c_str() : "NULL") << endl; } } mvItems.push_back(Hash); ci->mName = nick; return ci; }
cConfigItemBase * cConfigBaseBase::operator[](const string &n) { tItemHashType Hash = msHasher(n); return mhItems.GetByHash(Hash); }