PhoenixSwarm  3.5.0
Library to ease communication between daemons
Loading...
Searching...
No Matches
Function Class Reference

Basic function which can be called from an other Daemon. More...

#include <Representation.h>

+ Collaboration diagram for Function:

Public Member Functions

 Function ()
 Constructor of class Function.
 
 Function (const Function &other)
 Copy Constructor of class Function.
 
PString & getDescription ()
 Gets the description of the Function.
 
const PString & getDescription () const
 Gets the description of the Function.
 
PString & getName ()
 Gets the name of the Function.
 
const PString & getName () const
 Gets the name of the Function.
 
DatagetReturnValue ()
 Gets the returnValue of the Function.
 
const DatagetReturnValue () const
 Gets the returnValue of the Function.
 
std::vector< Data > & getVecParam ()
 Gets the vecParam of the Function.
 
const std::vector< Data > & getVecParam () const
 Gets the vecParam of the Function.
 
Functionoperator= (const Function &other)
 Operator = of class Function.
 
template<typename Stream, DataStreamMode::DataStreamMode Mode>
bool readWriteStream (Stream &ds)
 Load the current Function with a stream.
 
void setDescription (const PString &description)
 Sets the description of the Function.
 
void setName (const PString &name)
 Sets the name of the Function.
 
void setReturnValue (const Data &returnValue)
 Sets the returnValue of the Function.
 
void setVecParam (const std::vector< Data > &vecParam)
 Sets the vecParam of the Function.
 
virtual ~Function ()
 Destructor of class Function.
 

Protected Member Functions

void copyFunction (const Function &other)
 Copy Function of class Function.
 

Private Member Functions

void initialisationFunction ()
 Initialisation Function of class Function.
 

Private Attributes

PString p_description
 Description of the Function.
 
PString p_name
 Name of the Function.
 
Data p_returnValue
 Return value of the Function.
 
std::vector< Datap_vecParam
 Vector of parameters of the Function.
 

Detailed Description

Basic function which can be called from an other Daemon.

Definition at line 94 of file Representation.h.

Constructor & Destructor Documentation

◆ Function() [1/2]

Function::Function ( )

Constructor of class Function.

Definition at line 188 of file Representation.cpp.

188 {
190}
void initialisationFunction()
Initialisation Function of class Function.

References initialisationFunction().

Referenced by copyFunction(), Function(), and operator=().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~Function()

Function::~Function ( )
virtual

Destructor of class Function.

Definition at line 193 of file Representation.cpp.

193 {
194
195}

◆ Function() [2/2]

Function::Function ( const Function & other)

Copy Constructor of class Function.

Parameters
other: Function we want ot copy

Definition at line 200 of file Representation.cpp.

200 {
201 copyFunction(other);
202}
void copyFunction(const Function &other)
Copy Function of class Function.

References copyFunction(), and Function().

+ Here is the call graph for this function:

Member Function Documentation

◆ copyFunction()

void Function::copyFunction ( const Function & other)
protected

Copy Function of class Function.

Parameters
other: Function we want ot copy

Definition at line 300 of file Representation.cpp.

300 {
301 p_name = other.p_name;
303 p_vecParam = other.p_vecParam;
305}
PString p_description
Description of the Function.
Data p_returnValue
Return value of the Function.
std::vector< Data > p_vecParam
Vector of parameters of the Function.
PString p_name
Name of the Function.

References Function(), p_description, p_name, p_returnValue, and p_vecParam.

Referenced by Function(), and operator=().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDescription() [1/2]

PString & Function::getDescription ( )

Gets the description of the Function.

Returns
description of the Function

Definition at line 265 of file Representation.cpp.

265 {
266 return p_description;
267}

References p_description.

◆ getDescription() [2/2]

const PString & Function::getDescription ( ) const

Gets the description of the Function.

Returns
description of the Function

Definition at line 258 of file Representation.cpp.

258 {
259 return p_description;
260}

References p_description.

Referenced by CheckStream< Function >::check_stream().

+ Here is the caller graph for this function:

◆ getName() [1/2]

PString & Function::getName ( )

Gets the name of the Function.

Returns
name of the Function

Definition at line 251 of file Representation.cpp.

251 {
252 return p_name;
253}

References p_name.

◆ getName() [2/2]

const PString & Function::getName ( ) const

Gets the name of the Function.

Returns
name of the Function

Definition at line 244 of file Representation.cpp.

244 {
245 return p_name;
246}

References p_name.

Referenced by CheckStream< Function >::check_stream().

+ Here is the caller graph for this function:

◆ getReturnValue() [1/2]

Data & Function::getReturnValue ( )

