OpenDaVINCI  4.16.0
QueryableNetstringsSerializerABCF.h
Go to the documentation of this file.
1 
20 #ifndef OPENDAVINCI_CORE_SERIALIZATION_QUERYABLENETSTRINGSSERIALIZERABCF_H_
21 #define OPENDAVINCI_CORE_SERIALIZATION_QUERYABLENETSTRINGSSERIALIZERABCF_H_
22 
23 #include <sstream>
24 #include <string>
25 
28 
29 namespace odcore {
30  namespace serialization {
31 
32 class Serializable;
33 
34  using namespace std;
35 
36 
47  private:
48  // Only the QueryableNetstringsSerializer is allowed to create instances of this Serializer using the non-standard constructor.
50 
57 
64 
65  public:
67 
69 
70  virtual void getSerializedData(ostream &o);
71 
72  public:
73  virtual uint32_t writeValue(ostream &o, const Serializable &v);
74  virtual uint32_t writeValue(ostream &o, const bool &v);
75  virtual uint32_t writeValue(ostream &o, const char &v);
76  virtual uint32_t writeValue(ostream &o, const unsigned char &v);
77  virtual uint32_t writeValue(ostream &o, const int8_t &v);
78  virtual uint32_t writeValue(ostream &o, const int16_t &v);
79  virtual uint32_t writeValue(ostream &o, const uint16_t &v);
80  virtual uint32_t writeValue(ostream &o, const int32_t &v);
81  virtual uint32_t writeValue(ostream &o, const uint32_t &v);
82  virtual uint32_t writeValue(ostream &o, const int64_t &v);
83  virtual uint32_t writeValue(ostream &o, const uint64_t &v);
84  virtual uint32_t writeValue(ostream &o, const float &v);
85  virtual uint32_t writeValue(ostream &o, const double &v);
86  virtual uint32_t writeValue(ostream &o, const string &v);
87  virtual uint32_t writeValue(ostream &o, const void *data, const uint32_t &size);
88 
89  public:
90  virtual void write(const uint32_t &id, const Serializable &s);
91  virtual void write(const uint32_t &id, const bool &b);
92  virtual void write(const uint32_t &id, const char &c);
93  virtual void write(const uint32_t &id, const unsigned char &uc);
94  virtual void write(const uint32_t &id, const int8_t &i);
95  virtual void write(const uint32_t &id, const int16_t &i);
96  virtual void write(const uint32_t &id, const uint16_t &ui);
97  virtual void write(const uint32_t &id, const int32_t &i);
98  virtual void write(const uint32_t &id, const uint32_t &ui);
99  virtual void write(const uint32_t &id, const int64_t &i);
100  virtual void write(const uint32_t &id, const uint64_t &ui);
101  virtual void write(const uint32_t &id, const float &f);
102  virtual void write(const uint32_t &id, const double &d);
103  virtual void write(const uint32_t &id, const string &s);
104  virtual void write(const uint32_t &id, const void *data, const uint32_t &size);
105 
106  public:
107  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const Serializable &s);
108  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const bool &b);
109  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const char &c);
110  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const unsigned char &uc);
111  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const int8_t &i);
112  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const int16_t &i);
113  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const uint16_t &ui);
114  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const int32_t &i);
115  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const uint32_t &ui);
116  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const int64_t &i);
117  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const uint64_t &ui);
118  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const float &f);
119  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const double &d);
120  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const string &s);
121  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const void *data, const uint32_t &size);
122 
123  private:
131  uint8_t encodeVarUInt(ostream &out, uint64_t value);
132 
140  uint8_t encodeVarInt(ostream &out, int64_t value);
141 
142  private:
143  stringstream m_buffer;
144  };
145 
146  }
147 } // odcore::serialization
148 
149 #endif /*OPENDAVINCI_CORE_SERIALIZATION_QUERYABLENETSTRINGSSERIALIZERABCF_H_*/
Definition: Serializer.h:38
Definition: QueryableNetstringsSerializerABCF.h:46
Definition: QueryableNetstringsSerializer.h:50
Definition: Serializable.h:59