Mutable calculation frame visible to policy and custom stage code. 更多...
#include <Settlement.h>
Public 成员函数 | |
| const SettlementRequest & | request () const noexcept |
| Return the immutable request currently being settled. | |
| ISettlementPolicy & | policy () const noexcept |
| Return the policy participating in this synchronous call. | |
| double | magnitude () const noexcept |
| Return the current amount after all preceding stages. | |
| double | absorbed () const noexcept |
| Return the accumulated amount absorbed by policy barriers. | |
| double | resisted () const noexcept |
| Return the accumulated amount removed by policy mitigation. | |
| double | clamped () const noexcept |
| Return the accumulated amount removed by the generic clamp. | |
| eve::Result< void > | setMagnitude (double value) |
| Set the current amount; late writes after Apply are rejected. | |
| eve::Result< void > | addAbsorbed (double value) |
| Add an amount absorbed by a barrier or shield; late writes are rejected. | |
| eve::Result< void > | addResisted (double value) |
| Add an amount removed by target mitigation; late writes are rejected. | |
| eve::Result< void > | addClamped (double value) |
| Add an amount removed by the final clamp stage; late writes are rejected. | |
| void | setCritical (bool value) noexcept |
| Mark the result as critical; late writes are rejected. | |
| bool | critical () const noexcept |
| Return whether a source policy marked this settlement critical. | |
| eve::Result< void > | setDisposition (SettlementDisposition disposition) |
| Set an explicit semantic outcome during calculation. | |
| SettlementDisposition | disposition () const noexcept |
| Return the current semantic outcome. | |
| eve::Result< void > | setClampMax (std::optional< double > value) |
| Set or clear the maximum amount used by the generic clamp stage. | |
| void | setStageDetail (std::string key, Value value) |
| Attach one serializable explanation field to the current stage. | |
| const eve::Diagnostic * | mutationViolation () const noexcept |
| Return a contract violation recorded by a late frame mutation. | |
| const Value::Object & | stageDetails () const noexcept |
| Return the current stage's owned explanation fields. | |
| const SettlementResult & | projectedResult () const noexcept |
| Return the projected result visible to trigger preparation. | |
| eve::Result< void > | applyClamp () |
| Apply the adapter-configured max bound and record any clamp loss. | |
| eve::Result< void > | prepareApply () |
| Prepare the adapter mutation without publishing domain state. | |
| eve::Result< void > | prepareEvent () |
| Build the canonical GameEvent without appending it. | |
| PreparedApply * | pendingApply () noexcept |
| Return the staged mutation, if the apply stage prepared one. | |
| const game_event::GameEvent * | pendingEvent () const noexcept |
| Return the prepared event, if the event stage created one. | |
| void | synchronizeResult () noexcept |
| Copy the current frame counters into SettlementResult. | |
| eve::Result< void > | emitDerived (SettlementRequest request) |
| Append one owning derived request during the Trigger phase. | |
友元 | |
| class | SettlementPipeline |
详细描述
Mutable calculation frame visible to policy and custom stage code.
The frame owns no domain state. It exposes only the working amount and explanation accumulators; adapters keep health/armor/shield facts in their own authoritative store. After canonical Apply preparation, amount and numeric result inputs are frozen. After canonical Event preparation, stage details are frozen too. An attempted late mutation records a fatal pipeline violation instead of silently creating stale prepared data. All methods are synchronous and the frame must not escape a settle call.
在文件 Settlement.h 第 338 行定义.
成员函数说明
◆ absorbed()
|
inlinenoexcept |
Return the accumulated amount absorbed by policy barriers.
在文件 Settlement.h 第 350 行定义.
◆ addAbsorbed()
| eve::Result< void > eve::settlement::SettlementContext::addAbsorbed | ( | double | value | ) |
Add an amount absorbed by a barrier or shield; late writes are rejected.
在文件 Settlement.cpp 第 383 行定义.
引用了 eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvariantViolation, status, eve::Result< T >::success(), valid , 以及 value.
◆ addClamped()
| eve::Result< void > eve::settlement::SettlementContext::addClamped | ( | double | value | ) |
Add an amount removed by the final clamp stage; late writes are rejected.
在文件 Settlement.cpp 第 419 行定义.
引用了 eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvariantViolation, status, eve::Result< T >::success(), valid , 以及 value.
被这些函数引用 applyClamp().
◆ addResisted()
| eve::Result< void > eve::settlement::SettlementContext::addResisted | ( | double | value | ) |
Add an amount removed by target mitigation; late writes are rejected.
在文件 Settlement.cpp 第 401 行定义.
引用了 eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvariantViolation, status, eve::Result< T >::success(), valid , 以及 value.
◆ applyClamp()
| eve::Result< void > eve::settlement::SettlementContext::applyClamp | ( | ) |
Apply the adapter-configured max bound and record any clamp loss.
在文件 Settlement.cpp 第 485 行定义.
引用了 addClamped(), eve::Result< T >::failure(), status , 以及 eve::Result< T >::success().
◆ clamped()
|
inlinenoexcept |
Return the accumulated amount removed by the generic clamp.
在文件 Settlement.h 第 356 行定义.
◆ critical()
|
inlinenoexcept |
Return whether a source policy marked this settlement critical.
在文件 Settlement.h 第 381 行定义.
◆ disposition()
|
inlinenoexcept |
◆ emitDerived()
| eve::Result< void > eve::settlement::SettlementContext::emitDerived | ( | SettlementRequest | request | ) |
Append one owning derived request during the Trigger phase.
在文件 Settlement.cpp 第 556 行定义.
引用了 eve::Applied, eve::settlement::SettlementRequest::chain, eve::settlement::SettlementChainContext::depth, eve::settlement::SettlementResult::derived, eve::settlement::SettlementChainContext::emittedCount, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, request(), eve::Status::success(), eve::Result< T >::success(), eve::settlement::SettlementRequest::trigger , 以及 eve::settlement::SettlementChainContext::triggerPath.
◆ magnitude()
|
inlinenoexcept |
Return the current amount after all preceding stages.
在文件 Settlement.h 第 347 行定义.
◆ mutationViolation()
|
inlinenoexcept |
Return a contract violation recorded by a late frame mutation.
- 返回
- Borrowed nullable diagnostic owned by this context, or null when valid. @ownership SettlementContext owns the diagnostic; callers must not delete it. @lifetime Valid until the context is mutated or destroyed. @thread Read on the settlement pipeline's owning thread. @reentrancy Does not invoke callbacks and is invalid across re-entrant context mutation.
在文件 Settlement.h 第 411 行定义.
◆ pendingApply()
|
inlinenoexcept |
Return the staged mutation, if the apply stage prepared one.
- 返回
- Borrowed nullable mutation owned by this context. @ownership SettlementContext owns the staged mutation; callers must not delete it. @lifetime Valid until commit/rollback or context destruction. @thread Read and consume on the settlement pipeline's owning thread. @reentrancy Do not retain across callbacks or stage mutation.
在文件 Settlement.h 第 438 行定义.
◆ pendingEvent()
|
inlinenoexcept |
Return the prepared event, if the event stage created one.
- 返回
- Borrowed nullable event owned by this context. @ownership SettlementContext owns the pending event; callers must not delete it. @lifetime Valid until event commit/rollback or context destruction. @thread Read on the settlement pipeline's owning thread. @reentrancy Do not retain across callbacks or stage mutation.
在文件 Settlement.h 第 448 行定义.
◆ policy()
|
inlinenoexcept |
Return the policy participating in this synchronous call.
在文件 Settlement.h 第 344 行定义.
被这些函数引用 prepareApply().
◆ prepareApply()
| eve::Result< void > eve::settlement::SettlementContext::prepareApply | ( | ) |
Prepare the adapter mutation without publishing domain state.
在文件 Settlement.cpp 第 500 行定义.
引用了 eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvariantViolation, policy(), eve::settlement::ISettlementPolicy::prepareApply(), status , 以及 eve::Result< T >::success().
◆ prepareEvent()
| eve::Result< void > eve::settlement::SettlementContext::prepareEvent | ( | ) |
Build the canonical GameEvent without appending it.
在文件 Settlement.cpp 第 519 行定义.
引用了 eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), status, eve::Result< T >::success() , 以及 synchronizeResult().
◆ projectedResult()
|
inlinenoexcept |
Return the projected result visible to trigger preparation.
在文件 Settlement.h 第 419 行定义.
◆ request()
|
inlinenoexcept |
Return the immutable request currently being settled.
在文件 Settlement.h 第 341 行定义.
被这些函数引用 emitDerived().
◆ resisted()
|
inlinenoexcept |
Return the accumulated amount removed by policy mitigation.
在文件 Settlement.h 第 353 行定义.
◆ setClampMax()
| eve::Result< void > eve::settlement::SettlementContext::setClampMax | ( | std::optional< double > | value | ) |
Set or clear the maximum amount used by the generic clamp stage.
在文件 Settlement.cpp 第 458 行定义.
引用了 eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), status, eve::Result< T >::success(), valid , 以及 value.
◆ setCritical()
|
inlinenoexcept |
Mark the result as critical; late writes are rejected.
Record mutation violation.
在文件 Settlement.h 第 371 行定义.
引用了 value.
◆ setDisposition()
| eve::Result< void > eve::settlement::SettlementContext::setDisposition | ( | SettlementDisposition | disposition | ) |
Set an explicit semantic outcome during calculation.
- 备注
- Immune, Blocked, Resisted and InvalidTarget stop numeric application by setting the working magnitude to zero.
在文件 Settlement.cpp 第 437 行定义.
引用了 eve::settlement::Applied, eve::settlement::Blocked, eve::Conflict, disposition(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::settlement::Immune, eve::settlement::InvalidTarget, eve::settlement::NoOp, eve::settlement::PartiallyApplied, eve::settlement::Resisted , 以及 eve::Result< T >::success().
◆ setMagnitude()
| eve::Result< void > eve::settlement::SettlementContext::setMagnitude | ( | double | value | ) |
Set the current amount; late writes after Apply are rejected.
在文件 Settlement.cpp 第 368 行定义.
引用了 eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), status, eve::Result< T >::success(), valid , 以及 value.
◆ setStageDetail()
| void eve::settlement::SettlementContext::setStageDetail | ( | std::string | key, |
| Value | value | ||
| ) |
Attach one serializable explanation field to the current stage.
- 备注
- Details are rejected after the Event terminal boundary. The pipeline reports such a late mutation as a failed settlement.
在文件 Settlement.cpp 第 475 行定义.
引用了 eve::settlement::Full, key, eve::settlement::SettlementRequest::trace , 以及 value.
◆ stageDetails()
|
inlinenoexcept |
Return the current stage's owned explanation fields.
在文件 Settlement.h 第 416 行定义.
◆ synchronizeResult()
|
noexcept |
Copy the current frame counters into SettlementResult.
在文件 Settlement.cpp 第 535 行定义.
引用了 eve::settlement::SettlementResult::absorbed, eve::settlement::Applied, eve::settlement::SettlementResult::applied, eve::settlement::Blocked, eve::settlement::SettlementResult::clamped, eve::settlement::SettlementResult::critical, eve::settlement::SettlementResult::disposition, eve::settlement::NoOp, eve::settlement::PartiallyApplied, eve::settlement::Resisted , 以及 eve::settlement::SettlementResult::resisted.
被这些函数引用 prepareEvent().
友元及相关函数文档
◆ SettlementPipeline
|
friend |
在文件 Settlement.h 第 459 行定义.
该类的文档由以下文件生成:
- src/modules/settlement/Settlement.h
- src/modules/settlement/Settlement.cpp