Line |
Branch |
Exec |
Source |
1 |
|
|
/*************************************** |
2 |
|
|
Auteur : Pierre Aubert |
3 |
|
|
Mail : pierre.aubert@lapp.in2p3.fr |
4 |
|
|
Licence : CeCILL-C |
5 |
|
|
****************************************/ |
6 |
|
|
|
7 |
|
|
#ifndef __SHADOK_H__ |
8 |
|
|
#define __SHADOK_H__ |
9 |
|
|
|
10 |
|
|
#include "data_all.h" |
11 |
|
|
|
12 |
|
|
///@brief test class for the data_stream automatic api |
13 |
|
|
class Shadok{ |
14 |
|
|
public: |
15 |
|
|
Shadok(); |
16 |
|
|
Shadok(const Shadok & other); |
17 |
|
|
virtual ~Shadok(); |
18 |
|
|
Shadok & operator = (const Shadok & other); |
19 |
|
|
|
20 |
|
|
void setAge(int age); |
21 |
|
|
void setName(const std::string & name); |
22 |
|
|
|
23 |
|
|
int getAge() const; |
24 |
|
|
int getAge(); |
25 |
|
|
|
26 |
|
|
const std::string & getName() const; |
27 |
|
|
std::string & getName(); |
28 |
|
|
|
29 |
|
|
template<typename Stream, DataStreamMode::DataStreamMode Mode> |
30 |
|
|
bool data_stream(Stream & ds); |
31 |
|
|
|
32 |
|
|
protected: |
33 |
|
|
void copyShadok(const Shadok & other); |
34 |
|
|
|
35 |
|
|
private: |
36 |
|
|
void initialisationShadok(); |
37 |
|
|
|
38 |
|
|
///Age the Shadok |
39 |
|
|
int p_age; |
40 |
|
|
///Name of the Shadok |
41 |
|
|
std::string p_name; |
42 |
|
|
}; |
43 |
|
|
|
44 |
|
|
///@brief Generic Shadok serialisation/deserialisation function |
45 |
|
|
template<typename Stream, DataStreamMode::DataStreamMode Mode> |
46 |
|
|
struct DataStream<Stream, Mode, Shadok>{ |
47 |
|
6 |
static bool data_stream(Stream & ds, Shadok & data){ |
48 |
|
6 |
return data.data_stream<Stream, Mode>(ds); |
49 |
|
|
} |
50 |
|
|
}; |
51 |
|
|
|
52 |
|
|
#include "Shadok_impl.h" |
53 |
|
|
|
54 |
|
|
#endif |
55 |
|
|
|
56 |
|
|
|