OpenDaVINCI  4.16.0
Deserializer.h
Go to the documentation of this file.
1 
20 #ifndef OPENDAVINCI_CORE_SERIALIZATION_DESERIALIZER_H_
21 #define OPENDAVINCI_CORE_SERIALIZATION_DESERIALIZER_H_
22 
23 #include <string>
24 
26 
27 namespace odcore {
28  namespace serialization {
29 
30  using namespace std;
31 
32  class Serializable;
33 
40  public:
41  Deserializer();
42 
43  virtual ~Deserializer();
44 
52  virtual void deserializeDataFrom(istream &in) = 0;
53 
54  public:
62  virtual uint32_t readValue(istream &i, Serializable &v) = 0;
63 
71  virtual uint32_t readValue(istream &i, bool &v) = 0;
72 
80  virtual uint32_t readValue(istream &i, char &v) = 0;
81 
89  virtual uint32_t readValue(istream &i, unsigned char &v) = 0;
90 
98  virtual uint32_t readValue(istream &i, int8_t &v) = 0;
99 
107  virtual uint32_t readValue(istream &i, int16_t &v) = 0;
108 
116  virtual uint32_t readValue(istream &i, uint16_t &v) = 0;
117 
125  virtual uint32_t readValue(istream &i, int32_t &v) = 0;
126 
134  virtual uint32_t readValue(istream &i, uint32_t &v) = 0;
135 
143  virtual uint32_t readValue(istream &i, int64_t &v) = 0;
144 
152  virtual uint32_t readValue(istream &i, uint64_t &v) = 0;
153 
161  virtual uint32_t readValue(istream &i, float &v) = 0;
162 
170  virtual uint32_t readValue(istream &i, double &v) = 0;
171 
179  virtual uint32_t readValue(istream &i, string &v) = 0;
180 
189  virtual uint32_t readValue(istream &i, void *data, const uint32_t &size) = 0;
190 
191  public:
198  virtual void read(const uint32_t &id, Serializable &s) = 0;
199 
206  virtual void read(const uint32_t &id, bool &b) = 0;
207 
214  virtual void read(const uint32_t &id, char &c) = 0;
215 
222  virtual void read(const uint32_t &id, unsigned char &uc) = 0;
223 
230  virtual void read(const uint32_t &id, int8_t &i) = 0;
231 
238  virtual void read(const uint32_t &id, int16_t &i) = 0;
239 
246  virtual void read(const uint32_t &id, uint16_t &ui) = 0;
247 
254  virtual void read(const uint32_t &id, int32_t &i) = 0;
255 
262  virtual void read(const uint32_t &id, uint32_t &ui) = 0;
263 
270  virtual void read(const uint32_t &id, int64_t &i) = 0;
271 
278  virtual void read(const uint32_t &id, uint64_t &ui) = 0;
279 
286  virtual void read(const uint32_t &id, float &f) = 0;
287 
294  virtual void read(const uint32_t &id, double &d) = 0;
295 
302  virtual void read(const uint32_t &id, string &s) = 0;
303 
311  virtual void read(const uint32_t &id, void *data, const uint32_t &size) = 0;
312 
313  public:
322  virtual void read(const uint32_t &id, const string &longName, const string &shortName, Serializable &s) = 0;
323 
332  virtual void read(const uint32_t &id, const string &longName, const string &shortName, bool &b) = 0;
333 
342  virtual void read(const uint32_t &id, const string &longName, const string &shortName, char &c) = 0;
343 
352  virtual void read(const uint32_t &id, const string &longName, const string &shortName, unsigned char &uc) = 0;
353 
362  virtual void read(const uint32_t &id, const string &longName, const string &shortName, int8_t &i) = 0;
363 
372  virtual void read(const uint32_t &id, const string &longName, const string &shortName, int16_t &i) = 0;
373 
382  virtual void read(const uint32_t &id, const string &longName, const string &shortName, uint16_t &ui) = 0;
383 
392  virtual void read(const uint32_t &id, const string &longName, const string &shortName, int32_t &i) = 0;
393 
402  virtual void read(const uint32_t &id, const string &longName, const string &shortName, uint32_t &ui) = 0;
403 
412  virtual void read(const uint32_t &id, const string &longName, const string &shortName, int64_t &i) = 0;
413 
422  virtual void read(const uint32_t &id, const string &longName, const string &shortName, uint64_t &ui) = 0;
423 
432  virtual void read(const uint32_t &id, const string &longName, const string &shortName, float &f) = 0;
433 
442  virtual void read(const uint32_t &id, const string &longName, const string &shortName, double &d) = 0;
443 
452  virtual void read(const uint32_t &id, const string &longName, const string &shortName, string &s) = 0;
453 
463  virtual void read(const uint32_t &id, const string &longName, const string &shortName, void *data, const uint32_t &size) = 0;
464 
465  public:
473  static float ntohf(float f);
474 
482  static double ntohd(double d);
483 
491  static uint64_t __ntohll(uint64_t ui);
492 
500  static int64_t __ntohll(int64_t i);
501  };
502 
503  }
504 } // odcore::serialization
505 
506 #endif /*OPENDAVINCI_CORE_SERIALIZATION_DESERIALIZER_H_*/
#define OPENDAVINCI_API
Definition: opendavinci.h:67
Definition: Serializable.h:59
Definition: Deserializer.h:39