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

ModuleMsSQL Class Reference

Inheritance diagram for ModuleMsSQL:

Inheritance graph
[legend]
Collaboration diagram for ModuleMsSQL:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleMsSQL (InspIRCd *Me)
virtual ~ModuleMsSQL ()
void SendQueue ()
void ClearQueue ()
bool HasHost (const SQLhost &host)
bool HostInConf (const SQLhost &h)
void ReadConf ()
void AddConn (const SQLhost &hi)
void ClearOldConnections ()
void ClearAllConnections ()
virtual void OnRehash (User *user, const std::string &parameter)
 Called on rehash.
virtual const char * OnRequest (Request *request)
 Called whenever a Request class is sent to your module by another module.
unsigned long NewID ()
virtual Version GetVersion ()
 Returns the version number of a Module.

Private Attributes

unsigned long currid
QueryThreadqueryDispatcher

Detailed Description

Definition at line 656 of file m_mssql.cpp.


Constructor & Destructor Documentation

ModuleMsSQL::ModuleMsSQL InspIRCd Me  )  [inline]
 

Definition at line 663 of file m_mssql.cpp.

References ModuleManager::Attach(), ThreadEngine::Create(), DEBUG, ModuleManager::DoneWithInterface(), EventHandler::GetFd(), MsSQLListener::GetPort(), I_OnRehash, I_OnRequest, Mutex::Lock(), LogManager::Log(), InspIRCd::Logs, InspIRCd::Modules, InspIRCd::Mutexes, ModuleManager::PublishFeature(), ModuleManager::PublishInterface(), queryDispatcher, ReadConf(), Module::ServerInstance, InspIRCd::Threads, Mutex::Unlock(), and ModuleManager::UseInterface().

virtual ModuleMsSQL::~ModuleMsSQL  )  [inline, virtual]
 

Definition at line 706 of file m_mssql.cpp.

References InspIRCd::BufferedSocketCull(), ClearAllConnections(), ClearQueue(), SocketEngine::DelFd(), ModuleManager::DoneWithInterface(), InspIRCd::Modules, queryDispatcher, QueueFD, InspIRCd::SE, Module::ServerInstance, ModuleManager::UnpublishFeature(), and ModuleManager::UnpublishInterface().


Member Function Documentation

void ModuleMsSQL::AddConn const SQLhost hi  )  [inline]
 

Definition at line 805 of file m_mssql.cpp.

References connections, DEFAULT, HasHost(), SQLhost::id, Mutex::Lock(), LogManager::Log(), InspIRCd::Logs, Module::ServerInstance, and Mutex::Unlock().

Referenced by ReadConf().

void ModuleMsSQL::ClearAllConnections  )  [inline]
 

Definition at line 837 of file m_mssql.cpp.

References connections.

Referenced by ~ModuleMsSQL().

void ModuleMsSQL::ClearOldConnections  )  [inline]
 

Definition at line 822 of file m_mssql.cpp.

References connections, and HostInConf().

Referenced by ReadConf().

void ModuleMsSQL::ClearQueue  )  [inline]
 

Definition at line 746 of file m_mssql.cpp.

References connections.

Referenced by ~ModuleMsSQL().

virtual Version ModuleMsSQL::GetVersion  )  [inline, 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 892 of file m_mssql.cpp.

References API_VERSION, VF_SERVICEPROVIDER, and VF_VENDOR.

bool ModuleMsSQL::HasHost const SQLhost host  )  [inline]
 

Definition at line 754 of file m_mssql.cpp.

References connections.

Referenced by AddConn(), and ReadConf().

bool ModuleMsSQL::HostInConf const SQLhost h  )  [inline]
 

Definition at line 764 of file m_mssql.cpp.

References conf, ConfigReader::Enumerate(), SQLhost::host, SQLhost::id, SQLhost::name, SQLhost::pass, SQLhost::port, ConfigReader::ReadInteger(), ConfigReader::ReadValue(), Module::ServerInstance, and SQLhost::user.

Referenced by ClearOldConnections().

unsigned long ModuleMsSQL::NewID  )  [inline]
 

Definition at line 884 of file m_mssql.cpp.

References currid.

Referenced by OnRequest().

virtual void ModuleMsSQL::OnRehash User user,
const std::string parameter
[inline, 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 847 of file m_mssql.cpp.

References Mutex::Lock(), ReadConf(), and Mutex::Unlock().

virtual const char* ModuleMsSQL::OnRequest Request request  )  [inline, 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 854 of file m_mssql.cpp.

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

void ModuleMsSQL::ReadConf  )  [inline]
 

Definition at line 782 of file m_mssql.cpp.

References AddConn(), ClearOldConnections(), conf, ConfigReader::Enumerate(), HasHost(), SQLhost::host, SQLhost::id, SQLhost::name, SQLhost::pass, SQLhost::port, ConfigReader::ReadInteger(), ConfigReader::ReadValue(), Module::ServerInstance, and SQLhost::user.

Referenced by ModuleMsSQL(), and OnRehash().

void ModuleMsSQL::SendQueue  )  [inline]
 

Definition at line 738 of file m_mssql.cpp.

References connections.

Referenced by ResultNotifier::Dispatch().


Member Data Documentation

unsigned long ModuleMsSQL::currid [private]
 

Definition at line 659 of file m_mssql.cpp.

Referenced by NewID().

QueryThread* ModuleMsSQL::queryDispatcher [private]
 

Definition at line 660 of file m_mssql.cpp.

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


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