Ditto 2.0.6
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 Incremented,
29 ReplacedText,
30 Pushed,
31 Popped,
32 Inserted,
33};
34
40 friend struct UpdateResultSet;
41 friend struct UpdateResultRemoved;
43 friend struct UpdateResultIncremented;
44 friend struct UpdateResultPushed;
45 friend struct UpdateResultPopped;
46 friend struct UpdateResultInserted;
47
52
57 std::string path;
58
62 UpdateResultType type;
63
64 virtual ~UpdateResult() = default;
65
66private:
67 UpdateResult(DocumentId document_id, std::string path, UpdateResultType type);
68};
69
75 friend class MutableDocumentPath;
76
81
82private:
85};
86
92 friend class MutableDocumentPath;
93
94private:
96};
97
103 friend class MutableDocumentPath;
104
105private:
107};
108
114 friend class MutableDocumentPath;
115
119 double amount;
120
121private:
123 double amount);
124};
125
131 friend class MutableDocumentPath;
132
137
138private:
141};
142
148 friend class MutableDocumentPath;
149
154
155private:
158};
159
165 friend class MutableDocumentPath;
166
171
172private:
175};
176
177} // namespace ditto
178
179#endif
Provides an interface to specify a path to a key in a document that you can then call various update ...
Definition: MutableDocumentPath.hpp:32
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:39
std::string path
Definition: UpdateResult.hpp:57
UpdateResultType type
Definition: UpdateResult.hpp:62
DocumentId document_id
Definition: UpdateResult.hpp:51
An update result when the update result's type is UpdateResultType::Incremented.
Definition: UpdateResult.hpp:113
double amount
Definition: UpdateResult.hpp:119
An update result when the update result's type is UpdateResultType::Inserted.
Definition: UpdateResult.hpp:164
nlohmann::json value
Definition: UpdateResult.hpp:170
An update result when the update result's type is UpdateResultType::Popped.
Definition: UpdateResult.hpp:147
nlohmann::json value
Definition: UpdateResult.hpp:153
An update result when the update result's type is UpdateResultType::Pushed.
Definition: UpdateResult.hpp:130
nlohmann::json value
Definition: UpdateResult.hpp:136
An update result when the update result's type is UpdateResultType::Removed.
Definition: UpdateResult.hpp:91
An update result when the update result's type is UpdateResultType::ReplacedWithCounter.
Definition: UpdateResult.hpp:102
An update result when the update result's type is UpdateResultType::Set.
Definition: UpdateResult.hpp:74
nlohmann::json value
Definition: UpdateResult.hpp:80