Gets the returnValue of the Function.

Returns
returnValue of the Function

Definition at line 293 of file Representation.cpp.

293 {
294 return p_returnValue;
295}

References p_returnValue.

◆ getReturnValue() [2/2]

const Data & Function::getReturnValue ( ) const

Gets the returnValue of the Function.

Returns
returnValue of the Function

Definition at line 286 of file Representation.cpp.

286 {
287 return p_returnValue;
288}

References p_returnValue.

Referenced by CheckStream< Function >::check_stream().

+ Here is the caller graph for this function:

◆ getVecParam() [1/2]

std::vector< Data > & Function::getVecParam ( )

Gets the vecParam of the Function.

Returns
vecParam of the Function

Definition at line 279 of file Representation.cpp.

279 {
280 return p_vecParam;
281}

References p_vecParam.

◆ getVecParam() [2/2]

const std::vector< Data > & Function::getVecParam ( ) const

Gets the vecParam of the Function.

Returns
vecParam of the Function

Definition at line 272 of file Representation.cpp.

272 {
273 return p_vecParam;
274}

References p_vecParam.

Referenced by CheckStream< Function >::check_stream().

+ Here is the caller graph for this function:

◆ initialisationFunction()

void Function::initialisationFunction ( )
private

Initialisation Function of class Function.

Definition at line 308 of file Representation.cpp.

308 {
309 p_name = "";
310 p_description = "";
311}

References p_description, and p_name.

Referenced by Function().

+ Here is the caller graph for this function:

◆ operator=()

Function & Function::operator= ( const Function & other)

Operator = of class Function.

Parameters
other: Function we want ot copy
Returns
copied class Function

Definition at line 208 of file Representation.cpp.

208 {
209 copyFunction(other);
210 return *this;
211}

References copyFunction(), and Function().

+ Here is the call graph for this function:

◆ readWriteStream()

template<typename Stream, DataStreamMode::DataStreamMode Mode>
bool Function::readWriteStream ( Stream & ds)
inline

Load the current Function with a stream.

Parameters
[out]ds: stream to be used
Returns
true on success, false otherwise

Definition at line 118 of file Representation.h.

118 {
119 bool b(true);
120 b &= DataStream<Stream, Mode, PString >::data_stream(ds, p_name);
121 b &= DataStream<Stream, Mode, PString >::data_stream(ds, p_description);
122 b &= DataStream<Stream, Mode, std::vector<Data> >::data_stream(ds, p_vecParam);
124 return b;
125 }
static bool data_stream(Stream &ds, Data &data)
Generic function to load/save/serialise/deserialise Data.

References DataStream< Stream, Mode, Data >::data_stream(), p_description, p_name, p_returnValue, and p_vecParam.

Referenced by DataStream< Stream, Mode, Function >::data_stream().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDescription()

void Function::setDescription ( const PString & description)

Sets the description of the Function.

Parameters
description: description of the Function

Definition at line 223 of file Representation.cpp.

223 {
224 p_description = description;
225}

References p_description.

◆ setName()

void Function::setName ( const PString & name)

Sets the name of the Function.

Parameters
name: name of the Function

Definition at line 216 of file Representation.cpp.

216 {
217 p_name = name;
218}

References p_name.

◆ setReturnValue()

void Function::setReturnValue ( const Data & returnValue)

Sets the returnValue of the Function.

Parameters
returnValue: returnValue of the Function

Definition at line 237 of file Representation.cpp.

237 {
238 p_returnValue = returnValue;
239}

References p_returnValue.

◆ setVecParam()

void Function::setVecParam ( const std::vector< Data > & vecParam)

Sets the vecParam of the Function.

Parameters
vecParam: vecParam of the Function

Definition at line 230 of file Representation.cpp.

230 {
231 p_vecParam = vecParam;
232}

References p_vecParam.

Member Data Documentation

◆ p_description

PString Function::p_description
private

◆ p_name

PString Function::p_name
private

Name of the Function.

Definition at line 132 of file Representation.h.

Referenced by copyFunction(), getName(), getName(), initialisationFunction(), readWriteStream(), and setName().

◆ p_returnValue

Data Function::p_returnValue
private

Return value of the Function.

Definition at line 138 of file Representation.h.

Referenced by copyFunction(), getReturnValue(), getReturnValue(), readWriteStream(), and setReturnValue().

◆ p_vecParam

std::vector<Data> Function::p_vecParam
private

Vector of parameters of the Function.

Definition at line 136 of file Representation.h.

Referenced by copyFunction(), getVecParam(), getVecParam(), readWriteStream(), and setVecParam().


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