Ditto 4.13.1
 
Loading...
Searching...
No Matches
Subscription.hpp
1#ifndef DITTO_SUBSCRIPTION_H
2#define DITTO_SUBSCRIPTION_H
3
4#include "Helpers.hpp"
5#include "Observer.hpp"
6#include "json.hpp"
7
8#include <memory>
9#include <string>
10
11namespace ditto {
12class DittoHandleWrapper;
13class OrderBy;
14
23class DITTO_DEPRECATED_BECAUSE(
24 "Use DQL (Ditto Query Language) instead. For more information see: "
25 "https://ditto.com/link/legacy-to-dql-guide") Subscription
26 : public Observer {
27 DITTO_DISABLE_DEPRECATED_WARNINGS("The legacy query API is deprecated")
28
29 friend class PendingIDSpecificOperation;
30 friend class PendingCursorOperation;
31
32 std::shared_ptr<DittoHandleWrapper> ditto_handle_wrapper;
33 nlohmann::json query_args;
34 std::shared_ptr<OrderBy> order_by;
35 int32_t limit = -1;
36 uint32_t offset = 0;
37
38 Subscription(std::shared_ptr<DittoHandleWrapper> ditto_handle_wrapper,
39 std::string query, nlohmann::json query_args,
40 std::shared_ptr<OrderBy> order_by, int32_t limit,
41 uint32_t offset, std::string collection_name);
42
43 void on_stop() override;
44
45public:
49 // TODO(v5): make query private and provide a getter
50 std::string query; // NOLINT
51
55 // TODO(v5): make collection_name private and provide a getter
56 std::string collection_name; // NOLINT
57
58 ~Subscription();
59
60 DITTO_REENABLE_WARNINGS
61};
62} // namespace ditto
63#endif
Observer()
Constructs a new Observer.
Definition order_by.hpp:19
std::string query
Definition Subscription.hpp:50
std::string collection_name
Definition Subscription.hpp:56
Namespace for the Ditto C++ SDK types and functions.
Definition AbstractDocumentPath.hpp:19