Ditto 4.13.1
 
Loading...
Searching...
No Matches
LiveQueryEvent.hpp
1#ifndef DITTO_LIVE_QUERY_EVENT_H
2#define DITTO_LIVE_QUERY_EVENT_H
3
4#include "Document.hpp"
5#include "LiveQueryMove.hpp"
6
7#include <cstddef>
8#include <vector>
9
10namespace ditto {
11
18class DITTO_DEPRECATED_BECAUSE(
19 "Use DQL (Ditto Query Language) instead. For more information see: "
20 "https://ditto.com/link/legacy-to-dql-guide") LiveQueryEvent {
21 DITTO_DISABLE_DEPRECATED_WARNINGS("The legacy query API is deprecated")
22
23 friend class LiveQuery;
24
25 LiveQueryEvent();
26 LiveQueryEvent(std::vector<Document> old_documents,
27 std::vector<std::size_t> insertions,
28 std::vector<std::size_t> deletions,
29 std::vector<std::size_t> updates,
30 std::vector<LiveQueryMove> moves);
31
32public:
41
46 std::vector<Document> old_documents;
47
52 std::vector<std::size_t> insertions;
53
58 std::vector<std::size_t> deletions;
59
64 std::vector<std::size_t> updates;
65
72 std::vector<LiveQueryMove> moves;
73
81 static uint64_t hash(std::vector<Document> const &documents);
82
92 static std::string hash_mnemonic(std::vector<Document> const &documents);
93
94 DITTO_REENABLE_WARNINGS
95};
96
97} // namespace ditto
98
99#endif
static uint64_t hash(std::vector< Document > const &documents)
Returns a hash that represents the set of matching documents.
std::vector< Document > old_documents
A list of all of the documents that matched the live query as part of the previous update.
Definition LiveQueryEvent.hpp:46
static std::string hash_mnemonic(std::vector< Document > const &documents)
Returns a pattern of words that together create a mnemonic, which represents the set of matching docu...
std::vector< std::size_t > updates
A list of the indexes in the list of new matching documents at which already matching documents have ...
Definition LiveQueryEvent.hpp:64
std::vector< std::size_t > deletions
A list of the indexes in the list of old matching documents at which previously matching documents ha...
Definition LiveQueryEvent.hpp:58
bool is_initial
Returns whether or not this is the initial event for the associated live query.
Definition LiveQueryEvent.hpp:40
std::vector< LiveQueryMove > moves
A list of the move objects that provide the indexes, in relation to the list of old matching document...
Definition LiveQueryEvent.hpp:72
std::vector< std::size_t > insertions
A list of the indexes in the list of new matching documents at which new matching documents have been...
Definition LiveQueryEvent.hpp:52
Namespace for the Ditto C++ SDK types and functions.
Definition AbstractDocumentPath.hpp:19