- private:
- ConnMap connections;
- unsigned long currid;
-
- public:
- ModuleSQLite3(InspIRCd* Me)
- : Module::Module(Me), currid(0)
- {
- ServerInstance->Modules->UseInterface("SQLutils");
-
- if (!ServerInstance->Modules->PublishFeature("SQL", this))
- {
- throw ModuleException("m_sqlite3: Unable to publish feature 'SQL'");
- }
-
- resultnotify = new ResultNotifier(ServerInstance, this);
-
- ReadConf();
-
- ServerInstance->Modules->PublishInterface("SQL", this);
- }
-
- virtual ~ModuleSQLite3()
- {
- ClearQueue();
- ClearAllConnections();
- resultnotify->SetFd(-1);
- resultnotify->state = I_ERROR;
- resultnotify->OnError(I_ERR_SOCKET);
- resultnotify->ClosePending = true;
- delete resultnotify;
- ServerInstance->Modules->UnpublishInterface("SQL", this);
- ServerInstance->Modules->UnpublishFeature("SQL");
- ServerInstance->Modules->DoneWithInterface("SQLutils");
- }
-
- void Implements(char* List)
- {
- List[I_OnRequest] = List[I_OnRehash] = 1;
- }
-
- void SendQueue()
- {
- for (ConnMap::iterator iter = connections.begin(); iter != connections.end(); iter++)
- {
- iter->second->SendResults();
- }
- }
-
- void ClearQueue()
- {
- for (ConnMap::iterator iter = connections.begin(); iter != connections.end(); iter++)
- {
- iter->second->ClearResults();
- }
- }