PhoenixMock  1.8.7
Tools to split/merge/print mock used in Phoenix
Shadok.h
Go to the documentation of this file.
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 
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 
39  int p_age;
41  std::string p_name;
42 };
43 
45 template<typename Stream, DataStreamMode::DataStreamMode Mode>
46 struct DataStream<Stream, Mode, Shadok>{
47  static bool data_stream(Stream & ds, Shadok & data){
48  return data.data_stream<Stream, Mode>(ds);
49  }
50 };
51 
52 #include "Shadok_impl.h"
53 
54 #endif
55 
DataStream< Stream, Mode, Shadok >::data_stream
static bool data_stream(Stream &ds, Shadok &data)
Definition: Shadok.h:47
Shadok::p_name
std::string p_name
Name of the Shadok.
Definition: Shadok.h:45
Shadok::operator=
Shadok & operator=(const Shadok &other)
Definition of equal operator of Shadok.
Definition: Shadok.cpp:31
Shadok::~Shadok
virtual ~Shadok()
Destructeur of Shadok.
Definition: Shadok.cpp:23
Shadok::data_stream
bool data_stream(Stream &ds)
Function to load/save serialise and deserialise a Shadok in message/stream/file.
Definition: Shadok_impl.h:17
Shadok::getAge
int getAge() const
Get the age of the Shadok.
Definition: Shadok.cpp:49
Shadok::initialisationShadok
void initialisationShadok()
Initialisation function of the class Shadok.
Definition: Shadok.cpp:75
Shadok::Shadok
Shadok()
Default constructeur of Shadok.
Definition: Shadok.cpp:11
Shadok_impl.h
Shadok::copyShadok
void copyShadok(const Shadok &other)
Copy function of Shadok.
Definition: Shadok.cpp:69
Shadok::setAge
void setAge(int age)
Set the age of the Shadok.
Definition: Shadok.cpp:39
Shadok::getName
const std::string & getName() const
Get the name of the Shadok.
Definition: Shadok.cpp:59
data_all.h
DataStream
Generic DataStream class.
Definition: data_stream_include.h:27
Shadok
test class for the data_stream automatic api
Definition: Shadok.h:13
Shadok::setName
void setName(const std::string &name)
Set the name of the Shadok.
Definition: Shadok.cpp:44
Shadok::p_age
int p_age
Age the Shadok.
Definition: Shadok.h:43