struct Gambit::DRes::ModuleRule
Derived class rule for resolution of dependencies.
#include <rule.hpp>
Inherits from Gambit::DRes::Rule
Public Functions
Name | |
---|---|
bool | antecedent_matches(functor * f, const Utils::type_equivalency & te) const True if and only if the passed module 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 module functor matches the ’then’ part of a rule. |
bool | allows(functor * f, const Utils::type_equivalency & te, bool ignore_if_weak =true) const |
bool | dependencies_allow(functor * f, const Utils::type_equivalency & te, bool ignore_if_weak =true) const Whether the set of dependency rules subjugate to this rule allow a given module functor or not. |
bool | function_chain_allows(functor * candidate, functor * dependee, const Utils::type_equivalency & te, bool ignore_if_weak =true) const Whether the functionChain of this rule allows a given module functor to be used to resolve the dependency of another. |
bool | backend_reqs_allow(functor * f, const Utils::type_equivalency & te, const str & group_being_resolved, bool ignore_if_weak =true) const Whether the set of backend rules subjugate to this rule allow a given backend functor or not. |
ModuleRule() 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 | module Module field targeted by the rule. |
bool | if_module Module field appears in ‘if’ clause. |
bool | then_module Module field appears in ’then’ clause. |
Options | options Options provided by the rule. |
bool | then_options Options appear in ’then’ clause. |
std::vector< ModuleRule > | dependencies Subjugate dependency rules provided by the rule. |
bool | then_dependencies Subjugate dependency rules appear in ’then’ clause. |
std::vector< BackendRule > | backends Subjugate backend rules provided by the rule. |
bool | then_backends Subjugate backend rules appear in ’then’ clause. |
std::vector< std::string > | functionChain Function chain provided by the rule. |
bool | then_functionChain Function chain appears in the ’then’ 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
True if and only if the passed module 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 module functor matches the ’then’ part of a rule.
function allows
bool allows(
functor * f,
const Utils::type_equivalency & te,
bool ignore_if_weak =true
) const
Whether a module rule allows a given module functor or not.
Must be true for a module functor to be used to resolve a dependency.
True unless the functor passes the antecedent (‘if’ part of the rule) but fails the consequent (’then’ part of the rule).
function dependencies_allow
bool dependencies_allow(
functor * f,
const Utils::type_equivalency & te,
bool ignore_if_weak =true
) const
Whether the set of dependency rules subjugate to this rule allow a given module functor or not.
Whether the set of dependency rules subjugate to this rule allow a given module functor or not. Must be true for the passed module functor to be used to resolve a dependency of another module functor that matches this rule (the dependee). Does not test if the dependee actually matches the rule, so should typically only be used after confirming this first.
function function_chain_allows
bool function_chain_allows(
functor * candidate,
functor * dependee,
const Utils::type_equivalency & te,
bool ignore_if_weak =true
) const
Whether the functionChain of this rule allows a given module functor to be used to resolve the dependency of another.
Whether the functionChain of this rule allow a given module functor to be used to resolve the dependency of another. Does not test if the dependent functor actually matches the rule, so should typically only be used after confirming this first.
function backend_reqs_allow
bool backend_reqs_allow(
functor * f,
const Utils::type_equivalency & te,
const str & group_being_resolved,
bool ignore_if_weak =true
) const
Whether the set of backend rules subjugate to this rule allow a given backend functor or not.
Whether the set of backend rules subjugate to this rule allow a given backend functor or not. Must be true for the passed backend functor to be used to resolve a backend requirement of another module functor that matches this rule (the requiree). Does not test if the requiree actually matches the rule, so should typically only be used after confirming this first.
function ModuleRule
inline ModuleRule()
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 ModuleRule class.
Public Attributes Documentation
variable module
std::string module;
Module field targeted by the rule.
variable if_module
bool if_module;
Module field appears in ‘if’ clause.
variable then_module
bool then_module;
Module field appears in ’then’ clause.
variable options
Options options;
Options provided by the rule.
variable then_options
bool then_options;
Options appear in ’then’ clause.
variable dependencies
std::vector< ModuleRule > dependencies;
Subjugate dependency rules provided by the rule.
variable then_dependencies
bool then_dependencies;
Subjugate dependency rules appear in ’then’ clause.
variable backends
std::vector< BackendRule > backends;
Subjugate backend rules provided by the rule.
variable then_backends
bool then_backends;
Subjugate backend rules appear in ’then’ clause.
variable functionChain
std::vector< std::string > functionChain;
Function chain provided by the rule.
variable then_functionChain
bool then_functionChain;
Function chain appears in the ’then’ clause.
Updated on 2024-07-18 at 13:53:31 +0000