Ditto  3.0.4
WriteTransactionPendingIDSpecificOperation.hpp
1 #ifndef _DITTO_WRITE_TRANSACTION_PENDING_ID_SPECIFIC_OPERATION_
2 #define _DITTO_WRITE_TRANSACTION_PENDING_ID_SPECIFIC_OPERATION_
3 
4 #include "Document.hpp"
5 #include "DocumentId.hpp"
6 #include "MutableDocument.hpp"
7 #include "UpdateResult.hpp"
8 #include "WriteTransaction.hpp"
9 
10 #include <functional>
11 #include <memory>
12 #include <string>
13 #include <vector>
14 
15 namespace ditto {
16 class DittoHandleWrapper;
17 
26  friend class ScopedWriteTransaction;
27 
28  std::shared_ptr<DittoHandleWrapper> ditto_handle_wrapper;
29  WriteTransaction &base_transaction;
30 
33  std::shared_ptr<DittoHandleWrapper> ditto_handle_wrapper,
34  WriteTransaction &base_transaction);
35 
36 public:
40  std::string collection_name;
41 
46 
55  std::shared_ptr<Document> exec() const;
56 
67  std::vector<std::unique_ptr<UpdateResult>>
68  update(std::function<void(MutableDocument &)> fn) const;
69 
76  bool remove() const;
77 
84  bool evict() const;
85 };
86 } // namespace ditto
87 #endif
This is used as part of update operations for documents.
Definition: MutableDocument.hpp:29
ScopedWriteTransaction exposes functionality that allows you to perform multiple operations on the st...
Definition: ScopedWriteTransaction.hpp:23
WriteTransaction exposes functionality that allows you to perform multiple operations on the store wi...
Definition: WriteTransaction.hpp:25
These objects are returned when ScopedWriteTransaction::find_by_id is called.
Definition: WriteTransactionPendingIDSpecificOperation.hpp:25
bool remove() const
Remove the document with the matching ID.
Definition: WriteTransactionPendingIDSpecificOperation.cpp:38
bool evict() const
Evict the document with the matching ID.
Definition: WriteTransactionPendingIDSpecificOperation.cpp:49
std::shared_ptr< Document > exec() const
Execute the find operation to return the document with the matching ID, if it exists.
Definition: WriteTransactionPendingIDSpecificOperation.cpp:22
std::string collection_name
Definition: WriteTransactionPendingIDSpecificOperation.hpp:40
DocumentId document_id
Definition: WriteTransactionPendingIDSpecificOperation.hpp:45
std::vector< std::unique_ptr< UpdateResult > > update(std::function< void(MutableDocument &)> fn) const
Update the document with the matching ID.
Definition: WriteTransactionPendingIDSpecificOperation.cpp:28
An identifier for a Document.
Definition: DocumentId.hpp:21