Ditto 3.0.3-alpha2
DocumentPath.hpp
1#ifndef _DITTO_DOCUMENT_PATH_
2#define _DITTO_DOCUMENT_PATH_
3
4#include "AbstractDocumentPath.hpp"
5#include "AttachmentToken.hpp"
6#include "Counter.hpp"
7#include "DocumentId.hpp"
8#include "Register.hpp"
9#include "Rga.hpp"
10
11#include "Helpers.hpp"
12#include "document_path_component.hpp"
13
14#include "json.hpp"
15
16#include <memory>
17#include <string>
18#include <vector>
19
20namespace ditto {
21
32 friend class Document;
33
34private:
46 DocumentPath(CDocument_t *document, DocumentId id, std::string initial_path);
47
56 DocumentPath(const DocumentPath *document_path, std::string key);
57
66 DocumentPath(const DocumentPath *document_path, std::size_t index);
67
68public:
69 DocumentPath operator[](std::string key);
70 DocumentPath operator[](std::size_t index);
71
81 std::shared_ptr<AttachmentToken> get_attachment_token() const;
82
92 std::shared_ptr<Counter> get_counter() const;
93
103 std::shared_ptr<Register> get_register() const;
104
114 std::shared_ptr<Rga> get_rga() const DITTO_DEPRECATED;
115};
116} // namespace ditto
117
118#endif
Provides an interface to specify a path to a key in a document that you can then call various update ...
Definition: AbstractDocumentPath.hpp:21
A document belonging to a Collection with an inner value and an identifier (DocumentId).
Definition: Document.hpp:17
Provides an interface to specify a path to a key in a document that you can then call a function on t...
Definition: DocumentPath.hpp:31
std::shared_ptr< Register > get_register() const
Returns the value at the previously specified key in the document as a std::shared_ptr<Register>....
Definition: DocumentPath.cpp:39
std::shared_ptr< Rga > get_rga() const DITTO_DEPRECATED
Returns the value at the previously specified key in the document as a std::shared_ptr<Rga>....
Definition: DocumentPath.cpp:43
std::shared_ptr< Counter > get_counter() const
Returns the value at the previously specified key in the document as a std::shared_ptr<Counter>....
Definition: DocumentPath.cpp:34
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: DocumentPath.cpp:29
An identifier for a Document.
Definition: DocumentId.hpp:21