Ditto 1.1.3
Store.hpp
1#ifndef _DITTO_STORE_
2#define _DITTO_STORE_
3
4#include "Collection.hpp"
5#include "PendingCollectionsOperation.hpp"
6#include "WriteTransaction.hpp"
7#include "WriteTransactionResult.hpp"
8
9#include <functional>
10#include <memory>
11#include <string>
12#include <vector>
13
14namespace ditto {
15class DittoHandleWrapper;
16
20class Store {
21 friend class Ditto;
22
23 std::shared_ptr<DittoHandleWrapper> ditto_handle_wrapper;
24 uint64_t site_id{};
25 Store(std::shared_ptr<DittoHandleWrapper> ditto_handle_wrapper,
26 uint64_t site_id_in_use);
27
28public:
29 Store();
30
37 Collection collection(std::string name) const;
38
48 std::vector<std::unique_ptr<WriteTransactionResult>>
49 write(std::function<void(WriteTransaction &)> fn) const;
50
59};
60} // namespace ditto
61#endif
A reference to a collection in a Store.
Definition: Collection.hpp:26
The entrypoint to the Ditto SDK.
Definition: Ditto.hpp:25
These objects are returned when calling collections() on Store objects.
Definition: PendingCollectionsOperation.hpp:53
Provides access to Collections and a write transaction API.
Definition: Store.hpp:20
std::vector< std::unique_ptr< WriteTransactionResult > > write(std::function< void(WriteTransaction &)> fn) const
Allows you to group multiple operations together that affect multiple documents, potentially across m...
Definition: Store.cpp:27
PendingCollectionsOperation collections() const
Returns an object that lets you fetch or observe the collections in the store.
Definition: Store.cpp:22
Collection collection(std::string name) const
Returns a Collection with the provided name.
Definition: Store.cpp:18
WriteTransaction exposes functionality that allows you to perform multiple operations on the store wi...
Definition: WriteTransaction.hpp:25