Ditto 4.4.0
Loading...
Searching...
No Matches
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
10namespace ditto {
11class DittoHandleWrapper;
12class OrderBy;
13
19class 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
36public:
40 std::string query;
41
45 std::string collection_name;
46
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