OpenDaVINCI  4.16.0
QueryableNetstringsDeserializerABCF.h
Go to the documentation of this file.
1 
20 #ifndef OPENDAVINCI_CORE_SERIALIZATION_QUERYABLENETSTRINGSDESERIALIZERABCF_H_
21 #define OPENDAVINCI_CORE_SERIALIZATION_QUERYABLENETSTRINGSDESERIALIZERABCF_H_
22 
23 #include <map>
24 #include <sstream>
25 #include <string>
26 
30 
31 namespace odcore {
32  namespace serialization {
33 
34  using namespace std;
35 
36 
47  private:
48  // Only the QueryableNetstringsDeserializer is allowed to create instances of this Deserializer using the non-standard constructor.
50 
57 
58  private:
65 
72 
73 
74  public:
81 
83 
84  virtual void deserializeDataFrom(istream &in);
85 
86  public:
87  virtual uint32_t readValue(istream &i, Serializable &v);
88  virtual uint32_t readValue(istream &i, bool &v);
89  virtual uint32_t readValue(istream &i, char &v);
90  virtual uint32_t readValue(istream &i, unsigned char &v);
91  virtual uint32_t readValue(istream &i, int8_t &v);
92  virtual uint32_t readValue(istream &i, int16_t &v);
93  virtual uint32_t readValue(istream &i, uint16_t &v);
94  virtual uint32_t readValue(istream &i, int32_t &v);
95  virtual uint32_t readValue(istream &i, uint32_t &v);
96  virtual uint32_t readValue(istream &i, int64_t &v);
97  virtual uint32_t readValue(istream &i, uint64_t &v);
98  virtual uint32_t readValue(istream &i, float &v);
99  virtual uint32_t readValue(istream &i, double &v);
100  virtual uint32_t readValue(istream &i, string &v);
101  virtual uint32_t readValue(istream &i, void *data, const uint32_t &size);
102 
103  public:
104  virtual void read(const uint32_t &id, Serializable &s);
105  virtual void read(const uint32_t &id, bool &b);
106  virtual void read(const uint32_t &id, char &c);
107  virtual void read(const uint32_t &id, unsigned char &uc);
108  virtual void read(const uint32_t &id, int8_t &i);
109  virtual void read(const uint32_t &id, int16_t &i);
110  virtual void read(const uint32_t &id, uint16_t &ui);
111  virtual void read(const uint32_t &id, int32_t &i);
112  virtual void read(const uint32_t &id, uint32_t &ui);
113  virtual void read(const uint32_t &id, int64_t &i);
114  virtual void read(const uint32_t &id, uint64_t &ui);
115  virtual void read(const uint32_t &id, float &f);
116  virtual void read(const uint32_t &id, double &d);
117  virtual void read(const uint32_t &id, string &s);
118  virtual void read(const uint32_t &id, void *data, const uint32_t &size);
119 
120  public:
121  virtual void read(const uint32_t &id, const string &longName, const string &shortName, Serializable &s);
122  virtual void read(const uint32_t &id, const string &longName, const string &shortName, bool &b);
123  virtual void read(const uint32_t &id, const string &longName, const string &shortName, char &c);
124  virtual void read(const uint32_t &id, const string &longName, const string &shortName, unsigned char &uc);
125  virtual void read(const uint32_t &id, const string &longName, const string &shortName, int8_t &i);
126  virtual void read(const uint32_t &id, const string &longName, const string &shortName, int16_t &i);
127  virtual void read(const uint32_t &id, const string &longName, const string &shortName, uint16_t &ui);
128  virtual void read(const uint32_t &id, const string &longName, const string &shortName, int32_t &i);
129  virtual void read(const uint32_t &id, const string &longName, const string &shortName, uint32_t &ui);
130  virtual void read(const uint32_t &id, const string &longName, const string &shortName, int64_t &i);
131  virtual void read(const uint32_t &id, const string &longName, const string &shortName, uint64_t &ui);
132  virtual void read(const uint32_t &id, const string &longName, const string &shortName, float &f);
133  virtual void read(const uint32_t &id, const string &longName, const string &shortName, double &d);
134  virtual void read(const uint32_t &id, const string &longName, const string &shortName, string &s);
135  virtual void read(const uint32_t &id, const string &longName, const string &shortName, void *data, const uint32_t &size);
136 
137  public:
146  static uint32_t fillBuffer(istream& in, stringstream& buffer);
147 
148  private:
156  uint8_t decodeVarUInt(istream& in, uint64_t &value);
157 
165  uint8_t decodeVarInt(istream& in, int64_t &value);
166 
167  private:
168  stringstream m_buffer;
169  map<uint32_t, streampos> m_values;
170  };
171 
172  }
173 } // odcore::serialization
174 
175 #endif /*OPENDAVINCI_CORE_SERIALIZATION_QUERYABLENETSTRINGSDESERIALIZERABCF_H_*/
#define OPENDAVINCI_API
Definition: opendavinci.h:67
Definition: QueryableNetstringsDeserializer.h:49
Definition: QueryableNetstringsDeserializerABCF.h:46
Definition: Serializable.h:59
Definition: Deserializer.h:39