OpenDaVINCI  4.15.3
QueryableNetstringsSerializer.h
Go to the documentation of this file.
1 
20 #ifndef OPENDAVINCI_CORE_SERIALIZATION_QUERYABLENETSTRINGSSERIALIZER_H_
21 #define OPENDAVINCI_CORE_SERIALIZATION_QUERYABLENETSTRINGSSERIALIZER_H_
22 
23 #include <sstream>
24 #include <string>
25 
30 
31 namespace odcore {
32  namespace serialization {
33 
34 class Serializable;
35 
36  using namespace std;
37 
38 
51  public:
52  // Only the SerializationFactory or its subclasses are allowed to create instances of this Serializer using non-standard constructors.
53  friend class SerializationFactory;
54 
60  QueryableNetstringsSerializer(ostream &out);
61 
62  private:
69 
76 
77  public:
83 
85 
86  virtual void getSerializedData(ostream &o);
87 
88  public:
89  virtual uint32_t writeValue(ostream &o, const Serializable &v);
90  virtual uint32_t writeValue(ostream &o, const bool &v);
91  virtual uint32_t writeValue(ostream &o, const char &v);
92  virtual uint32_t writeValue(ostream &o, const unsigned char &v);
93  virtual uint32_t writeValue(ostream &o, const int8_t &v);
94  virtual uint32_t writeValue(ostream &o, const int16_t &v);
95  virtual uint32_t writeValue(ostream &o, const uint16_t &v);
96  virtual uint32_t writeValue(ostream &o, const int32_t &v);
97  virtual uint32_t writeValue(ostream &o, const uint32_t &v);
98  virtual uint32_t writeValue(ostream &o, const int64_t &v);
99  virtual uint32_t writeValue(ostream &o, const uint64_t &v);
100  virtual uint32_t writeValue(ostream &o, const float &v);
101  virtual uint32_t writeValue(ostream &o, const double &v);
102  virtual uint32_t writeValue(ostream &o, const string &v);
103  virtual uint32_t writeValue(ostream &o, const void *data, const uint32_t &size);
104 
105  public:
106  virtual void write(const uint32_t &id, const Serializable &s);
107  virtual void write(const uint32_t &id, const bool &b);
108  virtual void write(const uint32_t &id, const char &c);
109  virtual void write(const uint32_t &id, const unsigned char &uc);
110  virtual void write(const uint32_t &id, const int8_t &i);
111  virtual void write(const uint32_t &id, const int16_t &i);
112  virtual void write(const uint32_t &id, const uint16_t &ui);
113  virtual void write(const uint32_t &id, const int32_t &i);
114  virtual void write(const uint32_t &id, const uint32_t &ui);
115  virtual void write(const uint32_t &id, const int64_t &i);
116  virtual void write(const uint32_t &id, const uint64_t &ui);
117  virtual void write(const uint32_t &id, const float &f);
118  virtual void write(const uint32_t &id, const double &d);
119  virtual void write(const uint32_t &id, const string &s);
120  virtual void write(const uint32_t &id, const void *data, const uint32_t &size);
121 
122  public:
123  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const Serializable &s);
124  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const bool &b);
125  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const char &c);
126  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const unsigned char &uc);
127  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const int8_t &i);
128  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const int16_t &i);
129  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const uint16_t &ui);
130  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const int32_t &i);
131  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const uint32_t &ui);
132  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const int64_t &i);
133  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const uint64_t &ui);
134  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const float &f);
135  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const double &d);
136  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const string &s);
137  virtual void write(const uint32_t &id, const string &longName, const string &shortName, const void *data, const uint32_t &size);
138 
139  private:
140  ostream *m_out; // We have a pointer here that we derive from a reference parameter in our non-standard constructor; thus, the other class is responsible for the lifecycle of the variable to which we point to.
143  Serializer* m_serializer;
144  };
145 
146  }
147 } // odcore::serialization
148 
149 #endif /*OPENDAVINCI_CORE_SERIALIZATION_QUERYABLENETSTRINGSSERIALIZER_H_*/
Definition: Serializer.h:38
Definition: QueryableNetstringsSerializerABCF.h:46
Definition: QueryableNetstringsSerializerAACF.h:46
Definition: SerializationFactory.h:45
Definition: QueryableNetstringsSerializer.h:50
Definition: Serializable.h:59