SLikeNet  0.1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CloudClient.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 
19 
20 
21 #include "NativeFeatureIncludes.h"
22 #if _RAKNET_SUPPORT_CloudClient==1
23 
24 #ifndef __CLOUD_CLIENT_H
25 #define __CLOUD_CLIENT_H
26 
27 #include "PluginInterface2.h"
28 #include "CloudCommon.h"
29 #include "memoryoverride.h"
30 #include "DS_Hash.h"
31 
32 namespace SLNet
33 {
35 class RakPeerInterface;
36 class CloudClientCallback;
37 
42 
47 {
48 public:
49  // GetInstance() and DestroyInstance(instance*)
51 
52  CloudClient();
53  virtual ~CloudClient();
54 
59  virtual void SetDefaultCallbacks(CloudAllocator *_allocator, CloudClientCallback *_callback);
60 
72  virtual void Post(CloudKey *cloudKey, const unsigned char *data, uint32_t dataLengthBytes, RakNetGUID systemIdentifier);
73 
78  virtual void Release(DataStructures::List<CloudKey> &keys, RakNetGUID systemIdentifier);
79 
92  virtual bool Get(CloudQuery *cloudQuery, RakNetGUID systemIdentifier);
93  virtual bool Get(CloudQuery *cloudQuery, DataStructures::List<RakNetGUID> &specificSystems, RakNetGUID systemIdentifier);
94  virtual bool Get(CloudQuery *cloudQuery, DataStructures::List<CloudQueryRow*> &specificSystems, RakNetGUID systemIdentifier);
95 
100  virtual void Unsubscribe(DataStructures::List<CloudKey> &keys, RakNetGUID systemIdentifier);
101  virtual void Unsubscribe(DataStructures::List<CloudKey> &keys, DataStructures::List<RakNetGUID> &specificSystems, RakNetGUID systemIdentifier);
102  virtual void Unsubscribe(DataStructures::List<CloudKey> &keys, DataStructures::List<CloudQueryRow*> &specificSystems, RakNetGUID systemIdentifier);
103 
109  virtual void OnGetReponse(Packet *packet, CloudClientCallback *_callback=0, CloudAllocator *_allocator=0);
110 
118  virtual void OnGetReponse(CloudQueryResult *cloudQueryResult, Packet *packet, CloudAllocator *_allocator=0);
119 
125  virtual void OnSubscriptionNotification(Packet *packet, CloudClientCallback *_callback=0, CloudAllocator *_allocator=0);
126 
135  virtual void OnSubscriptionNotification(bool *wasUpdated, CloudQueryRow *row, Packet *packet, CloudAllocator *_allocator=0);
136 
138  virtual void DeallocateWithDefaultAllocator(CloudQueryResult *cloudQueryResult);
139 
141  virtual void DeallocateWithDefaultAllocator(CloudQueryRow *row);
142 
143 protected:
144  PluginReceiveResult OnReceive(Packet *packet);
145 
148 
150 };
151 
155 {
156 public:
158  virtual ~CloudClientCallback() {}
159 
163  virtual void OnGet(SLNet::CloudQueryResult *result, bool *deallocateRowsAfterReturn) {(void) result; (void) deallocateRowsAfterReturn;}
164 
169  virtual void OnSubscriptionNotification(SLNet::CloudQueryRow *result, bool wasUpdated, bool *deallocateRowAfterReturn) {(void) result; (void) wasUpdated; (void) deallocateRowAfterReturn;}
170 };
171 
172 } // namespace SLNet
173 
174 #endif
175 
176 #endif // _RAKNET_SUPPORT_*