#include <plugin.h>
Public Member Functions | |
Plugin () | |
Constructor. | |
virtual | ~Plugin () |
Destructor. | |
vector< StructFunctionStorage > | getFunctions () |
Return plugin functions. | |
string | getAuthor () |
Return author. | |
string | getDescription () |
Return description. | |
string | getVersion () |
Return version. | |
string | getName () |
Return name. | |
bool | checkMembers () |
Check if all members are given. | |
void | bindFunction (string, func_type, string, time_t, unsigned int) |
Register a plugin function. | |
void * | getHandle () |
Get plugin's handle. | |
void | setHandle (void *) |
Set plugin's handle. | |
void | addRequirement (string) |
Add a plugin that is required for the plugin. | |
vector< string > | getRequirements () |
Get requirements list. | |
bool | requires (string) |
Tell if this plugin requires an other one. | |
Protected Attributes | |
string | author |
Plugin author. | |
string | description |
Plugin descritpion. | |
string | version |
Plugin version. | |
string | name |
Plugin name. | |
vector< StructFunctionStorage > | funcs |
PLugins functions. | |
void * | handle |
Stores plugin's handle. | |
vector< string > | requirements |
stores plugins names that are required for the plugin |
This class is a plugin head witch all the plugin class must derive. It contains function to get functions from the plugin, and check if all informations are given
Definition at line 83 of file plugin.h.
Plugin::Plugin | ( | ) |
Constructor.
Class constructor Initialize private attributes
Definition at line 35 of file plugin.cpp.
References author, description, funcs, handle, name, requirements, and version.
Plugin::~Plugin | ( | ) | [virtual] |
void Plugin::addRequirement | ( | string | plugin | ) |
Add a plugin that is required for the plugin.
Add a requirement for this plugin. It means that to load this plugin the requirement will have to be loaded before.
plugin | Plugin that is required |
Definition at line 163 of file plugin.cpp.
References requirements.
Referenced by Advertising::Advertising(), AntiFlood::AntiFlood(), FedoraProject::FedoraProject(), Ignore::Ignore(), Lamoule::Lamoule(), LogFactory::LogFactory(), Moderation::Moderation(), Module::Module(), Quotes::Quotes(), and Survey::Survey().
void Plugin::bindFunction | ( | string | highlightedWord, | |
func_type | type, | |||
string | symbole, | |||
time_t | lastExec, | |||
unsigned int | timeout | |||
) |
Register a plugin function.
Bind a plugin function. Called in plugin constructor, it initialise the function registration (before kernel). Used after plugin constructor has no effect (use kernel -> registerFunction instead)
highlightedWord | Highlighted word (command), or time between two executions in seconds ( for IN_LOOP plugins ) | |
type | Function type | |
symbole | function name to execute | |
lastExec | last time plugin was executed | |
timeout | Timeout for function (in seconds) |
Definition at line 126 of file plugin.cpp.
References funcs, StructFunctionStorage::function, StructFunctionStorage::handle, StructFunctionStorage::highlightedWord, StructFunctionStorage::lastExec, StructFunctionStorage::object, StructFunctionStorage::symbole, StructFunctionStorage::timeout, and StructFunctionStorage::type.
Referenced by Admin::Admin(), Advertising::Advertising(), AntiFlood::AntiFlood(), BZRH::BZRH(), CTCP::CTCP(), DansTonChat::DansTonChat(), Fedorafr::Fedorafr(), FedoraProject::FedoraProject(), GameServer::GameServer(), Ignore::Ignore(), Infos::Infos(), IpConverting::IpConverting(), Lamoule::Lamoule(), LogFactory::LogFactory(), Magic8Ball::Magic8Ball(), Moderation::Moderation(), Module::Module(), Ping::Ping(), PluginSample::PluginSample(), PostConnect::PostConnect(), Quotes::Quotes(), RemoteControl::RemoteControl(), Slapme::Slapme(), Survey::Survey(), Tele::Tele(), Trad::Trad(), and UsersInfos::UsersInfos().
bool Plugin::checkMembers | ( | ) |
Check if all members are given.
Check if all attributes have benn completed
Definition at line 102 of file plugin.cpp.
References funcs, getAuthor(), getDescription(), getName(), and getVersion().
Referenced by BotKernel::loadPlugin().
string Plugin::getAuthor | ( | ) |
Return author.
Get plugin author
Definition at line 57 of file plugin.cpp.
References author.
Referenced by checkMembers(), and moduleinfos().
string Plugin::getDescription | ( | ) |
Return description.
Get plugin description
Definition at line 66 of file plugin.cpp.
References description.
Referenced by checkMembers(), and moduleinfos().
vector< StructFunctionStorage > Plugin::getFunctions | ( | ) |
Return plugin functions.
Return shared functions
Definition at line 93 of file plugin.cpp.
References funcs.
Referenced by BotKernel::loadPlugin().
void * Plugin::getHandle | ( | ) |
Get plugin's handle.
Get plugin's handle
Definition at line 144 of file plugin.cpp.
References handle.
Referenced by BotKernel::addCountDown(), and BotKernel::registerFunction().
string Plugin::getName | ( | ) |
Return name.
Get plugin name
Definition at line 84 of file plugin.cpp.
References name.
Referenced by addsuperadmin(), addtempsuperadmin(), autoop(), autovoice(), ban(), banmask(), bannedHandler(), bzsearch(), checkBug(), checkMembers(), danstonchat(), deletekey(), delsuperadmin(), getMyFirstNick(), help(), joinHandler(), kickHandler(), lamoule(), launchSurvey(), BotKernel::loadPlugin(), modeHandler(), modeHandlerProtect(), onEndOfMOTD(), planet(), player(), protectmodes(), protecttopic(), purifyFile(), randomKick(), rejoinChan(), RemoteControl::RemoteControl(), secondaryNick(), setconfvalue(), setSuperAdminPass(), testMsgTimestamp(), top5(), topicHandler(), toptotal(), unautoop(), unautovoice(), unprotectmodes(), unprotecttopic(), and wiki().
vector< string > Plugin::getRequirements | ( | ) |
Get requirements list.
Get requirements list.
Definition at line 172 of file plugin.cpp.
References requirements.
Referenced by BotKernel::loadPlugin().
string Plugin::getVersion | ( | ) |
Return version.
Get plugin version
Definition at line 75 of file plugin.cpp.
References version.
Referenced by checkMembers(), and moduleinfos().
bool Plugin::requires | ( | string | plugin | ) |
Tell if this plugin requires an other one.
Tell if this plugin requires an other one.
plugin | Plugin to test |
Definition at line 182 of file plugin.cpp.
References Tools::isInVector(), and requirements.
void Plugin::setHandle | ( | void * | handle | ) |
Set plugin's handle.
Set plugin's handle
handle | Plugin's handle |
Definition at line 153 of file plugin.cpp.
Referenced by BotKernel::loadPlugin().
string Plugin::author [protected] |
Plugin author.
Definition at line 86 of file plugin.h.
Referenced by Admin::Admin(), Advertising::Advertising(), AntiFlood::AntiFlood(), BZRH::BZRH(), CTCP::CTCP(), DansTonChat::DansTonChat(), Fedorafr::Fedorafr(), FedoraProject::FedoraProject(), GameServer::GameServer(), getAuthor(), Ignore::Ignore(), Infos::Infos(), IpConverting::IpConverting(), Lamoule::Lamoule(), LogFactory::LogFactory(), Magic8Ball::Magic8Ball(), Moderation::Moderation(), Module::Module(), Ping::Ping(), Plugin(), PluginSample::PluginSample(), PostConnect::PostConnect(), Quotes::Quotes(), RemoteControl::RemoteControl(), Slapme::Slapme(), Survey::Survey(), Tele::Tele(), Trad::Trad(), and UsersInfos::UsersInfos().
string Plugin::description [protected] |
Plugin descritpion.
Definition at line 88 of file plugin.h.
Referenced by Admin::Admin(), Advertising::Advertising(), AntiFlood::AntiFlood(), BZRH::BZRH(), CTCP::CTCP(), DansTonChat::DansTonChat(), Fedorafr::Fedorafr(), FedoraProject::FedoraProject(), GameServer::GameServer(), getDescription(), Ignore::Ignore(), Infos::Infos(), IpConverting::IpConverting(), Lamoule::Lamoule(), LogFactory::LogFactory(), Magic8Ball::Magic8Ball(), Moderation::Moderation(), Module::Module(), Ping::Ping(), Plugin(), PluginSample::PluginSample(), PostConnect::PostConnect(), Quotes::Quotes(), RemoteControl::RemoteControl(), Slapme::Slapme(), Survey::Survey(), Tele::Tele(), Trad::Trad(), and UsersInfos::UsersInfos().
vector<StructFunctionStorage> Plugin::funcs [protected] |
PLugins functions.
Definition at line 94 of file plugin.h.
Referenced by bindFunction(), checkMembers(), getFunctions(), and Plugin().
void* Plugin::handle [protected] |
Stores plugin's handle.
Definition at line 96 of file plugin.h.
Referenced by getHandle(), and Plugin().
string Plugin::name [protected] |
Plugin name.
Definition at line 92 of file plugin.h.
Referenced by Admin::Admin(), Advertising::Advertising(), AntiFlood::AntiFlood(), BZRH::BZRH(), CTCP::CTCP(), DansTonChat::DansTonChat(), Fedorafr::Fedorafr(), FedoraProject::FedoraProject(), GameServer::GameServer(), LogFactory::getLoggedChannels(), getName(), LogFactory::hasToBeLogged(), Ignore::Ignore(), Infos::Infos(), IpConverting::IpConverting(), Lamoule::Lamoule(), LogFactory::LogFactory(), Magic8Ball::Magic8Ball(), Moderation::Moderation(), Module::Module(), Ping::Ping(), Plugin(), PluginSample::PluginSample(), PostConnect::PostConnect(), Quotes::Quotes(), RemoteControl::RemoteControl(), Slapme::Slapme(), Survey::Survey(), Tele::Tele(), Trad::Trad(), and UsersInfos::UsersInfos().
vector<string> Plugin::requirements [protected] |
stores plugins names that are required for the plugin
Definition at line 98 of file plugin.h.
Referenced by addRequirement(), getRequirements(), Plugin(), and requires().
string Plugin::version [protected] |
Plugin version.
Definition at line 90 of file plugin.h.
Referenced by Admin::Admin(), Advertising::Advertising(), AntiFlood::AntiFlood(), BZRH::BZRH(), CTCP::CTCP(), DansTonChat::DansTonChat(), Fedorafr::Fedorafr(), FedoraProject::FedoraProject(), GameServer::GameServer(), getVersion(), Ignore::Ignore(), Infos::Infos(), IpConverting::IpConverting(), Lamoule::Lamoule(), LogFactory::LogFactory(), Magic8Ball::Magic8Ball(), Moderation::Moderation(), Module::Module(), Ping::Ping(), Plugin(), PluginSample::PluginSample(), PostConnect::PostConnect(), Quotes::Quotes(), RemoteControl::RemoteControl(), Slapme::Slapme(), Survey::Survey(), Tele::Tele(), Trad::Trad(), and UsersInfos::UsersInfos().