Ditto 1.1.7
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 Store(std::shared_ptr<DittoHandleWrapper> ditto_handle_wrapper);
25
26public:
27 Store();
28
35 Collection collection(std::string name) const;
36
46 std::vector<std::unique_ptr<WriteTransactionResult>>
47 write(std::function<void(WriteTransaction &)> fn) const;
48
57};
58} // namespace ditto
59#endif
A reference to a collection in a Store.
Definition: Collection.hpp:26
The entrypoint to the Ditto SDK.
Definition: Ditto.hpp:22
These objects are returned when calling collections() on Store objects.
Definition: PendingCollectionsOperation.hpp:64
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:25
PendingCollectionsOperation collections() const
Returns an object that lets you fetch or observe the collections in the store.
Definition: Store.cpp:20
Collection collection(std::string name) const
Returns a Collection with the provided name.
Definition: Store.cpp:16
WriteTransaction exposes functionality that allows you to perform multiple operations on the store wi...
Definition: WriteTransaction.hpp:25