PhoenixSwarm  3.5.0
Library to ease communication between daemons
Loading...
Searching...
No Matches
FunctionCall_impl.h
Go to the documentation of this file.
1/***************************************
2 Auteur : Pierre Aubert
3 Mail : pierre.aubert@lapp.in2p3.fr
4 Licence : CeCILL-C
5****************************************/
6
7#ifndef __FUNCTION_CALL_H_IMPL__
8#define __FUNCTION_CALL_H_IMPL__
9
10#include "phoenix_type_stream.h"
11#include "FunctionCall.h"
13
15
18template<typename _Callable>
19FunctionCall<_Callable>::FunctionCall(_Callable && function, const PString & name)
20 :AbstractFunction(name), p_function(function)
21{
22 setPrototype(phoenix_getTypeToStr<_Callable>(function));
24}
25
27template<typename _Callable>
31
33
38template<typename _Callable>
39bool FunctionCall<_Callable>::call(PLog & log, Data & outputResult, const Data & parameter){
40 return phoenix_function_call(log, outputResult, parameter.getValue(), p_function);
41}
42
44template<typename _Callable>
48
49
50
51
52
53#endif
54
55
56
void setPrototype(const PString &prototype)
Set the prototype of the current function.
AbstractFunction(const PString &name)
Default constructor of AbstractFunction.
Basic Data exchanged in the swarm.
const DataStreamMsg & getValue() const
Gets the value of the Data.
virtual ~FunctionCall()
Destructor of FunctionCall.
FunctionCall(_Callable &&function, const PString &name)
Default constructor of FunctionCall.
virtual bool call(PLog &log, Data &outputResult, const Data &parameter)
Call the function with parameter.
void initialisationFunctionCall()
Initialisation function of the class FunctionCall.
_Callable && p_function
Callable function of the FunctionCall.
bool phoenix_function_call(PLog &log, Data &result, const DataStreamMsg &input, R(*func)(T...))
Call the function with message.