PhoenixSwarm  5.1.1
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
14using namespace Swarm;
15
17
20template<typename _Callable>
21FunctionCall<_Callable>::FunctionCall(_Callable && function, const PString & name)
22 :AbstractFunction(name), p_function(function)
23{
24 setPrototype(phoenix_getTypeToStr<_Callable>(function));
26}
27
29template<typename _Callable>
33
35
40template<typename _Callable>
41bool FunctionCall<_Callable>::call(PLog & log, Data & outputResult, const Data & parameter){
42 return phoenix_function_call(log, outputResult, parameter.getValue(), p_function);
43}
44
46template<typename _Callable>
50
51
52
53
54
55#endif
56
57
58
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 bool call(PLog &log, Swarm::Data &outputResult, const Swarm::Data &parameter)
Call the function with parameter.
FunctionCall(_Callable &&function, const PString &name)
Default constructor of FunctionCall.
virtual ~FunctionCall()
Destructor of FunctionCall.
_Callable && p_function
Callable function of the FunctionCall.
void initialisationFunctionCall()
Initialisation function of the class FunctionCall.
bool phoenix_function_call(PLog &log, Swarm::Data &result, const DataStreamMsg &input, R(*func)(T...))
Call the function with message.