PhoenixSwarm  3.5.0
Library to ease communication between daemons
Loading...
Searching...
No Matches
FunctionCall< _Callable > Class Template Reference

Function which can be called in a Daemon. More...

#include <FunctionCall.h>

+ Inheritance diagram for FunctionCall< _Callable >:
+ Collaboration diagram for FunctionCall< _Callable >:

Public Member Functions

virtual bool call (PLog &log, Data &outputResult, const Data &parameter)
 Call the function with parameter.
 
 FunctionCall (_Callable &&function, const PString &name)
 Default constructor of FunctionCall.
 
const PString & getName () const
 Name of the function.
 
const PString & getPrototype () const
 Get the prototype of the current function.
 
void setName (const PString &name)
 Set the name of the function.
 
void setPrototype (const PString &prototype)
 Set the prototype of the current function.
 
virtual ~FunctionCall ()
 Destructor of FunctionCall.
 

Private Member Functions

void initialisationAbstractFunction (const PString &name)
 Initialisation function of the class AbstractFunction.
 
void initialisationFunctionCall ()
 Initialisation function of the class FunctionCall.
 

Private Attributes

_Callable && p_function
 Callable function of the FunctionCall.
 
PString p_name
 Name of the function.
 
PString p_prototype
 Prototype of the function.
 

Detailed Description

template<typename _Callable>
class FunctionCall< _Callable >

Function which can be called in a Daemon.

Definition at line 14 of file FunctionCall.h.

Constructor & Destructor Documentation

◆ FunctionCall()

template<typename _Callable>
FunctionCall< _Callable >::FunctionCall ( _Callable && function,
const PString & name )

Default constructor of FunctionCall.

Parameters
function: function to be called
name: name of the function

Definition at line 19 of file FunctionCall_impl.h.

21{
24}
void setPrototype(const PString &prototype)
Set the prototype of the current function.
AbstractFunction(const PString &name)
Default constructor of AbstractFunction.
Function which can be called in a Daemon.
void initialisationFunctionCall()
Initialisation function of the class FunctionCall.
_Callable && p_function
Callable function of the FunctionCall.

References AbstractFunction::AbstractFunction(), initialisationFunctionCall(), p_function, and AbstractFunction::setPrototype().

+ Here is the call graph for this function:

◆ ~FunctionCall()

template<typename _Callable>
FunctionCall< _Callable >::~FunctionCall ( )
virtual

Destructor of FunctionCall.

Definition at line 28 of file FunctionCall_impl.h.

28 {
29
30}

Member Function Documentation

◆ call()

template<typename _Callable>
bool FunctionCall< _Callable >::call ( PLog & log,
Data & outputResult,
const Data & parameter )
virtual

Call the function with parameter.

Parameters
[out]log: logger
[out]outputResult: result of the function call
parameter: set of parameters given to the function
Returns
true on success, false otherwise

Implements AbstractFunction.

Definition at line 39 of file FunctionCall_impl.h.

39 {
41}
bool phoenix_function_call(PLog &log, Data &result, const DataStreamMsg &input, R(*func)(T...))
Call the function with message.

References Data::getValue(), p_function, and phoenix_function_call().

+ Here is the call graph for this function:

◆ getName()

const PString & AbstractFunction::getName ( ) const
inherited

Name of the function.

Returns
name of the function

Definition at line 34 of file AbstractFunction.cpp.

34 {
35 return p_name;
36}
PString p_name
Name of the function.

References p_name.

◆ getPrototype()

const PString & AbstractFunction::getPrototype ( ) const
inherited

Get the prototype of the current function.

Returns
prototype of the current function

Definition at line 48 of file AbstractFunction.cpp.

48 {
49 return p_prototype;
50}
PString p_prototype
Prototype of the function.

References p_prototype.

◆ initialisationAbstractFunction()

void AbstractFunction::initialisationAbstractFunction ( const PString & name)
privateinherited

Initialisation function of the class AbstractFunction.

Parameters
name: name of the function

Definition at line 55 of file AbstractFunction.cpp.

55 {
56 p_name = name;
57}

References p_name.

Referenced by AbstractFunction().

+ Here is the caller graph for this function:

◆ initialisationFunctionCall()

template<typename _Callable>
void FunctionCall< _Callable >::initialisationFunctionCall ( )
private

Initialisation function of the class FunctionCall.

Definition at line 45 of file FunctionCall_impl.h.

45 {
46
47}

Referenced by FunctionCall().

+ Here is the caller graph for this function:

◆ setName()

void AbstractFunction::setName ( const PString & name)
inherited

Set the name of the function.

Parameters
name: name of the function

Definition at line 27 of file AbstractFunction.cpp.

27 {
28 p_name = name;
29}

References p_name.

◆ setPrototype()

void AbstractFunction::setPrototype ( const PString & prototype)
inherited

Set the prototype of the current function.

Parameters
prototype: prototype of the current function

Definition at line 41 of file AbstractFunction.cpp.

41 {
42 p_prototype = prototype;
43}

References p_prototype.

Referenced by FunctionCall< _Callable >::FunctionCall().

+ Here is the caller graph for this function:

Member Data Documentation

◆ p_function

template<typename _Callable>
_Callable&& FunctionCall< _Callable >::p_function
private

Callable function of the FunctionCall.

Definition at line 25 of file FunctionCall.h.

Referenced by call(), and FunctionCall().

◆ p_name

PString AbstractFunction::p_name
privateinherited

Name of the function.

Definition at line 31 of file AbstractFunction.h.

Referenced by getName(), initialisationAbstractFunction(), and setName().

◆ p_prototype

PString AbstractFunction::p_prototype
privateinherited

Prototype of the function.

Definition at line 33 of file AbstractFunction.h.

Referenced by getPrototype(), and setPrototype().


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