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

ModuleSQLite3 Class Reference

Inheritance diagram for ModuleSQLite3:

Inheritance graph
[legend]
Collaboration diagram for ModuleSQLite3:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleSQLite3 (InspIRCd *Me)
virtual ~ModuleSQLite3 ()
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

ConnMap connections
unsigned long currid

Detailed Description

Definition at line 475 of file m_sqlite3.cpp.


Constructor & Destructor Documentation

ModuleSQLite3::ModuleSQLite3 InspIRCd Me  )  [inline]
 

Definition at line 482 of file m_sqlite3.cpp.

References ModuleManager::Attach(), DEBUG, ModuleManager::DoneWithInterface(), EventHandler::GetFd(), SQLiteListener::GetPort(), I_OnRehash, I_OnRequest, LogManager::Log(), InspIRCd::Logs, InspIRCd::Modules, ModuleManager::PublishFeature(), ModuleManager::PublishInterface(), ReadConf(), Module::ServerInstance, and ModuleManager::UseInterface().

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

Definition at line 516 of file m_sqlite3.cpp.

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


Member Function Documentation

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

Definition at line 610 of file m_sqlite3.cpp.

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

Referenced by ReadConf().

void ModuleSQLite3::ClearAllConnections  )  [inline]
 

Definition at line 640 of file m_sqlite3.cpp.

References connections.

Referenced by ~ModuleSQLite3().

void ModuleSQLite3::ClearOldConnections  )  [inline]
 

Definition at line 625 of file m_sqlite3.cpp.

References connections, and HostInConf().

Referenced by ReadConf().

void ModuleSQLite3::ClearQueue  )  [inline]
 

Definition at line 551 of file m_sqlite3.cpp.

References connections.

Referenced by ~ModuleSQLite3().

virtual Version ModuleSQLite3::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 684 of file m_sqlite3.cpp.

References API_VERSION, VF_SERVICEPROVIDER, and VF_VENDOR.

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

Definition at line 559 of file m_sqlite3.cpp.

References connections.

Referenced by AddConn(), and ReadConf().

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

Definition at line 569 of file m_sqlite3.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 ModuleSQLite3::NewID  )  [inline]
 

Definition at line 676 of file m_sqlite3.cpp.

References currid.

Referenced by OnRequest().

virtual void ModuleSQLite3::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 650 of file m_sqlite3.cpp.

References ReadConf().

virtual const char* ModuleSQLite3::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 655 of file m_sqlite3.cpp.

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

void ModuleSQLite3::ReadConf  )  [inline]
 

Definition at line 587 of file m_sqlite3.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 ModuleSQLite3(), and OnRehash().

void ModuleSQLite3::SendQueue  )  [inline]
 

Definition at line 543 of file m_sqlite3.cpp.

References connections.


Member Data Documentation

ConnMap ModuleSQLite3::connections [private]
 

Definition at line 478 of file m_sqlite3.cpp.

Referenced by AddConn(), ClearAllConnections(), ClearOldConnections(), ClearQueue(), HasHost(), OnRequest(), and SendQueue().

unsigned long ModuleSQLite3::currid [private]
 

Definition at line 479 of file m_sqlite3.cpp.

Referenced by NewID().


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