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

Basic Data exchanged in the swarm. More...

#include <Representation.h>

Public Member Functions

 Data ()
 Constructor of class Data.
 
 Data (const Data &other)
 Copy Constructor of class Data.
 
PString & getDescription ()
 Gets the description of the Data.
 
const PString & getDescription () const
 Gets the description of the Data.
 
PString & getName ()
 Gets the name of the Data.
 
const PString & getName () const
 Gets the name of the Data.
 
PString & getType ()
 Gets the type of the Data.
 
const PString & getType () const
 Gets the type of the Data.
 
DataStreamMsg & getValue ()
 Gets the value of the Data.
 
const DataStreamMsg & getValue () const
 Gets the value of the Data.
 
Dataoperator= (const Data &other)
 Operator = of class Data.
 
template<typename Stream, DataStreamMode::DataStreamMode Mode>
bool readWriteStream (Stream &ds)
 Load the current Data with a stream.
 
void setDescription (const PString &description)
 Sets the description of the Data.
 
void setName (const PString &name)
 Sets the name of the Data.
 
void setType (const PString &type)
 Sets the type of the Data.
 
void setValue (const DataStreamMsg &value)
 Sets the value of the Data.
 
virtual ~Data ()
 Destructor of class Data.
 

Protected Member Functions

void copyData (const Data &other)
 Copy Function of class Data.
 

Private Member Functions

void initialisationData ()
 Initialisation Function of class Data.
 

Private Attributes

PString p_description
 Description of the Data.
 
PString p_name
 Name of the Data.
 
PString p_type
 Type of the Data.
 
DataStreamMsg p_value
 Value of the Data.
 

Detailed Description

Basic Data exchanged in the swarm.

Definition at line 21 of file Representation.h.

Constructor & Destructor Documentation

◆ Data() [1/2]

Data::Data ( )

Constructor of class Data.

Definition at line 36 of file Representation.cpp.

36 {
38}
void initialisationData()
Initialisation Function of class Data.

References initialisationData().

Referenced by copyData(), Data(), and operator=().

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

◆ ~Data()

Data::~Data ( )
virtual

Destructor of class Data.

Definition at line 41 of file Representation.cpp.

41 {
42
43}

◆ Data() [2/2]

Data::Data ( const Data & other)

Copy Constructor of class Data.

Parameters
other: Data we want ot copy

Definition at line 48 of file Representation.cpp.

48 {
49 copyData(other);
50}
void copyData(const Data &other)
Copy Function of class Data.

References copyData(), and Data().

+ Here is the call graph for this function:

Member Function Documentation

◆ copyData()

void Data::copyData ( const Data & other)
protected

Copy Function of class Data.

Parameters
other: Data we want ot copy

Definition at line 148 of file Representation.cpp.

148 {
149 p_name = other.p_name;
151 p_type = other.p_type;
152 p_value = other.p_value;
153}
PString p_description
Description of the Data.
PString p_name
Name of the Data.
PString p_type
Type of the Data.
DataStreamMsg p_value
Value of the Data.

References Data(), p_description, p_name, p_type, and p_value.

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

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

◆ getDescription() [1/2]

PString & Data::getDescription ( )

Gets the description of the Data.

Returns
description of the Data

Definition at line 113 of file Representation.cpp.

113 {
114 return p_description;
115}

References p_description.

◆ getDescription() [2/2]

const PString & Data::getDescription ( ) const

Gets the description of the Data.

Returns
description of the Data

Definition at line 106 of file Representation.cpp.

106 {
107 return p_description;
108}

References p_description.

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

+ Here is the caller graph for this function:

◆ getName() [1/2]

PString & Data::getName ( )

Gets the name of the Data.

Returns
name of the Data

Definition at line 99 of file Representation.cpp.

99 {
100 return p_name;
101}

References p_name.

◆ getName() [2/2]

const PString & Data::getName ( ) const

Gets the name of the Data.

Returns
name of the Data

Definition at line 92 of file Representation.cpp.

92 {
93 return p_name;
94}

References p_name.

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

+ Here is the caller graph for this function:

◆ getType() [1/2]

PString & Data::getType ( )

Gets the type of the Data.

Returns
type of the Data

Definition at line 127 of file Representation.cpp.

127 {
128 return p_type;
129}

