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

ModuleSQL Class Reference

MySQL module. More...

Inheritance diagram for ModuleSQL:

Inheritance graph
[legend]
Collaboration diagram for ModuleSQL:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleSQL (InspIRCd *Me)
 ~ModuleSQL ()
unsigned long NewID ()
const char * OnRequest (Request *request)
 Called whenever a Request class is sent to your module by another module.
void OnRehash (User *user, const std::string &parameter)
 Called on rehash.
Version GetVersion ()
 Returns the version number of a Module.

Public Attributes

ConfigReaderConf
InspIRCdPublicServerInstance
int currid
bool rehashing
DispatcherThreadDispatcher
MutexQueueMutex
MutexResultsMutex
MutexLoggingMutex
MutexConnMutex

Detailed Description

MySQL module.

Definition at line 79 of file m_mysql.cpp.


Constructor & Destructor Documentation

ModuleSQL::ModuleSQL InspIRCd Me  ) 
 

Definition at line 740 of file m_mysql.cpp.

References ModuleManager::Attach(), Conf, ConnMutex, ThreadEngine::Create(), currid, DEBUG, Dispatcher, ModuleManager::DoneWithInterface(), EventHandler::GetFd(), MySQLListener::GetPort(), I_OnRehash, I_OnRequest, Mutex::Lock(), LogManager::Log(), LoggingMutex, InspIRCd::Logs, InspIRCd::Modules, InspIRCd::Mutexes, PublicServerInstance, ModuleManager::PublishFeature(), ModuleManager::PublishInterface(), QueueMutex, ResultsMutex, Module::ServerInstance, InspIRCd::Threads, Mutex::Unlock(), and ModuleManager::UseInterface().

ModuleSQL::~ModuleSQL  ) 
 

Definition at line 795 of file m_mysql.cpp.

References ClearAllConnections(), Conf, ConnMutex, Dispatcher, ModuleManager::DoneWithInterface(), LoggingMutex, InspIRCd::Modules, QueueMutex, ResultsMutex, Module::ServerInstance, ModuleManager::UnpublishFeature(), and ModuleManager::UnpublishInterface().


Member Function Documentation

Version ModuleSQL::GetVersion  )  [virtual]
 

Returns the version number of a Module.

The method should return a Version object with its version information assigned via Version::Version

Reimplemented from Module.

Definition at line 855 of file m_mysql.cpp.

References API_VERSION, VF_SERVICEPROVIDER, and VF_VENDOR.

unsigned long ModuleSQL::NewID  ) 
 

Definition at line 809 of file m_mysql.cpp.

References currid.

Referenced by OnRequest().

void ModuleSQL::OnRehash User user,
const std::string parameter
[virtual]
 

Called on rehash.

This method is called prior to a /REHASH or when a SIGHUP is received from the operating system. You should use it to reload any files so that your module keeps in step with the rest of the application. If a parameter is given, the core has done nothing. The module receiving the event can decide if this parameter has any relevence to it.

Parameters:
user The user performing the rehash, if any -- if this is server initiated, the value of this variable will be NULL.
parameter The (optional) parameter given to REHASH from the user.

Reimplemented from Module.

Definition at line 850 of file m_mysql.cpp.

References rehashing.

const char * ModuleSQL::OnRequest Request request  )  [virtual]
 

Called whenever a Request class is sent to your module by another module.

Please see the documentation of Request::Send() for further information. The Request sent can always be assumed to be non-NULL, you should not change the request object or its data. Your method may return arbitary data in the char* result which the requesting module may be able to use for pre-determined purposes (e.g. the results of an SQL query, etc).

Parameters:
request The Request class being received

Reimplemented from Module.

Definition at line 816 of file m_mysql.cpp.

References Connections, ConnMutex, SQLrequest::dbid, SQLrequest::error, Request::GetId(), SQLerror::Id(), SQLrequest::id, Mutex::Lock(), NewID(), QueueMutex, SQL_BAD_DBID, SQLREQID, SQLSUCCESS, and Mutex::Unlock().


Member Data Documentation

ConfigReader* ModuleSQL::Conf
 

Definition at line 83 of file m_mysql.cpp.

Referenced by ModuleSQL(), DispatcherThread::Run(), and ~ModuleSQL().

Mutex* ModuleSQL::ConnMutex
 

Definition at line 91 of file m_mysql.cpp.

Referenced by LoadDatabases(), ModuleSQL(), Notifier::OnDataReady(), OnRequest(), DispatcherThread::Run(), and ~ModuleSQL().

int ModuleSQL::currid
 

Definition at line 85 of file m_mysql.cpp.

Referenced by ModuleSQL(), and NewID().

DispatcherThread* ModuleSQL::Dispatcher
 

Definition at line 87 of file m_mysql.cpp.

Referenced by ModuleSQL(), and ~ModuleSQL().

Mutex* ModuleSQL::LoggingMutex
 

Definition at line 90 of file m_mysql.cpp.

Referenced by ConnectDatabases(), ModuleSQL(), and ~ModuleSQL().

InspIRCd* ModuleSQL::PublicServerInstance
 

Definition at line 84 of file m_mysql.cpp.

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

Mutex* ModuleSQL::QueueMutex
 

Definition at line 88 of file m_mysql.cpp.

Referenced by SQLConnection::DoLeadingQuery(), ModuleSQL(), OnRequest(), DispatcherThread::Run(), and ~ModuleSQL().

bool ModuleSQL::rehashing
 

Definition at line 86 of file m_mysql.cpp.

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

Mutex* ModuleSQL::ResultsMutex
 

Definition at line 89 of file m_mysql.cpp.

Referenced by SQLConnection::DoLeadingQuery(), ModuleSQL(), Notifier::OnDataReady(), and ~ModuleSQL().


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