Ditto 1.1.3
UpdateResult.hpp
1#ifndef _DITTO_UPDATE_RESULT_
2#define _DITTO_UPDATE_RESULT_
3
4#include "DocumentId.hpp"
5
6#include "json.hpp"
7
8#include <string>
9
10namespace ditto {
11
25enum class UpdateResultType {
26 Set,
27 Removed,
28 ReplacedWithCounter,
29 Incremented,
30 ReplacedText,
31 Pushed,
32 Popped,
33 Inserted,
34};
35
41 friend struct UpdateResultSet;
42 friend struct UpdateResultRemoved;
44 friend struct UpdateResultIncremented;
45 friend struct UpdateResultPushed;
46 friend struct UpdateResultPopped;
47 friend struct UpdateResultInserted;
48
53
58 std::string path;
59
63 UpdateResultType type;
64
65 virtual ~UpdateResult() = default;
66
67private:
68 UpdateResult(DocumentId document_id, std::string path, UpdateResultType type);
69};
70
76 friend class MutableDocumentPath;
77
82
83private:
86};
87
93 friend class MutableDocumentPath;
94
95private:
97};
98
104 friend class MutableDocumentPath;
105
106private:
108};
109
115 friend class MutableDocumentPath;
116
120 double amount;
121
122private:
124 double amount);
125};
126
132 friend class MutableDocumentPath;
133
138
139private:
142};
143
149 friend class MutableDocumentPath;
150
155
156private:
159};
160
166 friend class MutableDocumentPath;
167
172
173private:
176};
177
178} // namespace ditto
179
180#endif
Provides an interface to specify a path to a key in a document that you can then call various update ...
Definition: MutableDocumentPath.hpp:21
basic_json<> json
default JSON class
Definition: json.hpp:2933
An identifier for a Document.
Definition: DocumentId.hpp:21
Provides information about a successful update operation on a document.
Definition: UpdateResult.hpp:40
std::string path
Definition: UpdateResult.hpp:58
UpdateResultType type
Definition: UpdateResult.hpp:63
DocumentId document_id
Definition: UpdateResult.hpp:52
An update result when the update result's type is UpdateResultType::Incremented.
Definition: UpdateResult.hpp:114
double amount
Definition: UpdateResult.hpp:120
An update result when the update result's type is UpdateResultType::Inserted.
Definition: UpdateResult.hpp:165
nlohmann::json value
Definition: UpdateResult.hpp:171
An update result when the update result's type is UpdateResultType::Popped.
Definition: UpdateResult.hpp:148
nlohmann::json value
Definition: UpdateResult.hpp:154
An update result when the update result's type is UpdateResultType::Pushed.
Definition: UpdateResult.hpp:131
nlohmann::json value
Definition: UpdateResult.hpp:137
An update result when the update result's type is UpdateResultType::Removed.
Definition: UpdateResult.hpp:92
An update result when the update result's type is UpdateResultType::ReplacedWithCounter.
Definition: UpdateResult.hpp:103
An update result when the update result's type is UpdateResultType::Set.
Definition: UpdateResult.hpp:75
nlohmann::json value
Definition: UpdateResult.hpp:81