Ditto  3.0.4
Subscription.hpp
1 #ifndef _DITTO_SUBSCRIPTION_
2 #define _DITTO_SUBSCRIPTION_
3 
4 #include "Observer.hpp"
5 #include "json.hpp"
6 
7 #include <memory>
8 #include <string>
9 
10 namespace ditto {
11 class DittoHandleWrapper;
12 class OrderBy;
13 
19 class Subscription : public Observer {
20  friend class PendingIDSpecificOperation;
21  friend class PendingCursorOperation;
22 
23  std::shared_ptr<DittoHandleWrapper> ditto_handle_wrapper;
24  nlohmann::json query_args;
25  std::shared_ptr<OrderBy> order_by;
26  int32_t limit = -1;
27  uint32_t offset = 0;
28 
29  Subscription(std::shared_ptr<DittoHandleWrapper> ditto_handle_wrapper,
30  std::string query, nlohmann::json query_args,
31  std::shared_ptr<OrderBy> order_by, int32_t limit,
32  uint32_t offset, std::string collection_name);
33 
34  void on_stop() override;
35 
36 public:
40  std::string query;
41 
45  std::string collection_name;
46 
47  ~Subscription();
48 };
49 } // namespace ditto
50 #endif
An observation token returned by any observation API in the Ditto SDK. Retain this object to continue...
Definition: Observer.hpp:11
These objects are returned when using find-like functionality on Collection objects.
Definition: PendingCursorOperation.hpp:44
These objects are returned when using Collection::find_by_id functionality.
Definition: PendingIDSpecificOperation.hpp:40
While Subscription objects remain in scope they ensure that documents in the collection specified,...
Definition: Subscription.hpp:19
std::string query
Definition: Subscription.hpp:40
std::string collection_name
Definition: Subscription.hpp:45
basic_json<> json
default JSON class
Definition: json.hpp:2933