PhoenixSwarm
6.1.0
Persistent processing programs exchanging data over sockets
Toggle main menu visibility
Loading...
Searching...
No Matches
Shadok.h
Go to the documentation of this file.
1
/***************************************
2
Auteur : Pierre Aubert
3
Mail : pierre.aubert@lapp.in2p3.fr
4
Licence : LGPL-3.0-only
5
****************************************/
6
7
#ifndef __SHADOK_H__
8
#define __SHADOK_H__
9
10
#include <string>
11
#include "phoenix_data_stream.h"
12
#include "phoenix_type_stream.h"
13
15
class
Shadok
{
16
public
:
17
Shadok
();
18
Shadok
(
const
Shadok
& other);
19
virtual
~Shadok
();
20
Shadok
&
operator =
(
const
Shadok
& other);
21
void
setAge
(
int
age);
22
void
setName
(
const
std::string & name);
23
int
getAge
()
const
;
24
int
&
getAge
();
25
const
std::string &
getName
()
const
;
26
std::string &
getName
();
27
29
32
template
<
typename
Stream, DataStreamMode::DataStreamMode Mode>
33
bool
readWriteStream
(Stream & ds){
34
bool
b(
true
);
35
b &= DataStream<Stream, Mode, int >::data_stream(ds,
p_age
);
36
b &= DataStream<Stream, Mode, std::string >::data_stream(ds,
p_name
);
37
return
b;
38
}
39
40
protected
:
41
void
copyShadok
(
const
Shadok
& other);
42
private
:
43
void
initialisationShadok
();
45
int
p_age
;
47
std::string
p_name
;
48
};
49
51
template
<
typename
Stream, DataStreamMode::DataStreamMode Mode>
52
struct
DataStream<Stream, Mode,
Shadok
>{
54
58
static
bool
data_stream
(Stream & ds,
Shadok
& data){
59
return
data.
readWriteStream
<Stream, Mode>(ds);
60
}
61
};
62
63
64
65
template
<>
66
std::string
phoenix_getTypeName<Shadok>
();
67
68
69
70
#endif
71
phoenix_getTypeName< Shadok >
std::string phoenix_getTypeName< Shadok >()
Get the name of the class Shadok.
Definition
Shadok.cpp:14
Shadok
Test Shadok.
Definition
Shadok.h:15
Shadok::setAge
void setAge(int age)
Sets the age of the Shadok.
Definition
Shadok.cpp:47
Shadok::copyShadok
void copyShadok(const Shadok &other)
Copy Function of class Shadok.
Definition
Shadok.cpp:89
Shadok::getName
const std::string & getName() const
Gets the name of the Shadok.
Definition
Shadok.cpp:75
Shadok::p_age
int p_age
Age of the Shadok.
Definition
Shadok.h:45
Shadok::operator=
Shadok & operator=(const Shadok &other)
Operator = of class Shadok.
Definition
Shadok.cpp:39
Shadok::getAge
int getAge() const
Gets the age of the Shadok.
Definition
Shadok.cpp:61
Shadok::initialisationShadok
void initialisationShadok()
Initialisation Function of class Shadok.
Definition
Shadok.cpp:95
Shadok::p_name
std::string p_name
Name of the Shadok.
Definition
Shadok.h:47
Shadok::setName
void setName(const std::string &name)
Sets the name of the Shadok.
Definition
Shadok.cpp:54
Shadok::Shadok
Shadok()
Constructor of class Shadok.
Definition
Shadok.cpp:19
Shadok::readWriteStream
bool readWriteStream(Stream &ds)
Load the current Shadok with a stream.
Definition
Shadok.h:33
DataStream< Stream, Mode, Shadok >::data_stream
static bool data_stream(Stream &ds, Shadok &data)
Generic function to load/save/serialise/deserialise Shadok.
Definition
Shadok.h:58
platex
TESTS
TEST_FUNCTIONS
TEST_DATA_PROCESSING
Shadok.h
Generated by
1.18.0