#include <AbstractFunction.hpp>

Inheritance diagram for zeus::AbstractFunction:
zeus::AbstractFunctionTypeClass< ZEUS_RETURN, ZEUS_CLASS_TYPE, ZEUS_TYPES > zeus::AbstractFunctionTypeDirect< ZEUS_RETURN, ZEUS_TYPES >

Public Types

enum  type {
  type::unknow, type::global, type::local, type::service,
  type::object
}
 

Public Member Functions

virtual ~AbstractFunction ()=default
 
enum type getType () const
 
void setType (enum type _type)
 
const std::string & getName () const
 
const std::string & getDescription () const
 
void setDescription (const std::string &_desc)
 
void setParam (int32_t _idParam, const std::string &_name, const std::string &_desc)
 
void addParam (const std::string &_name, const std::string &_desc)
 
void setReturn (const std::string &_desc)
 
std::string getPrototype () const
 
virtual std::string getSignature () const
 
virtual std::string getPrototypeReturn () const =0
 
virtual std::vector< std::string > getPrototypeParam () const =0
 
virtual void execute (ememory::SharedPtr< zeus::WebServer > _interfaceClient, ememory::SharedPtr< zeus::BufferCall > _obj, void *_class=nullptr)=0
 

Protected Member Functions

 AbstractFunction (const std::string &_name)
 

Protected Attributes

enum type m_type
 
std::string m_name
 
std::string m_description
 
std::vector< std::pair< std::string, std::string > > m_paramsDescription
 
std::string m_returnDescription
 

Detailed Description

Interface to store a function and call it after with a zeus::Buffer.

Member Enumeration Documentation

§ type

Under type of the call methode.

Enumerator
unknow 

Does not know the type of the call.

global 

This is a global function.

local 

This is a local fucntion.

service 

This call a service function (global function like "srv.xxx")

object 

this is for service instance call

Constructor & Destructor Documentation

§ AbstractFunction()

zeus::AbstractFunction::AbstractFunction ( const std::string &  _name)
protected

Constructor.

Parameters
[in]_nameNmae of the function

§ ~AbstractFunction()

virtual zeus::AbstractFunction::~AbstractFunction ( )
virtualdefault

generic virtual destructor

Member Function Documentation

§ addParam()

void zeus::AbstractFunction::addParam ( const std::string &  _name,
const std::string &  _desc 
)

Set the parameter name and description of the last parameter not set (increment id every element)

Parameters
[in]_nameName of the parameter
[in]_descDescription of the parameter

§ execute()

virtual void zeus::AbstractFunction::execute ( ememory::SharedPtr< zeus::WebServer _interfaceClient,
ememory::SharedPtr< zeus::BufferCall _obj,
void *  _class = nullptr 
)
pure virtual

Execute the function with all parameter properties.

Parameters
[in]_interfaceClientWeb interface to anser values
[in]_objCall object
[in]_classPointer on the object that might be call (note: brut cast)

Implemented in zeus::AbstractFunctionTypeClass< ZEUS_RETURN, ZEUS_CLASS_TYPE, ZEUS_TYPES >, and zeus::AbstractFunctionTypeDirect< ZEUS_RETURN, ZEUS_TYPES >.

§ getDescription()

const std::string& zeus::AbstractFunction::getDescription ( ) const

Get the description of the function.

Returns
The description string of the function (same as doxygen 'brief')

§ getName()

const std::string& zeus::AbstractFunction::getName ( ) const

Get the name of the function.

Returns
Function name

§ getPrototype()

std::string zeus::AbstractFunction::getPrototype ( ) const

Get the prototype of the function with the parameter name and type.

Returns
The fucntion like "void maFonction(int32 parameter_1, vector:string parameter_2);"

§ getPrototypeParam()

virtual std::vector<std::string> zeus::AbstractFunction::getPrototypeParam ( ) const
pure virtual

Get the list of type of the parameter.

Returns
List of types (zeus singature mode)

Implemented in zeus::AbstractFunctionTypeClass< ZEUS_RETURN, ZEUS_CLASS_TYPE, ZEUS_TYPES >, and zeus::AbstractFunctionTypeDirect< ZEUS_RETURN, ZEUS_TYPES >.

§ getPrototypeReturn()

virtual std::string zeus::AbstractFunction::getPrototypeReturn ( ) const
pure virtual

Get the string of the type of the return value.

Returns
type string of the return value

Implemented in zeus::AbstractFunctionTypeClass< ZEUS_RETURN, ZEUS_CLASS_TYPE, ZEUS_TYPES >, and zeus::AbstractFunctionTypeDirect< ZEUS_RETURN, ZEUS_TYPES >.

§ getSignature()

virtual std::string zeus::AbstractFunction::getSignature ( ) const
virtual

Get the signature of the function.

Returns
The signature of the function: "void(int32,vector:string);"

§ getType()

enum type zeus::AbstractFunction::getType ( ) const

Get the tyope of the call that is needed to do.

Returns
Type of the call.

§ setDescription()

void zeus::AbstractFunction::setDescription ( const std::string &  _desc)

Set a new description of the function.

Parameters
[in]_descDescriptive string

§ setParam()

void zeus::AbstractFunction::setParam ( int32_t  _idParam,
const std::string &  _name,
const std::string &  _desc 
)

Set the parameter name and description.

Parameters
[in]_idParamNumber of the parameter
[in]_nameName of the parameter
[in]_descDescription of the parameter

§ setReturn()

void zeus::AbstractFunction::setReturn ( const std::string &  _desc)

Set the return description of the Function.

Parameters
[in]_descDescription of the return parameter

§ setType()

void zeus::AbstractFunction::setType ( enum type  _type)

Set the type of the call that must be done for this function.

Parameters
[in]_typeNew type of the call.

Member Data Documentation

§ m_description

std::string zeus::AbstractFunction::m_description
protected

description of the function

§ m_name

std::string zeus::AbstractFunction::m_name
protected

name of the function

§ m_paramsDescription

std::vector<std::pair<std::string, std::string> > zeus::AbstractFunction::m_paramsDescription
protected

List of the parameter descriptions.

§ m_returnDescription

std::string zeus::AbstractFunction::m_returnDescription
protected

Return description of the Function.

§ m_type

enum type zeus::AbstractFunction::m_type
protected

Type of the subCall (to permit to call many type of call)


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