Move-only operation result for actions with no value payload. 更多...
#include <Result.h>
Public 成员函数 | |
| Result (const Result &)=delete | |
| Result & | operator= (const Result &)=delete |
| Result (Result &&other) | |
| Move a result and transfer its debug observation responsibility. | |
| Result & | operator= (Result &&other) |
| Move-assign after checking the destination's old result. | |
| bool | ok () const noexcept |
| Whether this result represents a non-failure outcome. | |
| const Status & | status () const noexcept |
| Inspect the structured operation status. | |
| StatusCode | code () const noexcept |
| Inspect the stable operation code. | |
| const std::vector< Diagnostic > & | diagnostics () const noexcept |
| Inspect all diagnostics; this counts as checking the Result. | |
| const Diagnostic * | error () const noexcept |
| Inspect the first diagnostic, or null when none was supplied. | |
| operator bool () const noexcept | |
| Explicit boolean conversion for control-flow checks. | |
| void | value () const |
| Mark a successful void operation as checked. | |
| void | ignore (std::string_view reason={}) const noexcept |
| Explicitly discard this result after documenting the reason. | |
| void | expect (std::string_view message) const |
| Require success for a void operation. | |
静态 Public 成员函数 | |
| static Result | success () |
| Construct a successful void result. | |
| static Result | success (Status status) |
| Construct a successful void result with an explicit status. | |
| static Result | failure (Status status) |
| Construct a failed void result from a structured status. | |
| static Result | failure (Diagnostic diagnostic) |
| Construct a failed void result from one structured diagnostic. | |
详细描述
Move-only operation result for actions with no value payload.
Result public API.
构造及析构函数说明
◆ Result() [1/2]
|
delete |
◆ Result() [2/2]
|
inline |
成员函数说明
◆ code()
|
inlinenoexcept |
◆ diagnostics()
|
inlinenoexcept |
Inspect all diagnostics; this counts as checking the Result.
Observe.
被这些函数引用 eve::dnut::compileDnutConversations() , 以及 eve::editor::EditorSession::executeCommand().
◆ error()
|
inlinenoexcept |
Inspect the first diagnostic, or null when none was supplied.
- 返回
- Borrowed pointer into this Result's Status; nullptr when no diagnostic exists. @ownership Borrowed; the Result owns the diagnostic storage. @nullable Yes. @lifetime Valid until this Result is destroyed or move-assigned. @thread Affine to this Result; no synchronization. @reentrancy Does not invoke callbacks.
Observe.
◆ expect()
|
inline |
Require success for a void operation.
- 参数
-
message Context to include in the assertion on failure.
- 异常
-
zeroerr::AssertionData in assertion-enabled builds on failure.
Observe.
Context.
Ev assert.
Terminate.
引用了 context, detail, EV_ASSERT , 以及 message.
被这些函数引用 eve::procgen::assignWeightedMeshAttribute(), eve::procgen::copyPointsToTargets(), eve::dialogue::DialogueFlow::DialogueFlow(), eve::level_editing::LevelFormatRegistry::LevelFormatRegistry(), eve::procgen::mathPointFloatAttribute(), eve::procgen::mathPointIntAttribute(), eve::procgen::mathPointVectorAttribute(), eve::graphics::newWaterShader(), eve::procgen::noisePointFloatAttribute(), eve::procgen::partitionPointAttribute(), eve::sensing::TargetingResolver::resolve(), eve::procgen::sampleSpatialOntoChannel(), eve::pixelworld::PixelWorld::setMaterial(), eve::procgen::setPointBoolAttribute(), eve::procgen::setPointIntAttribute() , 以及 eve::procgen::setPointVectorAttribute().
◆ failure() [1/2]
|
inlinestatic |
◆ failure() [2/2]
|
inlinestatic |
◆ ignore()
|
inlinenoexcept |
Explicitly discard this result after documenting the reason.
- 参数
-
reason Human-readable reason for intentionally ignoring the result.
Observe.
被这些函数引用 eve::attributes::AttributeSet::addModifier(), eve::particles::ParticleEffect::advanceRegisteredTimelines(), eve::ui::UI::animateItemOpacity(), eve::ui::UI::animateItemPos(), eve::statepatch::StatePatchStateAdapter::apply(), eve::hexmap::HexUnitRegistry::beginTravel(), eve::rts::RTSProductionActionAdapter::cancel(), eve::ui::ObjectRegistry::clear(), eve::ui::ObjectRegistry::clearAll(), eve::hexmap::HexMap::editElevation(), eve::hexmap::HexSphereMap::editElevation(), eve::hexmap::HexMap::editFeatureLevel(), eve::hexmap::HexSphereMap::editFeatureLevel(), eve::hexmap::HexMap::editTerrainType(), eve::hexmap::HexSphereMap::editTerrainType(), eve::hexmap::HexMap::editWaterLevel(), eve::hexmap::generateSphereMap(), eve::hexmap::loadHexMap(), eve::rpg::BattleSystem::registerSkillDamage(), eve::rpg::SettlementPipeline::run(), eve::rpg::Battle::setAction(), eve::procgen::PointSet::setBoolAttribute(), eve::hexmap::HexMap::setElevation(), eve::hexmap::HexSphereMap::setElevation(), eve::procgen::PointSet::setFloatAttribute(), eve::procgen::PointSet::setIntAttribute(), eve::hexmap::HexMap::setSpecialIndex(), eve::hexmap::HexSphereMap::setSpecialIndex(), eve::procgen::PointSet::setStringAttribute(), eve::procgen::PointSet::setVectorAttribute(), eve::particles::ParticleEffect::start(), eve::tactics::Tactics::Tactics(), eve::animation::AnimGraph::update(), eve::animation::AnimLayerMixer::update(), eve::animation::AnimSyncGroup::update(), eve::animation::AnimTrail::update(), eve::animation::ControlAnim::update(), eve::animation::ControlPose::update(), eve::animation::MotionMatcher::update(), eve::animation::PhysicalBalancePose::update(), eve::particles::ParticleEffect::updateTimeline(), eve::sensing::TargetingPipeline::withBuiltins(), eve::climbing::ScriptClimbingRuntime::~ScriptClimbingRuntime() , 以及 eve::sensing::ScriptSensingWorld::~ScriptSensingWorld().
◆ ok()
|
inlinenoexcept |
Whether this result represents a non-failure outcome.
Observe.
被这些函数引用 eve::graphics::raytracing::VulkanRayTracing::addMesh(), eve::graphics::raytracing::VulkanRayTracing::addTriangleMesh(), eve::dnut::SequenceRuntime::advance(), eve::graphics::raytracing::VulkanRayTracing::applyReflections(), eve::rpg::QuestReward::claim(), eve::rpg::WorldInteraction::collectLoot(), eve::procgen::RuntimeGeneration::deserializeCell(), eve::editor::EditConstraintPipeline::evaluate(), eve::editor::EditorSession::execute(), eve::scene_editor::SceneEditorSession::Impl::Impl(), eve::housegen::HouseGen::instantiate(), eve::animation::SmrNeuralProvider::isReady(), eve::dialogue::DialogueFlow::lintAllChecked(), eve::i18n::I18n::loadFromFile(), eve::i18n::I18n::loadFromJson(), eve::animation_editing::AnimationClipDocumentTarget::loadSnapshot(), eve::definitions_editing::DefinitionDocument::loadSnapshot(), eve::localization_editing::LocalizationDocument::loadSnapshot(), eve::map_editing::MapDocumentTarget::loadSnapshot(), eve::avatar::AvatarInstance::loadVroidModelPath(), eve::housegen_editing::HouseGenDocumentTarget::makeCreateComponent(), eve::graphics::raytracing::VulkanRayTracing::rebuildScene(), eve::rpg::RPGActor::removeStatus(), eve::dnut::SequenceRuntime::resumeStep(), eve::i18n::I18n::setLanguage(), eve::rpg::BattleVictory::settle(), eve::i18n::I18n::update(), eve::graphics::vulkan::Graphics::updateTexture(), eve::procgen_editing::ProcgenScriptDocumentTarget::validate() , 以及 eve::procgen_editing::TextureRecipeTarget::validate().
◆ operator bool()
|
inlineexplicitnoexcept |
◆ operator=() [1/2]
|
delete |
◆ operator=() [2/2]
|
inline |
◆ status()
|
inlinenoexcept |
◆ success() [1/2]
|
inlinestatic |
◆ success() [2/2]
|
inlinestatic |
◆ value()
|
inline |
Mark a successful void operation as checked.
Observe.
Ev assert.
引用了 EV_ASSERT.
被这些函数引用 eve::rts::RTSCommandLog::apply(), eve::daynight::PcgLightingAmbientPhotoMode::setAuthority() , 以及 eve::daynight::PcgLightingAmbientPhotoMode::~PcgLightingAmbientPhotoMode().
该类的文档由以下文件生成:
- src/engine/common/Result.h