API New Year  1.0
API for the project ZIA, EPITECH 2017.
ApiNewYear::IModule Class Referenceabstract

Base class representing the minimum requirements for a module. More...

#include <IModule.h>

Collaboration diagram for ApiNewYear::IModule:
Collaboration graph

Public Member Functions

virtual int init (void)=0
 initializes the module. More...
 
virtual int hook (IExecutionLine &executionLine)=0
 hooks the module to the ExecutionLine More...
 
virtual int hook (IServer &server)=0
 hooks the module to the Server More...
 
virtual int unhook (IExecutionLine &executionLine)=0
 unhooks the module from the ExecutionLine More...
 
virtual int unhook (IServer &server)=0
 unooks the module from the Server More...
 
virtual int destroy (void)=0
 destroys the module. More...
 
virtual const std::string & getName () const =0
 Getter for name of the module. More...
 
virtual int getPriority () const =0
 Getter for priority of the module. More...
 
virtual eModuleType getType () const =0
 Getter for type of the module. More...
 
virtual float getVersion () const =0
 Getter for version of the module. More...
 
virtual const std::string & getLocation () const =0
 Getter for location of the module. More...
 
virtual const std::string & getConfFile () const =0
 Getter for the modules configuration file. More...
 
virtual void setConfFile (const std::string &)=0
 Setter for the modules configuration file. More...
 
virtual const ILoggergetLogger () const =0
 Getter for logger. More...
 

Detailed Description

Base class representing the minimum requirements for a module.

Establishes the base architecture for a module to fulfill one or several tasks for the server.

Member Function Documentation

virtual int ApiNewYear::IModule::destroy ( void  )
pure virtual

destroys the module.

IModule allows for the module to clean anything it needs prior to it's destruction.

Returns
an int representing success or error code.
virtual const std::string& ApiNewYear::IModule::getConfFile ( ) const
pure virtual

Getter for the modules configuration file.

Get's the location of the modules configuration file on the disk.

Returns
string representing the configuration file location.
virtual const std::string& ApiNewYear::IModule::getLocation ( ) const
pure virtual

Getter for location of the module.

Get's the location of the module on the disk.

Returns
constant string reference containing the location.
virtual const ILogger& ApiNewYear::IModule::getLogger ( ) const
pure virtual

Getter for logger.

Get's the logger used by the module for logging runtime information.

Returns
reference to the logger.
virtual const std::string& ApiNewYear::IModule::getName ( ) const
pure virtual

Getter for name of the module.

Get's the name of the module.

Returns
constant string reference containing the name of the module.
virtual int ApiNewYear::IModule::getPriority ( ) const
pure virtual

Getter for priority of the module.

Get's the priority of the module.

Returns
int representing the priority of the module.
virtual eModuleType ApiNewYear::IModule::getType ( ) const
pure virtual

Getter for type of the module.

Get's the type of the module.

Returns
enum corresponding to the type of the module.
virtual float ApiNewYear::IModule::getVersion ( ) const
pure virtual

Getter for version of the module.

Get's the version of the module.

Returns
float representing the version of the module.
virtual int ApiNewYear::IModule::hook ( IExecutionLine executionLine)
pure virtual

hooks the module to the ExecutionLine

IModule Hooks the module to the ExecutionLine through IExecutionLine::attach, allowing the module to add itself to the ExecutionLine.

Parameters
executionLineReference to IExecutionLine
Returns
an int representing success or error code.
virtual int ApiNewYear::IModule::hook ( IServer server)
pure virtual

hooks the module to the Server

IModule Hooks the module to the Server through IServer::attach, allowing the module to add itself as a connection module.

Parameters
serverReference to IServer
Returns
an int representing success or error code.
virtual int ApiNewYear::IModule::init ( void  )
pure virtual

initializes the module.

IModule allows for module initizalization on load of module.

Returns
an int representing success or error code.
virtual void ApiNewYear::IModule::setConfFile ( const std::string &  )
pure virtual

Setter for the modules configuration file.

Sets the modules configuration file location on the disk.

Parameters
constantstring reference representing the configuration file location.
virtual int ApiNewYear::IModule::unhook ( IExecutionLine executionLine)
pure virtual

unhooks the module from the ExecutionLine

IModule Unhooks the module from the ExecutionLine through IExecutionLine::detach, allowing the module to remove itself from the ExecutionLine.

Parameters
executionLineexecutionLine Reference to IExecutionLine
Returns
int representing success or error code
virtual int ApiNewYear::IModule::unhook ( IServer server)
pure virtual

unooks the module from the Server

IModule Unhooks the module from the Server through IServer::detach, allowing the module to remove itself from the Server.

Parameters
serverReference to IServer
Returns
int representing success or error code

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