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

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

#include <FunctionCall.h>

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

Public Member Functions

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.
 
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 Swarm::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::FunctionCall ( _Callable && function,
const PString & name )

Default constructor of FunctionCall.

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

Definition at line 21 of file FunctionCall_impl.h.

23{
26}
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.
_Callable && p_function
Callable function of the FunctionCall.
void initialisationFunctionCall()
Initialisation function of the class FunctionCall.

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

+ Here is the call graph for this function:

◆ ~FunctionCall()

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

Destructor of FunctionCall.

Definition at line 30 of file FunctionCall_impl.h.

30 {
31
32}

Member Function Documentation

◆ call()

template<typename _Callable>
bool FunctionCall::call ( PLog & log,
Swarm::Data & outputResult,
const Swarm::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 Swarm::AbstractFunction.

Definition at line 41 of file FunctionCall_impl.h.

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

References Swarm::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 33 of file AbstractFunction.cpp.

33 {
34 return p_name;
35}
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 47 of file AbstractFunction.cpp.

47 {
48 return p_prototype;
49}
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 54 of file AbstractFunction.cpp.

54 {
55 p_name = name;
56}

References p_name.

Referenced by AbstractFunction().

+ Here is the caller graph for this function:

◆ initialisationFunctionCall()

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

Initialisation function of the class FunctionCall.

Definition at line 47 of file FunctionCall_impl.h.

47 {
48
49}

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 26 of file AbstractFunction.cpp.

26 {
27 p_name = name;
28}

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 40 of file AbstractFunction.cpp.

40 {
41 p_prototype = prototype;
42}

References p_prototype.

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

+ Here is the caller graph for this function:

Member Data Documentation

◆ p_function

template<typename _Callable>
_Callable&& Swarm::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 Swarm::AbstractFunction::p_name
privateinherited

Name of the function.

Definition at line 32 of file AbstractFunction.h.

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

◆ p_prototype

PString Swarm::AbstractFunction::p_prototype
privateinherited

Prototype of the function.

Definition at line 34 of file AbstractFunction.h.

Referenced by getPrototype(), and setPrototype().


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