struct Gambit::DRes::BackendRule
Derived class rule for resolution of backend requirements.
#include <rule.hpp>
Inherits from Gambit::DRes::Rule
Public Functions
Name | |
---|---|
bool | antecedent_matches(functor * f, const Utils::type_equivalency & te, const str & group_being_resolved) const True if and only if the passed backend functor matches the ‘if’ part of a rule. |
bool | consequent_matches(functor * f, const Utils::type_equivalency & te) const True if and only if the passed backend functor matches the ’then’ part of a rule. |
bool | allows(functor * f, const Utils::type_equivalency & te, const str & group_being_resolved, bool ignore_if_weak =true) const |
BackendRule() Default constructor. Sets all fields empty. | |
bool | permits_field(const str & field) Check if a given string is a permitted field of this class. |
Public Attributes
Name | |
---|---|
std::string | version Version field targeted by the rule. |
bool | if_version Version field appears in ‘if’ clause. |
bool | then_version Version field appears in ’then’ clause. |
std::string | backend Backend field targeted by the rule. |
bool | if_backend Backend field appears in ‘if’ clause. |
bool | then_backend Backend field appears in ’then’ clause. |
std::string | group Backend group referenced by the rule. |
bool | if_group Group field appears in ‘if’ clause. |
Additional inherited members
Public Functions inherited from Gambit::DRes::Rule
Name | |
---|---|
bool | base_antecedent_matches(functor * f, const Utils::type_equivalency & te) const True if and only if the passed functor matches the ‘if’ part of a rule. |
bool | base_consequent_matches(functor * f, const Utils::type_equivalency & te) const True if and only if the passed functor matches the ’then’ part of a rule. |
Rule() Default constructor. Sets all fields empty. |
Public Attributes inherited from Gambit::DRes::Rule
Name | |
---|---|
bool | has_if Rule has an antecedent (‘if’ clause) |
bool | has_then Rule has a consequent (’then’ clause) |
YAML::Node | yaml The original YAML (if any) from which this rule was derived. |
std::string | capability Capability field targeted by the rule. |
bool | if_capability Capability field appears in ‘if’ clause. |
bool | then_capability Capability field appears in ’then’ clause. |
std::string | type Type field targeted by the rule. |
bool | if_type Type field appears in ‘if’ clause. |
bool | then_type Type field appears in ’then’ clause. |
std::string | function Function field targeted by the rule. |
bool | if_function Function field appears in ‘if’ clause. |
bool | then_function Function field appears in ’then’ clause. |
bool | weakrule Indicates that rule can be broken. |
bool | log_matches Whether or not to log matches to the rule with functors. |
Public Functions Documentation
function antecedent_matches
bool antecedent_matches(
functor * f,
const Utils::type_equivalency & te,
const str & group_being_resolved
) const
True if and only if the passed backend functor matches the ‘if’ part of a rule.
function consequent_matches
bool consequent_matches(
functor * f,
const Utils::type_equivalency & te
) const
True if and only if the passed backend functor matches the ’then’ part of a rule.
function allows
bool allows(
functor * f,
const Utils::type_equivalency & te,
const str & group_being_resolved,
bool ignore_if_weak =true
) const
Whether a backend rule allows a given backend functor or not.
Must be true for a backend functor to be used to resolve a backend requirement.
True unless the functor passes the antecedent (‘if’ part of the rule) but fails the consequent (’then’ part of the rule).
function BackendRule
inline BackendRule()
Default constructor. Sets all fields empty.
function permits_field
static bool permits_field(
const str & field
)
Check if a given string is a permitted field of this class.
Check if a given string is a permitted field of the BackendRule class.
Public Attributes Documentation
variable version
std::string version;
Version field targeted by the rule.
variable if_version
bool if_version;
Version field appears in ‘if’ clause.
variable then_version
bool then_version;
Version field appears in ’then’ clause.
variable backend
std::string backend;
Backend field targeted by the rule.
variable if_backend
bool if_backend;
Backend field appears in ‘if’ clause.
variable then_backend
bool then_backend;
Backend field appears in ’then’ clause.
variable group
std::string group;
Backend group referenced by the rule.
variable if_group
bool if_group;
Group field appears in ‘if’ clause.
Updated on 2024-07-18 at 13:53:31 +0000