PVData C++  8.0.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
serializeHelper.h
1 /*
2  * Copyright information and license terms for this software can be
3  * found in the file LICENSE that is included with the distribution
4  */
5 /*
6  * serializeHelper.h
7  *
8  * Created on: Oct 21, 2010
9  * Author: Miha Vitorovic
10  */
11 
12 #ifndef SERIALIZEHELPER_H_
13 #define SERIALIZEHELPER_H_
14 
15 #include <pv/serialize.h>
16 #include <pv/byteBuffer.h>
17 #include <pv/noDefaultMethods.h>
18 #include <pv/pvIntrospect.h>
19 
20 #include <shareLib.h>
21 
22 namespace epics {
23  namespace pvData {
24 
29  class epicsShareClass SerializeHelper {
30  EPICS_NOT_COPYABLE(SerializeHelper)
31  public:
32 
43  static void writeSize(std::size_t s, ByteBuffer* buffer,
44  SerializableControl* flusher);
45 
55  static std::size_t readSize(ByteBuffer* buffer,
56  DeserializableControl* control);
57 
65  static void serializeString(const std::string& value, ByteBuffer* buffer,
66  SerializableControl* flusher);
67 
77  static void serializeSubstring(const std::string& value, std::size_t offset,
78  std::size_t count, ByteBuffer* buffer,
79  SerializableControl* flusher);
80 
95  static std::string deserializeString(ByteBuffer* buffer,
96  DeserializableControl* control);
97 
98  private:
99  SerializeHelper() {};
100  ~SerializeHelper() {};
101 
108  static void writeSize(std::size_t s, ByteBuffer* buffer);
109 
110  };
111 
112  }
113 }
114 
115 #endif /* SERIALIZEHELPER_H_ */
Callback class for serialization.
Definition: serialize.h:42
This class implements a Bytebuffer that is like the java.nio.ByteBuffer.
Definition: byteBuffer.h:236
constexpr iterator_traits< _InputIterator >::difference_type count(_InputIterator __first, _InputIterator __last, const _Tp &__value)
Serialization helper.
Callback class for deserialization.
Definition: serialize.h:93