|
NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
|
RAII事务作用域守卫 更多...
#include <scope_transaction.hpp>
Public 成员函数 | |
| scope_transaction (Connect &conn) | |
| 构造函数,开始事务 | |
| ~scope_transaction () noexcept | |
| 析构函数 | |
| scope_transaction (scope_transaction &&other) noexcept | |
| 移动构造函数 | |
| scope_transaction & | operator= (scope_transaction &&other) noexcept |
| 移动赋值运算符 | |
| void | commit () |
| 提交事务 | |
| bool | committed () const noexcept |
| 检查事务是否已提交 | |
RAII事务作用域守卫
管理数据库事务的生命周期:
不可复制,支持移动语义。
| Connect | 连接类型,需满足 idb_connect 接口(提供 begin/commit/rollback) |
在文件 scope_transaction.hpp 第 45 行定义.
|
inlineexplicit |
构造函数,开始事务
| conn | 数据库连接引用 |
立即调用 conn.begin() 开始事务。
在文件 scope_transaction.hpp 第 57 行定义.
被这些函数引用 operator=() , 以及 scope_transaction().
|
inlinenoexcept |
|
inlinenoexcept |
移动构造函数
| other | 源对象 |
移动后源对象变为无效状态,不再持有连接引用。
在文件 scope_transaction.hpp 第 88 行定义.
引用了 scope_transaction().
|
inline |
|
inlinenodiscardnoexcept |
|
inlinenoexcept |
移动赋值运算符
| other | 源对象 |
如果当前守卫未提交,先回滚当前事务。
在文件 scope_transaction.hpp 第 102 行定义.
引用了 neforce::addressof() , 以及 scope_transaction().