Decision EvaluationContext backed by one dialogue subject. 更多...
#include <DialogueState.h>
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()
|
explicit |
Construct a context for a stable subject id and optional provider.
在文件 DialogueState.cpp 第 246 行定义.
成员函数说明
◆ attribute()
|
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()
|
overridevirtual |
Query authority without changing grants, leases, or state.
Authority.
实现了 eve::decision::EvaluationContext.
在文件 DialogueState.cpp 第 285 行定义.
引用了 eve::state::IStateQuery::authority(), scope , 以及 subject.
◆ hasTag()
|
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()
|
overridevirtual |
Evaluate a named read-only policy with owned arguments.
Policy.
实现了 eve::decision::EvaluationContext.
在文件 DialogueState.cpp 第 291 行定义.
引用了 name.
◆ resource()
|
overridevirtual |
Query a resource amount or resource marker.
实现了 eve::decision::EvaluationContext.
在文件 DialogueState.cpp 第 271 行定义.
引用了 key, eve::state::IStateQuery::resource() , 以及 subject.
◆ setPolicyEvaluator()
|
inline |
Install a read-only policy callback without retaining its arguments.
在文件 DialogueState.h 第 96 行定义.
◆ setProvider()
|
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()
|
overridevirtual |
Query a state value for StateEquals nodes.
State.
实现了 eve::decision::EvaluationContext.
在文件 DialogueState.cpp 第 277 行定义.
引用了 key, eve::state::IStateQuery::state(), subject , 以及 value.
◆ value()
|
overridevirtual |
Query a named scalar or structured value for Compare nodes.
实现了 eve::decision::EvaluationContext.
在文件 DialogueState.cpp 第 251 行定义.
引用了 key, subject , 以及 eve::state::IStateQuery::value().
该类的文档由以下文件生成:
- src/modules/dialogue/DialogueState.h
- src/modules/dialogue/DialogueState.cpp
Public 成员函数 继承自