userver: userver/storages/mongo/transaction.hpp Source File
Loading...
Searching...
No Matches
transaction.hpp
Go to the documentation of this file.
1#pragma once
2
5
6#include <memory>
7#include <string>
8
11
12USERVER_NAMESPACE_BEGIN
13
14namespace storages::mongo {
15
16namespace impl {
17class TransactionImpl;
18} // namespace impl
19
40public:
43
45 // For internal use only.
46 explicit Transaction(std::unique_ptr<impl::TransactionImpl>);
48
51
53 Transaction& operator=(Transaction&&) noexcept;
54
57
62
74 void Commit();
75
83 void Abort() noexcept;
84
89 bool IsActive() const noexcept;
90
99
101 State GetState() const noexcept;
102
103private:
104 std::unique_ptr<impl::TransactionImpl> impl_;
105};
106
107} // namespace storages::mongo
108
109USERVER_NAMESPACE_END