SLikeNet  0.1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CloudCommon.h
Go to the documentation of this file.
1 /*
2  * Original work: Copyright (c) 2014, Oculus VR, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * RakNet License.txt file in the licenses directory of this source tree. An additional grant
7  * of patent rights can be found in the RakNet Patents.txt file in the same directory.
8  *
9  *
10  * Modified work: Copyright (c) 2017, SLikeSoft UG (haftungsbeschränkt)
11  *
12  * This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
13  * license found in the license.txt file in the root directory of this source tree.
14  */
15 
16 #include "NativeFeatureIncludes.h"
17 #if _RAKNET_SUPPORT_CloudClient==1 || _RAKNET_SUPPORT_CloudServer==1
18 
19 #ifndef __CLOUD_COMMON_H
20 #define __CLOUD_COMMON_H
21 
22 #include "types.h"
23 #include "string.h"
24 
25 namespace SLNet
26 {
27 
28 class BitStream;
29 struct CloudQueryRow;
30 
34 {
35 public:
37  virtual ~CloudAllocator() {}
38 
40  virtual CloudQueryRow* AllocateCloudQueryRow(void);
42  virtual void DeallocateCloudQueryRow(CloudQueryRow *row);
44  virtual unsigned char *AllocateRowData(uint32_t bytesNeededForData);
46  virtual void DeallocateRowData(void *data);
47 };
48 
52 {
53  CloudKey() {}
54  CloudKey(SLNet::RakString _primaryKey, uint32_t _secondaryKey) : primaryKey(_primaryKey), secondaryKey(_secondaryKey) {}
55  ~CloudKey() {}
56 
60 
63 
65  void Serialize(bool writeToBitstream, BitStream *bitStream);
66 };
67 
69 int CloudKeyComp(const CloudKey &key, const CloudKey &data);
70 
74 {
75  CloudQuery() {startingRowIndex=0; maxRowsToReturn=0; subscribeToResults=false;}
76 
81 
84 
87 
90 
92  void Serialize(bool writeToBitstream, BitStream *bitStream);
93 };
94 
97 {
100 
102  unsigned char *data;
103 
106 
109 
112 
115 
118 
120  void Serialize(bool writeToBitstream, BitStream *bitStream, CloudAllocator *allocator);
121 };
122 
125 {
128 
131 
137 
140 
142  void Serialize(bool writeToBitstream, BitStream *bitStream, CloudAllocator *allocator);
144  void SerializeHeader(bool writeToBitstream, BitStream *bitStream);
146  void SerializeNumRows(bool writeToBitstream, uint32_t &numRows, BitStream *bitStream);
148  void SerializeCloudQueryRows(bool writeToBitstream, uint32_t &numRows, BitStream *bitStream, CloudAllocator *allocator);
149 };
150 
151 } // Namespace SLikeNet
152 
153 #endif // __CLOUD_COMMON_H
154 
155 #endif // #if _RAKNET_SUPPORT_CloudClient==1 || _RAKNET_SUPPORT_CloudServer==1