struct Gambit::DRes::ModuleRule

Derived class rule for resolution of dependencies.

#include <rule.hpp>

Inherits from Gambit::DRes::Rule

Public Functions

Name
boolantecedent_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.
boolconsequent_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.
boolallows(functor * f, const Utils::type_equivalency & te, bool ignore_if_weak =true) const
booldependencies_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.
boolfunction_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.
boolbackend_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.
boolpermits_field(const str & field)
Check if a given string is a permitted field of this class.

Public Attributes

Name
std::stringmodule
Module field targeted by the rule.
boolif_module
Module field appears in ‘if’ clause.
boolthen_module
Module field appears in ’then’ clause.
Optionsoptions
Options provided by the rule.
boolthen_options
Options appear in ’then’ clause.
std::vector< ModuleRule >dependencies
Subjugate dependency rules provided by the rule.
boolthen_dependencies
Subjugate dependency rules appear in ’then’ clause.
std::vector< BackendRule >backends
Subjugate backend rules provided by the rule.
boolthen_backends
Subjugate backend rules appear in ’then’ clause.
std::vector< std::string >functionChain
Function chain provided by the rule.
boolthen_functionChain
Function chain appears in the ’then’ clause.

Additional inherited members

Public Functions inherited from Gambit::DRes::Rule

Name
boolbase_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.
boolbase_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
boolhas_if
Rule has an antecedent (‘if’ clause)
boolhas_then
Rule has a consequent (’then’ clause)
YAML::Nodeyaml
The original YAML (if any) from which this rule was derived.
std::stringcapability
Capability field targeted by the rule.
boolif_capability
Capability field appears in ‘if’ clause.
boolthen_capability
Capability field appears in ’then’ clause.
std::stringtype
Type field targeted by the rule.
boolif_type
Type field appears in ‘if’ clause.
boolthen_type
Type field appears in ’then’ clause.
std::stringfunction
Function field targeted by the rule.
boolif_function
Function field appears in ‘if’ clause.
boolthen_function
Function field appears in ’then’ clause.
boolweakrule
Indicates that rule can be broken.
boollog_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