本文整理汇总了C++中ConnMap::end方法的典型用法代码示例。如果您正苦于以下问题:C++ ConnMap::end方法的具体用法?C++ ConnMap::end怎么用?C++ ConnMap::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConnMap
的用法示例。
在下文中一共展示了ConnMap::end方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadConf
void ReadConf()
{
ConnMap conns;
ConfigTagList tags = ServerInstance->Config->ConfTags("database");
for(ConfigIter i = tags.first; i != tags.second; i++)
{
if (i->second->getString("module", "pgsql") != "pgsql")
continue;
std::string id = i->second->getString("id");
ConnMap::iterator curr = connections.find(id);
if (curr == connections.end())
{
SQLConn* conn = new SQLConn(this, i->second);
conns.insert(std::make_pair(id, conn));
ServerInstance->Modules->AddService(*conn);
}
else
{
conns.insert(*curr);
connections.erase(curr);
}
}
ClearAllConnections();
conns.swap(connections);
}
示例2: ClearQueue
void ClearQueue()
{
for (ConnMap::iterator iter = connections.begin(); iter != connections.end(); iter++)
{
iter->second->ClearResults();
}
}
示例3: ClearAllConnections
void ClearAllConnections()
{
for(ConnMap::iterator i = connections.begin(); i != connections.end(); i++)
{
i->second->cull();
delete i->second;
}
connections.clear();
}
示例4: ClearAllConnections
void ClearAllConnections()
{
ConnMap::iterator i;
while ((i = connections.begin()) != connections.end())
{
connections.erase(i);
delete i->second;
}
}
示例5: HasHost
bool HasHost(const SQLhost &host)
{
for (ConnMap::iterator iter = connections.begin(); iter != connections.end(); iter++)
{
if (host == iter->second->GetConfHost())
return true;
}
return false;
}
示例6: ClearConns
void ClearConns()
{
for(ConnMap::iterator i = conns.begin(); i != conns.end(); i++)
{
SQLConn* conn = i->second;
ServerInstance->Modules->DelService(*conn);
delete conn;
}
conns.clear();
}
示例7: OnUnloadModule
virtual void OnUnloadModule(Module* mod, const std::string& name)
{
/* When a module unloads we have to check all the pending queries for all our connections
* and set the Module* specifying where the query came from to NULL. If the query has already
* been dispatched then when it is processed it will be dropped if the pointer is NULL.
*
* If the queries we find are not already being executed then we can simply remove them immediately.
*/
for(ConnMap::iterator iter = connections.begin(); iter != connections.end(); iter++)
{
iter->second->OnUnloadModule(mod);
}
}
示例8: ReconnectConn
void ReconnectConn(SQLConn* conn)
{
for (ConnMap::iterator iter = connections.begin(); iter != connections.end(); iter++)
{
if (conn == iter->second)
{
delete iter->second;
connections.erase(iter);
break;
}
}
retimer = new ReconnectTimer(ServerInstance, this);
ServerInstance->Timers->AddTimer(retimer);
}
示例9: ClearOldConnections
void ClearOldConnections()
{
ConnMap::iterator iter,safei;
for (iter = connections.begin(); iter != connections.end(); iter++)
{
if (!HostInConf(iter->second->GetConfHost()))
{
delete iter->second;
safei = iter;
--iter;
connections.erase(safei);
}
}
}
示例10: OnRequest
virtual const char* OnRequest(Request* request)
{
if(strcmp(SQLREQID, request->GetId()) == 0)
{
SQLrequest* req = (SQLrequest*)request;
ConnMap::iterator iter;
if((iter = connections.find(req->dbid)) != connections.end())
{
req->id = NewID();
req->error = iter->second->Query(*req);
return SQLSUCCESS;
}
else
{
req->error.Id(SQL_BAD_DBID);
return NULL;
}
}
return NULL;
}
示例11: OnRequest
virtual const char* OnRequest(Request* request)
{
if(strcmp(SQLREQID, request->GetId()) == 0)
{
SQLrequest* req = (SQLrequest*)request;
ConnMap::iterator iter;
if((iter = connections.find(req->dbid)) != connections.end())
{
/* Execute query */
req->id = NewID();
req->error = iter->second->Query(*req);
return (req->error.Id() == SQL_NO_ERROR) ? sqlsuccess : NULL;
}
else
{
req->error.Id(SQL_BAD_DBID);
return NULL;
}
}
return NULL;
}