JaffarPlus
High-performance best-first search optimizer for tool-assisted speedruns
Loading...
Searching...
No Matches
jaffarPlus::InputSet Class Referencefinal

A collection of input indexes whose availability is gated by a set of conditions. More...

#include <inputSet.hpp>

Public Types

typedef size_t inputIndex_t
 Type used to index an input.
 

Public Member Functions

bool evaluate () const
 Evaluates the input set by checking all of its conditions.
 
void addInput (const inputIndex_t inputIdx)
 Adds an input index to this set.
 
void addCondition (std::unique_ptr< Condition > condition)
 Adds a condition that must hold for this set to be active.
 
const std::unordered_set< inputIndex_t > & getInputIndexes () const
 Returns the input indexes contained in this set.
 
bool getStopInputEvaluationFlag () const
 Returns whether this set stops evaluation of subsequent input sets.
 
void setStopInputEvaluationFlag (const bool stopInputEvaluation)
 Sets whether this set stops evaluation of subsequent input sets.
 

Private Attributes

std::unordered_set< std::unique_ptr< Condition > > _conditions
 Conditions that must all hold for this input set to be active.
 
std::unordered_set< inputIndex_t_inputIndexes
 Input indexes belonging to this set.
 
bool _stopInputEvaluation = false
 If true, input sets after this one are not evaluated.
 

Detailed Description

A collection of input indexes whose availability is gated by a set of conditions.

An input set holds a group of input indexes together with conditions that must all evaluate to true (logical AND) for the set to be active. It also carries a flag that, when set, stops the evaluation of subsequent input sets.

Definition at line 25 of file inputSet.hpp.

Member Typedef Documentation

◆ inputIndex_t

Type used to index an input.

Definition at line 29 of file inputSet.hpp.

Member Function Documentation

◆ addCondition()

void jaffarPlus::InputSet::addCondition ( std::unique_ptr< Condition condition)
inline

Adds a condition that must hold for this set to be active.

Parameters
conditionThe condition to add.

Definition at line 49 of file inputSet.hpp.

◆ addInput()

void jaffarPlus::InputSet::addInput ( const inputIndex_t  inputIdx)
inline

Adds an input index to this set.

Parameters
inputIdxThe input index to add.

Definition at line 47 of file inputSet.hpp.

◆ evaluate()

bool jaffarPlus::InputSet::evaluate ( ) const
inline

Evaluates the input set by checking all of its conditions.

Returns
true if every condition evaluates to true, false if any fails.

Definition at line 39 of file inputSet.hpp.

◆ getInputIndexes()

const std::unordered_set< inputIndex_t > & jaffarPlus::InputSet::getInputIndexes ( ) const
inline

Returns the input indexes contained in this set.

Definition at line 51 of file inputSet.hpp.

◆ getStopInputEvaluationFlag()

bool jaffarPlus::InputSet::getStopInputEvaluationFlag ( ) const
inline

Returns whether this set stops evaluation of subsequent input sets.

Definition at line 53 of file inputSet.hpp.

◆ setStopInputEvaluationFlag()

void jaffarPlus::InputSet::setStopInputEvaluationFlag ( const bool  stopInputEvaluation)
inline

Sets whether this set stops evaluation of subsequent input sets.

Parameters
stopInputEvaluationThe flag value.

Definition at line 55 of file inputSet.hpp.

Member Data Documentation

◆ _conditions

std::unordered_set<std::unique_ptr<Condition> > jaffarPlus::InputSet::_conditions
private

Conditions that must all hold for this input set to be active.

Definition at line 62 of file inputSet.hpp.

◆ _inputIndexes

std::unordered_set<inputIndex_t> jaffarPlus::InputSet::_inputIndexes
private

Input indexes belonging to this set.

Definition at line 66 of file inputSet.hpp.

◆ _stopInputEvaluation

bool jaffarPlus::InputSet::_stopInputEvaluation = false
private

If true, input sets after this one are not evaluated.

Definition at line 70 of file inputSet.hpp.


The documentation for this class was generated from the following file: