载入中...
搜索中...
未找到
eve::condition::Condition类 参考

Immutable condition AST node. 更多...

#include <Condition.h>

Public 成员函数

 Condition ()=default
 Construct an empty All node, which passes vacuously.
 
ConditionKind kind () const noexcept
 Return this node's kind.
 
const std::vector< Condition > & children () const noexcept
 Return owned children; empty for a leaf node.
 
const std::string & key () const noexcept
 Return the key/name used by a leaf, if applicable.
 
CompareOperator compareOperator () const noexcept
 Return the comparison operator used by Compare.
 
const Value & expected () const noexcept
 Return the expected value owned by Compare.
 
const Value & arguments () const noexcept
 Return owned PolicyCall arguments.
 
const std::optional< ScriptConditionDeclaration > & scriptDeclaration () const noexcept
 Return an optional script dependency/determinism declaration.
 
bool isValid () const noexcept
 Return whether the factory invariants for this node hold.
 
ConditionResult evaluate (const EvaluationContext &context) const
 Evaluate this tree against a read-only context.
 

静态 Public 成员函数

static Condition all (std::vector< Condition > children)
 Construct a conjunction of child conditions.
 
static Condition any (std::vector< Condition > children)
 Construct a disjunction of child conditions.
 
static Condition not_ (Condition child)
 Construct a logical negation of one child condition.
 
static Condition compare (std::string key, CompareOperator op, Value expected={})
 Compare a context value against an expected scalar value.
 
static Condition policyCall (std::string name, Value arguments=Value::Object{}, std::optional< ScriptConditionDeclaration > scriptDeclaration=std::nullopt)
 Call a named read-only policy and use its ConditionResult.
 

详细描述

Immutable condition AST node.

Construct nodes through the named factories. A node owns all child nodes, keys and values; it keeps no pointers into a domain object. Evaluation is synchronous, const, and side-effect free.

在文件 Condition.h 第 199 行定义.

构造及析构函数说明

◆ Condition()

eve::condition::Condition::Condition ( )
default

Construct an empty All node, which passes vacuously.

成员函数说明

◆ all()

Condition eve::condition::Condition::all ( std::vector< Condition >  children)
static

Construct a conjunction of child conditions.

在文件 Condition.cpp 第 139 行定义.

引用了 eve::condition::All, children() , 以及 condition.

◆ any()

Condition eve::condition::Condition::any ( std::vector< Condition >  children)
static

Construct a disjunction of child conditions.

在文件 Condition.cpp 第 145 行定义.

引用了 eve::condition::Any, children() , 以及 condition.

◆ arguments()

const Value & eve::condition::Condition::arguments ( ) const
inlinenoexcept

Return owned PolicyCall arguments.

在文件 Condition.h 第 238 行定义.

被这些函数引用 policyCall().

◆ children()

const std::vector< Condition > & eve::condition::Condition::children ( ) const
inlinenoexcept

Return owned children; empty for a leaf node.

在文件 Condition.h 第 230 行定义.

被这些函数引用 all() , 以及 any().

◆ compare()

Condition eve::condition::Condition::compare ( std::string  key,
CompareOperator  op,
Value  expected = {} 
)
static

Compare a context value against an expected scalar value.

参数
keyCompare key; may use ConditionKeys prefixes.
opComparison operator; Exists ignores expected.
expectedExpected value for relational operators.

在文件 Condition.cpp 第 157 行定义.

引用了 eve::condition::Compare, condition, expected() , 以及 key().

被这些函数引用 eve::condition::attributeExists(), eve::condition::resourceExists(), eve::condition::stateEquals() , 以及 eve::condition::tagPresent().

◆ compareOperator()

CompareOperator eve::condition::Condition::compareOperator ( ) const
inlinenoexcept

Return the comparison operator used by Compare.

在文件 Condition.h 第 234 行定义.

◆ evaluate()

◆ expected()

const Value & eve::condition::Condition::expected ( ) const
inlinenoexcept

Return the expected value owned by Compare.

在文件 Condition.h 第 236 行定义.

被这些函数引用 compare().

◆ isValid()

bool eve::condition::Condition::isValid ( ) const
noexcept

Return whether the factory invariants for this node hold.

在文件 Condition.cpp 第 174 行定义.

引用了 eve::condition::All, eve::condition::Any, eve::condition::Compare, eve::condition::Not , 以及 eve::condition::PolicyCall.

被这些函数引用 evaluate() , 以及 eve::action::ActionDefinition::validate().

◆ key()

const std::string & eve::condition::Condition::key ( ) const
inlinenoexcept

Return the key/name used by a leaf, if applicable.

在文件 Condition.h 第 232 行定义.

被这些函数引用 compare().

◆ kind()

ConditionKind eve::condition::Condition::kind ( ) const
inlinenoexcept

Return this node's kind.

在文件 Condition.h 第 228 行定义.

◆ not_()

Condition eve::condition::Condition::not_ ( Condition  child)
static

Construct a logical negation of one child condition.

在文件 Condition.cpp 第 151 行定义.

引用了 condition , 以及 eve::condition::Not.

◆ policyCall()

Condition eve::condition::Condition::policyCall ( std::string  name,
Value  arguments = Value::Object{},
std::optional< ScriptConditionDeclaration >  scriptDeclaration = std::nullopt 
)
static

Call a named read-only policy and use its ConditionResult.

参数
nameStable policy/script name.
argumentsOwning policy arguments; defaults to an empty object.
scriptDeclarationOptional dependency/determinism declaration for a script-backed policy. Its name must match name when supplied.

在文件 Condition.cpp 第 165 行定义.

引用了 arguments(), condition, name, eve::condition::PolicyCall , 以及 scriptDeclaration().

被这些函数引用 eve::condition::authorityAllow().

◆ scriptDeclaration()

const std::optional< ScriptConditionDeclaration > & eve::condition::Condition::scriptDeclaration ( ) const
inlinenoexcept

Return an optional script dependency/determinism declaration.

在文件 Condition.h 第 240 行定义.

被这些函数引用 policyCall().


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