PhoenixSwarm  5.1.1
Library to ease communication between daemons
Loading...
Searching...
No Matches
Swarm::Function Class Reference

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

#include <Representation.h>

+ Collaboration diagram for Swarm::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.
 
Swarm::DatagetReturnValue ()
 Gets the returnValue of the Function.
 
const Swarm::DatagetReturnValue () const
 Gets the returnValue of the Function.
 
std::vector< Swarm::Data > & getVecParam ()
 Gets the vecParam of the Function.
 
const std::vector< Swarm::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 Swarm::Data &returnValue)
 Sets the returnValue of the Function.
 
void setVecParam (const std::vector< Swarm::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.
 
Swarm::Data p_returnValue
 Return value of the Function.
 
std::vector< Swarm::Datap_vecParam
 Vector of parameters of the Function.
 

Detailed Description

Basic function which can be called from an other Daemon.

Definition at line 95 of file Representation.h.

Constructor & Destructor Documentation

◆ Function() [1/2]

Function::Function ( )

Constructor of class Function.

Definition at line 190 of file Representation.cpp.

190 {
192}
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 195 of file Representation.cpp.

195 {
196
197}

◆ Function() [2/2]

Function::Function ( const Function & other)

Copy Constructor of class Function.

Parameters
other: Function we want ot copy

Definition at line 202 of file Representation.cpp.

202 {
203 copyFunction(other);
204}
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 302 of file Representation.cpp.

302 {
303 p_name = other.p_name;
305 p_vecParam = other.p_vecParam;
307}
std::vector< Swarm::Data > p_vecParam
Vector of parameters of the Function.
PString p_description
Description of the Function.
PString p_name
Name of the Function.
Swarm::Data p_returnValue
Return value 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 267 of file Representation.cpp.

267 {
268 return p_description;
269}

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 260 of file Representation.cpp.

260 {
261 return p_description;
262}

References p_description.

Referenced by CheckStream< Swarm::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 253 of file Representation.cpp.

253 {
254 return p_name;
255}

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 246 of file Representation.cpp.

246 {
247 return p_name;
248}

References p_name.

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

+ Here is the caller graph for this function:

◆ getReturnValue() [1/2]

Swarm::Data & Function::getReturnValue ( )

Gets the returnValue of the Function.

Returns
returnValue of the Function

Definition at line 295 of file Representation.cpp.

295 {
296 return p_returnValue;
297}

References p_returnValue.

◆ getReturnValue() [2/2]

const Swarm::Data & Function::getReturnValue ( ) const

Gets the returnValue of the Function.

Returns
returnValue of the Function

Definition at line 288 of file Representation.cpp.

288 {
289 return p_returnValue;
290}

References p_returnValue.

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

+ Here is the caller graph for this function:

◆ getVecParam() [1/2]

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

Gets the vecParam of the Function.

Returns
vecParam of the Function

Definition at line 281 of file Representation.cpp.

281 {
282 return p_vecParam;
283}

References p_vecParam.

◆ getVecParam() [2/2]

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

Gets the vecParam of the Function.

Returns
vecParam of the Function

Definition at line 274 of file Representation.cpp.

274 {
275 return p_vecParam;
276}

References p_vecParam.

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

+ Here is the caller graph for this function:

◆ initialisationFunction()

void Function::initialisationFunction ( )
private

Initialisation Function of class Function.

Definition at line 310 of file Representation.cpp.

310 {
311 p_name = "";
312 p_description = "";
313}

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 210 of file Representation.cpp.

210 {
211 copyFunction(other);
212 return *this;
213}

References copyFunction(), and Function().

+ Here is the call graph for this function:

◆ readWriteStream()

template<typename Stream, DataStreamMode::DataStreamMode Mode>
bool Swarm::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 119 of file Representation.h.

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

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

Referenced by DataStream< Stream, Mode, Swarm::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 225 of file Representation.cpp.

225 {
226 p_description = description;
227}

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 218 of file Representation.cpp.

218 {
219 p_name = name;
220}

References p_name.

◆ setReturnValue()

void Function::setReturnValue ( const Swarm::Data & returnValue)

Sets the returnValue of the Function.

Parameters
returnValue: returnValue of the Function

Definition at line 239 of file Representation.cpp.

239 {
240 p_returnValue = returnValue;
241}

References p_returnValue.

◆ setVecParam()

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

Sets the vecParam of the Function.

Parameters
vecParam: vecParam of the Function

Definition at line 232 of file Representation.cpp.

232 {
233 p_vecParam = vecParam;
234}

References p_vecParam.

Member Data Documentation

◆ p_description

PString Swarm::Function::p_description
private

◆ p_name

PString Swarm::Function::p_name
private

Name of the Function.

Definition at line 133 of file Representation.h.

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

◆ p_returnValue

Swarm::Data Swarm::Function::p_returnValue
private

Return value of the Function.

Definition at line 139 of file Representation.h.

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

◆ p_vecParam

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

Vector of parameters of the Function.

Definition at line 137 of file Representation.h.

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


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