pl_search_cpp 1.4
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
pl_search::VarChoiceIterator Class Reference

Choice iterator for variables. More...

#include <choice_iterator.hpp>

Inheritance diagram for pl_search::VarChoiceIterator:
Inheritance graph
[legend]
Collaboration diagram for pl_search::VarChoiceIterator:
Collaboration graph
[legend]

Public Member Functions

 VarChoiceIterator (Engine *engine, PVarPtr v, std::vector< TermPtr > ch)
 Constructs a VarChoiceIterator.
 
bool has_next () override
 Checks if there are more choices available.
 
virtual bool make_choice () override
 Makes a choice.
 
- Public Member Functions inherited from pl_search::ChoiceIterator
virtual bool test_choice ()
 Tests a choice which would tyically involve constraint deductions based on the choice.
 
virtual ~ChoiceIterator ()=default
 Virtual destructor for proper cleanup.
 

Protected Attributes

Engineengine
 Pointer to the Engine.
 
int index
 Current index in the choices vector.
 
PVarPtr var
 Pointer to the variable.
 
std::vector< TermPtrchoices
 Reference to the vector of choices.
 

Detailed Description

Choice iterator for variables.

Constructor & Destructor Documentation

◆ VarChoiceIterator()

pl_search::VarChoiceIterator::VarChoiceIterator ( Engine engine,
PVarPtr  v,
std::vector< TermPtr ch 
)
inline

Constructs a VarChoiceIterator.

Parameters
enginePointer to the Engine.
vPointer to the variable.
chReference to the vector of choices.

Member Function Documentation

◆ has_next()

bool pl_search::VarChoiceIterator::has_next ( )
inlineoverridevirtual

Checks if there are more choices available.

Returns
True if there are more choices, false otherwise.

Implements pl_search::ChoiceIterator.

◆ make_choice()

virtual bool pl_search::VarChoiceIterator::make_choice ( )
inlineoverridevirtual

Makes a choice.

Returns
True if the choice is made successfully and follow up deductions do not fail, false otherwise.

Implements pl_search::ChoiceIterator.

Member Data Documentation

◆ choices

std::vector<TermPtr> pl_search::VarChoiceIterator::choices
protected

Reference to the vector of choices.

◆ engine

Engine* pl_search::VarChoiceIterator::engine
protected

Pointer to the Engine.

◆ index

int pl_search::VarChoiceIterator::index
protected

Current index in the choices vector.

◆ var

PVarPtr pl_search::VarChoiceIterator::var
protected

Pointer to the variable.


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