The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

SQLConnection Class Reference

Represents a connection to a mysql database. More...

Inheritance diagram for SQLConnection:

Inheritance graph
[legend]
Collaboration diagram for SQLConnection:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SQLConnection (const SQLhost &hi, ModuleSQL *Creator)
 ~SQLConnection ()
bool Connect ()
void DoLeadingQuery ()
bool ConnectionLost ()
bool CheckConnection ()
std::string GetError ()
const std::stringGetID ()
std::string GetHost ()
void SetEnable (bool Enable)
bool IsEnabled ()
void Close ()
const SQLhostGetConfHost ()

Public Attributes

QueryQueue queue
ResultQueue rq

Protected Attributes

MYSQL connection
MYSQL_RES * res
MYSQL_ROW row
SQLhost host
std::map< std::string, std::stringthisrow
bool Enabled
ModuleSQLParent

Detailed Description

Represents a connection to a mysql database.

Definition at line 297 of file m_mysql.cpp.


Constructor & Destructor Documentation

SQLConnection::SQLConnection const SQLhost hi,
ModuleSQL Creator
[inline]
 

Definition at line 315 of file m_mysql.cpp.

SQLConnection::~SQLConnection  )  [inline]
 

Definition at line 319 of file m_mysql.cpp.

References Close().


Member Function Documentation

bool SQLConnection::CheckConnection  )  [inline]
 

Definition at line 454 of file m_mysql.cpp.

References Connect(), and ConnectionLost().

Referenced by DoLeadingQuery().

void SQLConnection::Close  )  [inline]
 

Definition at line 487 of file m_mysql.cpp.

References connection.

Referenced by ~SQLConnection().

bool SQLConnection::Connect  )  [inline]
 

Definition at line 326 of file m_mysql.cpp.

References connection, SQLhost::host, host, SQLhost::name, SQLhost::pass, SQLhost::port, and SQLhost::user.

Referenced by CheckConnection().

bool SQLConnection::ConnectionLost  )  [inline]
 

Definition at line 446 of file m_mysql.cpp.

References connection.

Referenced by CheckConnection().

void SQLConnection::DoLeadingQuery  )  [inline]
 

Definition at line 334 of file m_mysql.cpp.

References CheckConnection(), connection, ConvToStr(), SQLresult::dbid, QueryQueue::front(), GetID(), Request::GetSource(), SQLrequest::id, Mutex::Lock(), NotifyMainThread(), SQLquery::p, Parent, SQLquery::q, SQLresult::query, SQLrequest::query, queue, ModuleSQL::QueueMutex, res, ModuleSQL::ResultsMutex, rq, SQL_QREPLY_FAIL, and Mutex::Unlock().

Referenced by DispatcherThread::Run().

const SQLhost& SQLConnection::GetConfHost  )  [inline]
 

Definition at line 492 of file m_mysql.cpp.

References host.

std::string SQLConnection::GetError  )  [inline]
 

Definition at line 462 of file m_mysql.cpp.

References connection.

std::string SQLConnection::GetHost  )  [inline]
 

Definition at line 472 of file m_mysql.cpp.

References SQLhost::host, and host.

const std::string& SQLConnection::GetID  )  [inline]
 

Definition at line 467 of file m_mysql.cpp.

References host, and SQLhost::id.

Referenced by DoLeadingQuery(), and NotifyMainThread().

bool SQLConnection::IsEnabled  )  [inline]
 

Definition at line 482 of file m_mysql.cpp.

References Enabled.

void SQLConnection::SetEnable bool  Enable  )  [inline]
 

Definition at line 477 of file m_mysql.cpp.

References Enabled.


Member Data Documentation

MYSQL SQLConnection::connection [protected]
 

Definition at line 301 of file m_mysql.cpp.

Referenced by Close(), Connect(), ConnectionLost(), DoLeadingQuery(), and GetError().

bool SQLConnection::Enabled [protected]
 

Definition at line 306 of file m_mysql.cpp.

Referenced by IsEnabled(), and SetEnable().

SQLhost SQLConnection::host [protected]
 

Definition at line 304 of file m_mysql.cpp.

Referenced by Connect(), GetConfHost(), GetHost(), and GetID().

ModuleSQL* SQLConnection::Parent [protected]
 

Definition at line 307 of file m_mysql.cpp.

Referenced by DoLeadingQuery().

QueryQueue SQLConnection::queue
 

Definition at line 311 of file m_mysql.cpp.

Referenced by DoLeadingQuery(), and DispatcherThread::Run().

MYSQL_RES* SQLConnection::res [protected]
 

Definition at line 302 of file m_mysql.cpp.

Referenced by DoLeadingQuery().

MYSQL_ROW SQLConnection::row [protected]
 

Definition at line 303 of file m_mysql.cpp.

ResultQueue SQLConnection::rq
 

Definition at line 312 of file m_mysql.cpp.

Referenced by DoLeadingQuery().

std::map<std::string,std::string> SQLConnection::thisrow [protected]
 

Definition at line 305 of file m_mysql.cpp.


The documentation for this class was generated from the following file: