载入中...
搜索中...
未找到
eve::settlement::PreparedApply类 参考

Prepared domain mutation used to make settlement application atomic. 更多...

#include <Settlement.h>

Public 类型

using CommitFunction = std::function< eve::Result< void >()>
 
using RollbackFunction = std::function< void()>
 

Public 成员函数

 PreparedApply ()=default
 Construct an empty invalid mutation.
 
 PreparedApply (CommitFunction commit, RollbackFunction rollback)
 Construct a mutation from commit and rollback callbacks.
 
 PreparedApply (const PreparedApply &)=delete
 
PreparedApply & operator= (const PreparedApply &)=delete
 
 PreparedApply (PreparedApply &&other) noexcept
 Prepared apply.
 
PreparedApply & operator= (PreparedApply &&other) noexcept
 Operator =.
 
 ~PreparedApply ()
 Prepared apply.
 
bool isValid () const noexcept
 Return whether both transaction callbacks are available.
 
eve::Result< void > commit ()
 Publish the staged candidate; failure must leave state unchanged.
 
void rollback () noexcept
 Restore or discard the staged candidate; safe to call repeatedly.
 
bool isCommitted () const noexcept
 Return whether commit has completed successfully.
 

详细描述

Prepared domain mutation used to make settlement application atomic.

A policy creates this object from a candidate copy or equivalent private transaction. commit must make the candidate observable atomically; the supplied rollback callback must restore the previous state if a later event append fails. The object is synchronous and must not retain temporary request/context references.

在文件 Settlement.h 第 281 行定义.

成员类型定义说明

◆ CommitFunction

在文件 Settlement.h 第 283 行定义.

◆ RollbackFunction

using eve::settlement::PreparedApply::RollbackFunction = std::function<void()>

在文件 Settlement.h 第 284 行定义.

构造及析构函数说明

◆ PreparedApply() [1/4]

eve::settlement::PreparedApply::PreparedApply ( )
default

Construct an empty invalid mutation.

◆ PreparedApply() [2/4]

eve::settlement::PreparedApply::PreparedApply ( CommitFunction  commit,
RollbackFunction  rollback 
)

Construct a mutation from commit and rollback callbacks.

在文件 Settlement.cpp 第 288 行定义.

◆ PreparedApply() [3/4]

eve::settlement::PreparedApply::PreparedApply ( const PreparedApply &  )
delete

◆ PreparedApply() [4/4]

eve::settlement::PreparedApply::PreparedApply ( PreparedApply &&  other)
noexcept

Prepared apply.

在文件 Settlement.cpp 第 291 行定义.

◆ ~PreparedApply()

eve::settlement::PreparedApply::~PreparedApply ( )

Prepared apply.

在文件 Settlement.cpp 第 316 行定义.

引用了 rollback().

成员函数说明

◆ commit()

eve::Result< void > eve::settlement::PreparedApply::commit ( )

Publish the staged candidate; failure must leave state unchanged.

在文件 Settlement.cpp 第 326 行定义.

引用了 eve::Applied, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::InvariantViolation, isValid() , 以及 status.

◆ isCommitted()

bool eve::settlement::PreparedApply::isCommitted ( ) const
inlinenoexcept

Return whether commit has completed successfully.

在文件 Settlement.h 第 316 行定义.

◆ isValid()

bool eve::settlement::PreparedApply::isValid ( ) const
noexcept

Return whether both transaction callbacks are available.

在文件 Settlement.cpp 第 322 行定义.

被这些函数引用 commit().

◆ operator=() [1/2]

PreparedApply & eve::settlement::PreparedApply::operator= ( const PreparedApply &  )
delete

◆ operator=() [2/2]

PreparedApply & eve::settlement::PreparedApply::operator= ( PreparedApply &&  other)
noexcept

Operator =.

在文件 Settlement.cpp 第 302 行定义.

◆ rollback()

void eve::settlement::PreparedApply::rollback ( )
noexcept

Restore or discard the staged candidate; safe to call repeatedly.

备注
The rollback callback is a noexcept contract. If it throws, the implementation terminates because reporting an ordinary failure would falsely promise that state was restored.

在文件 Settlement.cpp 第 350 行定义.

被这些函数引用 ~PreparedApply().


该类的文档由以下文件生成: