Ditto 4.13.1
 
Loading...
Searching...
No Matches
SyncSubscription.hpp
1#ifndef DITTO_SYNC_SUBSCRIPTION_H
2#define DITTO_SYNC_SUBSCRIPTION_H
3
4#include "Ditto.hpp"
5#include "Observer.hpp"
6#include "Sync.hpp"
7
8#include "json.hpp"
9
10#include <memory>
11#include <vector>
12
13namespace ditto {
14
19class SyncSubscription : Observer,
20 public std::enable_shared_from_this<SyncSubscription> {
21 friend class Sync;
22
23private:
24 SyncSubscription(std::weak_ptr<Ditto::Fields> weak_ditto_fields,
25 std::string query, nlohmann::json args);
26 /* Pointer to the ditto instance */
27 std::weak_ptr<Ditto::Fields> weak_ditto_fields;
28 /* Corresponding query */
29 std::string query;
30 /* Query args stored in cbor format */
31 std::vector<uint8_t> cbor_query_args;
32 /* `Observer` callback */
33 void on_stop() override;
34
35public:
41 void cancel();
49};
50
51}; // namespace ditto
52#endif
Observer()
Constructs a new Observer.
void cancel()
Cancels the sync subscription so that new changes matching the query are no longer received from othe...
Namespace for the Ditto C++ SDK types and functions.
Definition AbstractDocumentPath.hpp:19