ESyS-Particle  4.0.1
packed_message_interface.h
1 
2 // //
3 // Copyright (c) 2003-2011 by The University of Queensland //
4 // Earth Systems Science Computational Centre (ESSCC) //
5 // http://www.uq.edu.au/esscc //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.opensource.org/licenses/osl-3.0.php //
10 // //
12 
13 #ifndef __PACKED_MESSAGE_INTERFACE_H
14 #define __PACKED_MESSAGE_INTERFACE_H
15 
16 //--- project includes ---
17 #include "Foundation/vec3.h" // for append(Vec3), pop_vec3()
18 
19 //--- STL includes ---
20 #include <string>
21 using std::string;
22 
29 {
30  public:
31  virtual void begin_pack()=0;
32  virtual void begin_unpack()=0;
33  virtual void append(int)=0;
34  virtual void append(double)=0;
35  virtual void append(const string&)=0;
36  virtual void append(const Vec3&)=0;
37  virtual void append(bool)=0;
38 
39  virtual int pop_int()=0;
40  virtual double pop_double()=0;
41  virtual void pop_doubles(double*,int)=0;
42  virtual string pop_string()=0;
43  virtual Vec3 pop_vec3()=0;
44  virtual bool pop_bool()=0;
45 
46  template<typename T> void pack(const T&);
47  template<typename T> void unpack(T&);
48 };
49 
50 #endif //__PACKED_MESSAGE_INTERFACE_H