PhoenixSwarm  5.1.1
Library to ease communication between daemons
Loading...
Searching...
No Matches
Swarm::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 22 of file Representation.h.

Constructor & Destructor Documentation

◆ Data() [1/2]

Data::Data ( )

Constructor of class Data.

Definition at line 38 of file Representation.cpp.

38 {
40}
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 43 of file Representation.cpp.

43 {
44
45}

◆ Data() [2/2]

Data::Data ( const Data & other)

Copy Constructor of class Data.

Parameters
other: Data we want ot copy

Definition at line 50 of file Representation.cpp.

50 {
51 copyData(other);
52}
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 150 of file Representation.cpp.

150 {
151 p_name = other.p_name;
153 p_type = other.p_type;
154 p_value = other.p_value;
155}
PString p_type
Type of the Data.
PString p_name
Name of the Data.
DataStreamMsg p_value
Value of the Data.
PString p_description
Description 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 115 of file Representation.cpp.

115 {
116 return p_description;
117}

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

108 {
109 return p_description;
110}

References p_description.

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

101 {
102 return p_name;
103}

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

94 {
95 return p_name;
96}

References p_name.

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

129 {
130 return p_type;
131}

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

122 {
123 return p_type;
124}

References p_type.

Referenced by CheckStream< Swarm::Data >::check_stream(), Swarm::BaseDaemon::getDataFunction(), phoenix_getValueFromData(), Swarm::BaseDaemon::processConfirmedMessage(), Swarm::BaseDaemon::processData(), and Swarm::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 143 of file Representation.cpp.

143 {
144 return p_value;
145}

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

136 {
137 return p_value;
138}

References p_value.

Referenced by Swarm::FunctionCall< _Callable >::call(), CheckStream< Swarm::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 158 of file Representation.cpp.

158 {
159 p_name = "";
160 p_description = "";
161 p_type = "";
162}

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

58 {
59 copyData(other);
60 return *this;
61}

References copyData(), and Data().

+ Here is the call graph for this function:

◆ readWriteStream()

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

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

References p_description, p_name, p_type, and p_value.

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

73 {
74 p_description = description;
75}

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

66 {
67 p_name = name;
68}

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

80 {
81 p_type = type;
82}

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

87 {
88 p_value = value;
89}

References p_value.

Member Data Documentation

◆ p_description

PString Swarm::Data::p_description
private

Description of the Data.

Definition at line 62 of file Representation.h.

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

◆ p_name

PString Swarm::Data::p_name
private

Name of the Data.

Definition at line 60 of file Representation.h.

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

◆ p_type

PString Swarm::Data::p_type
private

Type of the Data.

Definition at line 64 of file Representation.h.

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

◆ p_value

DataStreamMsg Swarm::Data::p_value
private

Value of the Data.

Definition at line 66 of file Representation.h.

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


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