载入中...
搜索中...
未找到
eve::editor::AsyncPreview< Payload > 模板类 参考

Typed latest-request preview publication using the existing editing task executor. @ownership Worker owns immutable input captures and a private completion mailbox, never a domain pointer. @thread All methods are owner-thread only. Work runs on TaskService's worker and must cooperate with cancellation. @reentrancy No work or unknown callback executes under a publication lock. @lifetime Close invalidates publication immediately; destruction cancels and joins bounded/cooperative work. 更多...

#include <AsyncPreview.h>

Public 类型

using Work = std::function< editing::Result< Payload >(const editing::TaskContext &)>
 

Public 成员函数

 AsyncPreview ()=default
 Start a private task executor; no domain state is captured.
 
 ~AsyncPreview ()
 Cancel outstanding work before the executor joins.
 
 AsyncPreview (const AsyncPreview &)=delete
 
AsyncPreview & operator= (const AsyncPreview &)=delete
 
editing::Result< void > request (Work work)
 Queue owning work, cancelling the previous request. Returns Pending after acceptance. @cost Queues one background computation; capture size is paid once per invalidation, not per poll.
 
std::optional< editing::Result< Payload > > poll ()
 Consume only the current request's completion, once; failed providers preserve the domain payload.
 
editing::Result< void > cancel ()
 Cancel queued/running work and discard any completed but unpublished result; keeps the last domain preview.
 
editing::Result< void > replaceProvider (bool available)
 Invalidate all old provider work, including replacement with the same provider instance or absence.
 
void close ()
 Permanently close this session; cancellation is observable immediately and closure is idempotent.
 
void rejectPublication () noexcept
 Record a domain validation failure after consuming a provider result; the domain keeps its previous payload.
 
PreviewState state () const noexcept
 Read lifecycle state without copying the domain payload or querying any registry.
 

详细描述

template<class Payload>
class eve::editor::AsyncPreview< Payload >

Typed latest-request preview publication using the existing editing task executor. @ownership Worker owns immutable input captures and a private completion mailbox, never a domain pointer. @thread All methods are owner-thread only. Work runs on TaskService's worker and must cooperate with cancellation. @reentrancy No work or unknown callback executes under a publication lock. @lifetime Close invalidates publication immediately; destruction cancels and joins bounded/cooperative work.

在文件 AsyncPreview.h 第 22 行定义.

成员类型定义说明

◆ Work

template<class Payload >
using eve::editor::AsyncPreview< Payload >::Work = std::function<editing::Result<Payload>(const editing::TaskContext&)>

在文件 AsyncPreview.h 第 24 行定义.

构造及析构函数说明

◆ AsyncPreview() [1/2]

template<class Payload >
eve::editor::AsyncPreview< Payload >::AsyncPreview ( )
default

Start a private task executor; no domain state is captured.

◆ ~AsyncPreview()

template<class Payload >
eve::editor::AsyncPreview< Payload >::~AsyncPreview ( )
inline

Cancel outstanding work before the executor joins.

在文件 AsyncPreview.h 第 28 行定义.

引用了 eve::editor::AsyncPreview< Payload >::close().

◆ AsyncPreview() [2/2]

template<class Payload >
eve::editor::AsyncPreview< Payload >::AsyncPreview ( const AsyncPreview< Payload > &  )
delete

成员函数说明

◆ cancel()

template<class Payload >
editing::Result< void > eve::editor::AsyncPreview< Payload >::cancel ( )
inline

◆ close()

template<class Payload >
void eve::editor::AsyncPreview< Payload >::close ( )
inline

Permanently close this session; cancellation is observable immediately and closure is idempotent.

在文件 AsyncPreview.h 第 125 行定义.

引用了 eve::editor::AsyncPreview< Payload >::cancel(), cancelled, eve::editor::Closed, EV_ASSERT , 以及 eve::editor::PreviewState::phase.

被这些函数引用 eve::editor::AsyncPreview< Payload >::~AsyncPreview().

◆ operator=()

template<class Payload >
AsyncPreview & eve::editor::AsyncPreview< Payload >::operator= ( const AsyncPreview< Payload > &  )
delete

◆ poll()

template<class Payload >
std::optional< editing::Result< Payload > > eve::editor::AsyncPreview< Payload >::poll ( )
inline

Consume only the current request's completion, once; failed providers preserve the domain payload.

在文件 AsyncPreview.h 第 84 行定义.

引用了 eve::editing::TaskService::discard(), eve::editor::Failed, eve::Result< T >::failure(), eve::editor::PreviewState::phase, eve::editor::Ready , 以及 result.

◆ rejectPublication()

template<class Payload >
void eve::editor::AsyncPreview< Payload >::rejectPublication ( )
inlinenoexcept

Record a domain validation failure after consuming a provider result; the domain keeps its previous payload.

在文件 AsyncPreview.h 第 132 行定义.

引用了 eve::editor::Failed , 以及 eve::editor::PreviewState::phase.

◆ replaceProvider()

template<class Payload >
editing::Result< void > eve::editor::AsyncPreview< Payload >::replaceProvider ( bool  available)
inline

Invalidate all old provider work, including replacement with the same provider instance or absence.

在文件 AsyncPreview.h 第 113 行定义.

引用了 eve::editor::AsyncPreview< Payload >::cancel(), cancelled, eve::editor::Closed, eve::editor::Idle, eve::editor::PreviewState::phase, eve::editor::PreviewState::providerGeneration , 以及 eve::editor::Unavailable.

◆ request()

template<class Payload >
editing::Result< void > eve::editor::AsyncPreview< Payload >::request ( Work  work)
inline

Queue owning work, cancelling the previous request. Returns Pending after acceptance. @cost Queues one background computation; capture size is paid once per invalidation, not per poll.

在文件 AsyncPreview.h 第 36 行定义.

引用了 eve::editor::AsyncPreview< Payload >::cancel(), cancelled, eve::editor::Closed, context, eve::editing::TaskOutcome::diagnostics, error, eve::editor::Failed, eve::Result< T >::failure(), eve::editing::pending(), eve::editor::Pending, eve::editor::PreviewState::phase, eve::editor::PreviewState::request, result, eve::editing::TaskOutcome::status, eve::editing::TaskService::submit() , 以及 eve::editor::Unavailable.

◆ state()

template<class Payload >
PreviewState eve::editor::AsyncPreview< Payload >::state ( ) const
inlinenoexcept

Read lifecycle state without copying the domain payload or querying any registry.

在文件 AsyncPreview.h 第 134 行定义.


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