Mobile API Reference  MicroStrategy 2019
PDSerialization.h
Go to the documentation of this file.
1 //==============================================================================================
2 // FILENAME : PDSerilization.h
3 // AUTHOR : Yi Luo
4 // CREATION : 2002-07-10
5 // Copyright (C) MicroStrategy, Inc. 2002
6 //==============================================================================================
7 #ifndef Serialization_PDSerialization_H
8 #define Serialization_PDSerialization_H
9 
10 #ifdef WIN32
11 
12  #ifdef PDSERIALIZATION_DLL_EXPORT
13  #define DLL_PDSERIALIZATION_EXIM _declspec(dllexport)
14  #else
15  #define DLL_PDSERIALIZATION_EXIM _declspec(dllimport)
16  #endif
17 
18 #pragma warning( disable: 4244)
19 
20 #else
21  #define DLL_PDSERIALIZATION_EXIM
22 #endif
23 
24 // Endianess is determined by CPU architecture
25 #if defined(WIN32) || defined(__i386) || defined(__x86_64) || defined(_MAC) || defined(__ANDROID__) // The last is for Android
26  #ifndef LITTLE_ENDIAN
27  #define LITTLE_ENDIAN
28  #endif
29 #elif defined(__sparc) || defined(_POWER) || defined(__hpux)
30 // #define BIG_ENDIAN
31  #undef LITTLE_ENDIAN
32 #else
33 #error Unknown Platform
34 #endif
35 
36 
38 
39 namespace MSerialization
40 {
41 
42  class ReadDataStream;
43  class WriteDataStream;
44 
47 
50  {
51  public:
53  };
54 
57  {
58  public:
60  };
61 
62 
64  {
65  public:
66  virtual void Serialize(WriteDataStream&) const = 0;
67  virtual void DeSerialize(ReadDataStream&) = 0;
68 
69  virtual ~SerializableObject() throw(){}
70  };
71 
80  virtual public SerializableObject
81  {
82  public:
83  virtual Int32 GetType() const = 0;
84 
85  virtual ~PolymorphicSerializableObject() throw(){}
86  };
87  enum TYPE
88  {
90  T_UTF8 =1,
92  T_BOOL =3,
93  T_SHORT =4,
95  T_INT =6,
96  T_UINT =7,
97  T_INT64 =8,
98  T_GUID =9,
102  T_BINARY =13,
103  T_BLOCK =14,
104  T_LIST =15,
107  T_BYTE =18,
109  T_FLOAT =20,
110  T_CHAR =21,
111  T_OBJECT =22,
113 
114 
115  T_ARRAY =0x80,
117  };
118 }
119 
120 
121 #define PDS_SAFE_STREAM 0x8000
122 #define PDS_RAW_STREAM 0x4000
123 #define PDS_BIG_ENDIAN_STREAM 0x2000
124 #define PDS_SIMPLE_ENCRYPT_STREAM 0x0100
125 #define PDS_RC4_ENCRYPT_STREAM 0x0200
126 #define PDS_TEA_ENCRYPT_STREAM 0x0400
127 #define PDS_AES_ENCRYPT_STREAM 0x0800
128 
129 #endif // Serialization_PDSerialization_H
Definition: PDSerialization.h:106
Definition: PDSerialization.h:104
the exception during write stream operations
Definition: PDSerialization.h:56
Definition: PDSerialization.h:100
Definition: PDSerialization.h:105
Definition: PDSerialization.h:98
Definition: PDSerialization.h:109
Definition: PDSerialization.h:63
Definition: PDSerialization.h:111
TYPE
Definition: PDSerialization.h:87
Definition: PDSerialization.h:110
Definition: PDSerialization.h:93
Definition: PDSerialization.h:108
virtual ~SerializableObject()
Definition: PDSerialization.h:69
virtual ~PolymorphicSerializableObject()
Definition: PDSerialization.h:85
Definition: PDSerialization.h:96
Definition: PDSerialization.h:101
Definition: PDSerialization.h:102
Definition: PDSerialization.h:91
#define Int32
Definition: BasicTypes.h:20
Definition: PDSerialization.h:103
virtual void Serialize(WriteDataStream &) const =0
Definition: ReadDataStream.h:51
Definition: PDSerialization.h:95
Definition: Message.h:32
Definition: PDSerialization.h:112
Definition: PDSerialization.h:90
Definition: PDSerialization.h:89
Definition: PDSerialization.h:94
Definition: PDSerialization.h:99
Definition: PDSerialization.h:107
Definition: PDSerialization.h:116
the exception during read stream operations
Definition: PDSerialization.h:49
the root class for all exceptions in Serialization namespace
Definition: PDSerialization.h:46
Definition: PDSerialization.h:97
Definition: WriteDataStream.h:55
Definition: MultiReadStream.h:23
Definition: PDSerialization.h:115
Definition: PDSerialization.h:92
Definition: PDSerialization.h:79
virtual void DeSerialize(ReadDataStream &)=0