载入中...
搜索中...
未找到
eve::dialogue::StateEvaluationContext类 参考final

Decision EvaluationContext backed by one dialogue subject. 更多...

#include <DialogueState.h>

类 eve::dialogue::StateEvaluationContext 继承关系图:
eve::decision::EvaluationContext

Public 成员函数

 StateEvaluationContext (std::string subject={}, eve::IStateQuery *provider=nullptr)
 Construct a context for a stable subject id and optional provider.
 
void setSubject (std::string subject)
 Change the subject used by subsequent synchronous queries.
 
void setProvider (eve::IStateQuery *provider) noexcept
 Set a borrowed query provider valid for this context's lifetime.
 
void setPolicyEvaluator (std::function< std::optional< eve::decision::ConditionResult >(std::string_view, const eve::Value &)> evaluator)
 Install a read-only policy callback without retaining its arguments.
 
std::optional< eve::Value > value (std::string_view key) const override
 Query a named scalar or structured value for Compare nodes.
 
std::optional< bool > hasTag (std::string_view tag) const override
 Query tag membership; nullopt means the tag source is unavailable.
 
std::optional< eve::Value > attribute (std::string_view key) const override
 Query an attribute value; nullopt means the attribute is absent.
 
std::optional< eve::Value > resource (std::string_view key) const override
 Query a resource amount or resource marker.
 
std::optional< eve::Value > state (std::string_view key) const override
 Query a state value for StateEquals nodes.
 
std::optional< bool > authority (std::string_view scope) const override
 Query authority without changing grants, leases, or state.
 
std::optional< eve::decision::ConditionResult > policy (std::string_view name, const eve::Value &arguments) const override
 Evaluate a named read-only policy with owned arguments.
 
- Public 成员函数 继承自 eve::decision::EvaluationContext
virtual ~EvaluationContext ()=default
 Releases EvaluationContext resources.
 

详细描述

Decision EvaluationContext backed by one dialogue subject.

The explicit provider is borrowed for this context. When it does not know a query, the context checks the registered IStateQuery capability/listeners. A known false result is never confused with an unavailable provider.

在文件 DialogueState.h 第 86 行定义.

构造及析构函数说明

◆ StateEvaluationContext()

eve::dialogue::StateEvaluationContext::StateEvaluationContext ( std::string  subject = {},
eve::IStateQuery *  provider = nullptr 
)
explicit

Construct a context for a stable subject id and optional provider.

在文件 DialogueState.cpp 第 246 行定义.

成员函数说明

◆ attribute()

std::optional< eve::Value > eve::dialogue::StateEvaluationContext::attribute ( std::string_view  key) const
overridevirtual

Query an attribute value; nullopt means the attribute is absent.

Attribute.

实现了 eve::decision::EvaluationContext.

在文件 DialogueState.cpp 第 263 行定义.

引用了 eve::state::IStateQuery::attribute(), key, subject , 以及 value.

◆ authority()

std::optional< bool > eve::dialogue::StateEvaluationContext::authority ( std::string_view  scope) const
overridevirtual

Query authority without changing grants, leases, or state.

Authority.

实现了 eve::decision::EvaluationContext.

在文件 DialogueState.cpp 第 285 行定义.

引用了 eve::state::IStateQuery::authority(), scope , 以及 subject.

◆ hasTag()

std::optional< bool > eve::dialogue::StateEvaluationContext::hasTag ( std::string_view  tag) const
overridevirtual

Query tag membership; nullopt means the tag source is unavailable.

True when tag.

实现了 eve::decision::EvaluationContext.

在文件 DialogueState.cpp 第 257 行定义.

引用了 eve::state::IStateQuery::hasTag(), subject , 以及 tag.

◆ policy()

std::optional< eve::decision::ConditionResult > eve::dialogue::StateEvaluationContext::policy ( std::string_view  name,
const eve::Value &  arguments 
) const
overridevirtual

Evaluate a named read-only policy with owned arguments.

Policy.

实现了 eve::decision::EvaluationContext.

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

引用了 name.

◆ resource()

std::optional< eve::Value > eve::dialogue::StateEvaluationContext::resource ( std::string_view  key) const
overridevirtual

Query a resource amount or resource marker.

Resource.

实现了 eve::decision::EvaluationContext.

在文件 DialogueState.cpp 第 271 行定义.

引用了 key, eve::state::IStateQuery::resource() , 以及 subject.

◆ setPolicyEvaluator()

void eve::dialogue::StateEvaluationContext::setPolicyEvaluator ( std::function< std::optional< eve::decision::ConditionResult >(std::string_view, const eve::Value &)>  evaluator)
inline

Install a read-only policy callback without retaining its arguments.

在文件 DialogueState.h 第 96 行定义.

◆ setProvider()

void eve::dialogue::StateEvaluationContext::setProvider ( eve::IStateQuery *  provider)
inlinenoexcept

Set a borrowed query provider valid for this context's lifetime.

在文件 DialogueState.h 第 94 行定义.

◆ setSubject()

void eve::dialogue::StateEvaluationContext::setSubject ( std::string  subject)

Change the subject used by subsequent synchronous queries.

在文件 DialogueState.cpp 第 249 行定义.

引用了 subject.

◆ state()

std::optional< eve::Value > eve::dialogue::StateEvaluationContext::state ( std::string_view  key) const
overridevirtual

Query a state value for StateEquals nodes.

State.

实现了 eve::decision::EvaluationContext.

在文件 DialogueState.cpp 第 277 行定义.

引用了 key, eve::state::IStateQuery::state(), subject , 以及 value.

◆ value()

std::optional< eve::Value > eve::dialogue::StateEvaluationContext::value ( std::string_view  key) const
overridevirtual

Query a named scalar or structured value for Compare nodes.

Value.

实现了 eve::decision::EvaluationContext.

在文件 DialogueState.cpp 第 251 行定义.

引用了 key, subject , 以及 eve::state::IStateQuery::value().


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