1#ifndef _DITTO_MUTABLE_DOCUMENT_PATH_
2#define _DITTO_MUTABLE_DOCUMENT_PATH_
4#include "AbstractDocumentPath.hpp"
5#include "AttachmentToken.hpp"
8#include "UpdateResult.hpp"
12typedef struct CDocument CDocument_t;
32 friend class MutableDocument;
33 friend class MutableCounter;
34 friend class MutableRegister;
37 std::vector<std::unique_ptr<UpdateResult>> &results;
56 MutableDocumentPath(CDocument_t
const *document,
DocumentId id,
57 std::string initial_path,
58 std::vector<std::unique_ptr<UpdateResult>> &results);
72 MutableDocumentPath(
const MutableDocumentPath *document_path,
87 MutableDocumentPath(
const MutableDocumentPath *document_path,
90 MutableDocumentPath(
const MutableDocumentPath *doc_path);
94 get_mut_object_or_default(json_callback json_cb,
95 PathAccessorType path_type)
const;
98 MutableDocumentPath operator[](std::string key);
99 MutableDocumentPath operator[](std::size_t index);
121 std::shared_ptr<MutableCounter>
get_counter()
const;
146 void set(nlohmann::json value,
bool is_default =
false)
const;
168 void increment(
double amount)
const;
AbstractDocumentPath(CDocument_t const *document, DocumentId id, std::string initial_path)
Constructs a new initial AbstractDocumentPath for a document.
Definition AbstractDocumentPath.cpp:40
Definition MutableCounter.hpp:10
void set(nlohmann::json value, bool is_default=false) const
Set a value at the document's key defined by the preceding subscripting.
Definition MutableDocumentPath.cpp:43
void remove() const
Remove a value at the document's key defined by the preceding subscripting.
Definition MutableDocumentPath.cpp:58
std::shared_ptr< MutableCounter > get_counter() const
Returns the value at the previously specified key in the document as a std::shared_ptr<MutableCounter...
Definition MutableDocumentPath.cpp:89
std::shared_ptr< MutableRegister > get_register() const
Returns the value at the previously specified key in the document as a std::shared_ptr<MutableRegiste...
Definition MutableDocumentPath.cpp:94
std::shared_ptr< AttachmentToken > get_attachment_token() const
Returns the value at the previously specified key in the document as a std::shared_ptr<AttachmentToke...
Definition MutableDocumentPath.cpp:84
Definition MutableRegister.hpp:11
An identifier for a Document.
Definition DocumentId.hpp:21