1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
| #ifndef SERIALIZER_H
| #define SERIALIZER_H
|
| #define SERIALIZER_INT_32(i, p, r, uu) nRet = CSerializer::SerializedInt32(i, p, r); if (nRet < 0) { return nRet; } p += nRet; r -= nRet; uu += nRet;
| #define SERIALIZER_INT_64(i, p, r, uu) nRet = CSerializer::SerializedInt64(i, p, r); if (nRet < 0) { return nRet; } p += nRet; r -= nRet; uu += nRet;
| #define SERIALIZER_DOUBLE(d, p, r, uu) nRet = CSerializer::SerializedDouble(d, p, r); if (nRet < 0) { return nRet; } p += nRet; r -= nRet; uu += nRet;
| #define SERIALIZER_H_OBJECT(h, p, r, uu) nRet = CSerializer::SerializedHobject(h, p, r); if (nRet < 0) { return nRet; } p += nRet; r -= nRet; uu += nRet;
| #define SERIALIZER_STRING(s, p, r, uu) nRet = CSerializer::SerializedString(s, p, r); if (nRet < 0) { return nRet; } p += nRet; r -= nRet; uu += nRet;
| #define DESERIALIZER_INT_32(i, p, r, uu) nRet = CSerializer::DeserializedInt32(i, p, r); if (nRet < 0) { return nRet; } p += nRet; r -= nRet; uu += nRet;
| #define DESERIALIZER_INT_64(i, p, r, uu) nRet = CSerializer::DeserializedInt64(i, p, r); if (nRet < 0) { return nRet; } p += nRet; r -= nRet; uu += nRet;
| #define DESERIALIZER_DOUBLE(d, p, r, uu) nRet = CSerializer::DeserializedDouble(d, p, r); if (nRet < 0) { return nRet; } p += nRet; r -= nRet; uu += nRet;
| #define DESERIALIZER_STRING(s, p, r, uu) nRet = CSerializer::DeserializedString(s, p, r); if (nRet < 0) { return nRet; } p += nRet; r -= nRet; uu += nRet;
| #define DESERIALIZER_H_OBJECT(h, p, r, uu) nRet = CSerializer::DeserializedHobject(h, p, r); if (nRet < 0) { return nRet; } p += nRet; r -= nRet; uu += nRet;
|
| class CSerializer
| {
| public:
| CSerializer();
| ~CSerializer();
|
| public:
| static int SerializedInt32(int& i, void* pBuffer, int size);
| static int SerializedInt64(__int64& i, void* pBuffer, int size);
| static int SerializedFloat(float& f, void* pBuffer, int size);
| static int SerializedDouble(double& d, void* pBuffer, int size);
| static int SerializedBuffer(void*pScrBuffer, int scrSize, void* pBuffer, int size);
| static int SerializedString(std::string& str, void* pBuffer, int size);
| static int SerializedHobject(HalconCpp::HObject& hObject, void* pBuffer, int size);
| static int DeserializedInt32(int& i, void* pBuffer, int size);
| static int DeserializedInt64(__int64& i, void* pBuffer, int size);
| static int DeserializedFloat(float& f, void* pBuffer, int size);
| static int DeserializedDouble(double& d, void* pBuffer, int size);
| static int DeserializedBuffer(void*pTarBuffer, int tarSize, void* pBuffer, int size);
| static int DeserializedString(std::string& str, void* pBuffer, int size);
| static int DeserializedHobject(HalconCpp::HObject& hObject, void* pBuffer, int size);
| };
|
| #endif
|
|