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

Base class representing the minimum requirements for an HTTP ExecutionLine. More...

#include <IExecutionLine.h>

Collaboration diagram for ApiNewYear::IExecutionLine:
Collaboration graph

Public Member Functions

virtual int run (void)=0
 Runs all the modules in the ExecutionLine. More...
 
virtual int attach (IObserver *observer, eModuleType type)=0
 Adds module to the ExecutionLine. More...
 
virtual int detach (const std::string &module, eModuleType type)=0
 Remove module from the ExecutionLine. More...
 
virtual int stop (void)=0
 Stops the ExecutionLine if it is running. More...
 
virtual IHttpClientgetHttpClient ()=0
 Getter for IHttpClient. More...
 
virtual void setHttpClient (IHttpClient *client)=0
 Setter for IHttpClient. More...
 

Detailed Description

Base class representing the minimum requirements for an HTTP ExecutionLine.

Establishes the base architecture and requirements for launching modules based on module priority, and HTTP protocol requirements.

Member Function Documentation

virtual int ApiNewYear::IExecutionLine::attach ( IObserver observer,
eModuleType  type 
)
pure virtual

Adds module to the ExecutionLine.

IExecutionLine Allows the module to add itself to the chain of execution. This function will add the modules IObserver to the appropriate List in the map of modules using the eModuleType. It will then order the List based on IObserver's priority.

Parameters
observerEvent containing information for the module to run.
typeenum representing where in the execution line the module wishes to attach.
Returns
an int representing success or error code.
virtual int ApiNewYear::IExecutionLine::detach ( const std::string &  module,
eModuleType  type 
)
pure virtual

Remove module from the ExecutionLine.

IExecutionLine Removes the module by name and module type from the correct list.

Parameters
modulestring containing the name of the module to look for.
typeenum representing where in the execution line the module is located.
Returns
an int representing success or error code.
virtual IHttpClient* ApiNewYear::IExecutionLine::getHttpClient ( )
pure virtual

Getter for IHttpClient.

IExecutionLine gets the IHttpClient being used by the ExecutionLine.

Returns
pointer to the IHttpClient used.
virtual int ApiNewYear::IExecutionLine::run ( void  )
pure virtual

Runs all the modules in the ExecutionLine.

IExecutionLine run's the ExecutionLine iterating over each List in the map, by connection order, launching the modules through the IObserver's update function.

Returns
An int representing the success or error value of the modules main function.
virtual void ApiNewYear::IExecutionLine::setHttpClient ( IHttpClient client)
pure virtual

Setter for IHttpClient.

IExeuctionLine sets the IHttpClient to be used by the ExecutionLine.

Parameters
clientpointer to an allocated IHttpClient.
virtual int ApiNewYear::IExecutionLine::stop ( void  )
pure virtual

Stops the ExecutionLine if it is running.

IExecutionLine Stops the running ExecutionLine, if not running, does nothing.

Returns
an int representing success or error code.

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