References p_type.

◆ getType() [2/2]

const PString & Data::getType ( ) const

Gets the type of the Data.

Returns
type of the Data

Definition at line 120 of file Representation.cpp.

120 {
121 return p_type;
122}

References p_type.

Referenced by CheckStream< Data >::check_stream(), BaseDaemon::getDataFunction(), phoenix_getValueFromData(), BaseDaemon::processConfirmedMessage(), BaseDaemon::processData(), and Daemon< _TBackend >::processInputMessage().

+ Here is the caller graph for this function:

◆ getValue() [1/2]

DataStreamMsg & Data::getValue ( )

Gets the value of the Data.

Returns
value of the Data

Definition at line 141 of file Representation.cpp.

141 {
142 return p_value;
143}

References p_value.

◆ getValue() [2/2]

const DataStreamMsg & Data::getValue ( ) const

Gets the value of the Data.

Returns
value of the Data

Definition at line 134 of file Representation.cpp.

134 {
135 return p_value;
136}

References p_value.

Referenced by FunctionCall< _Callable >::call(), CheckStream< Data >::check_stream(), phoenix_createData(), and phoenix_getValueFromData().

+ Here is the caller graph for this function:

◆ initialisationData()

void Data::initialisationData ( )
private

Initialisation Function of class Data.

Definition at line 156 of file Representation.cpp.

156 {
157 p_name = "";
158 p_description = "";
159 p_type = "";
160}

References p_description, p_name, and p_type.

Referenced by Data().

+ Here is the caller graph for this function:

◆ operator=()

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

Operator = of class Data.

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

Definition at line 56 of file Representation.cpp.

56 {
57 copyData(other);
58 return *this;
59}

References copyData(), and Data().

+ Here is the call graph for this function:

◆ readWriteStream()

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

Load the current Data with a stream.

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

Definition at line 45 of file Representation.h.

45 {
46 bool b(true);
47 b &= DataStream<Stream, Mode, PString >::data_stream(ds, p_name);
48 b &= DataStream<Stream, Mode, PString >::data_stream(ds, p_description);
49 b &= DataStream<Stream, Mode, PString >::data_stream(ds, p_type);
50 b &= DataStream<Stream, Mode, DataStreamMsg >::data_stream(ds, p_value);
51 return b;
52 }

References p_description, p_name, p_type, and p_value.

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

+ Here is the caller graph for this function:

◆ setDescription()

void Data::setDescription ( const PString & description)

Sets the description of the Data.

Parameters
description: description of the Data

Definition at line 71 of file Representation.cpp.

71 {
72 p_description = description;
73}

References p_description.

◆ setName()

void Data::setName ( const PString & name)

Sets the name of the Data.

Parameters
name: name of the Data

Definition at line 64 of file Representation.cpp.

64 {
65 p_name = name;
66}

References p_name.

◆ setType()

void Data::setType ( const PString & type)

Sets the type of the Data.

Parameters
type: type of the Data

Definition at line 78 of file Representation.cpp.

78 {
79 p_type = type;
80}

References p_type.

Referenced by phoenix_createData(), and phoenix_function_call().

+ Here is the caller graph for this function:

◆ setValue()

void Data::setValue ( const DataStreamMsg & value)

Sets the value of the Data.

Parameters
value: value of the Data

Definition at line 85 of file Representation.cpp.

85 {
86 p_value = value;
87}

References p_value.

Member Data Documentation

◆ p_description

PString Data::p_description
private

Description of the Data.

Definition at line 61 of file Representation.h.

Referenced by copyData(), getDescription(), getDescription(), initialisationData(), readWriteStream(), and setDescription().

◆ p_name

PString Data::p_name
private

Name of the Data.

Definition at line 59 of file Representation.h.

Referenced by copyData(), getName(), getName(), initialisationData(), readWriteStream(), and setName().

◆ p_type

PString Data::p_type
private

Type of the Data.

Definition at line 63 of file Representation.h.

Referenced by copyData(), getType(), getType(), initialisationData(), readWriteStream(), and setType().

◆ p_value

DataStreamMsg Data::p_value
private

Value of the Data.

Definition at line 65 of file Representation.h.

Referenced by copyData(), getValue(), getValue(), readWriteStream(), and setValue().


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