struct Gambit::DRes::BackendRule

Derived class rule for resolution of backend requirements.

#include <rule.hpp>

Inherits from Gambit::DRes::Rule

Public Functions

Name
boolantecedent_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.
boolconsequent_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.
boolallows(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.
boolpermits_field(const str & field)
Check if a given string is a permitted field of this class.

Public Attributes

Name
std::stringversion
Version field targeted by the rule.
boolif_version
Version field appears in ‘if’ clause.
boolthen_version
Version field appears in ’then’ clause.
std::stringbackend
Backend field targeted by the rule.
boolif_backend
Backend field appears in ‘if’ clause.
boolthen_backend
Backend field appears in ’then’ clause.
std::stringgroup
Backend group referenced by the rule.
boolif_group
Group field appears in ‘if’ 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 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