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

Represents a disjunction of predicates. More...

#include <pred.hpp>

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

Public Member Functions

 DisjPred (Engine *eng, std::vector< PredPtr > preds)
 Constructs a DisjPred with the given predicates.
 
void initialize_call () override
 Initializes the predicate call.
 
bool apply_choice () override
 Applies a choice.
 
bool more_choices () override
 Checks if there are more choices.
 
- Public Member Functions inherited from pl_search::Pred
 Pred (Engine *eng)
 Default constructor.
 
PredPtr get_continuation ()
 Gets the continuation of the predicate.
 
virtual void set_continuation (PredPtr cont)
 Sets the continuation of the predicate.
 
PredPtr last_pred ()
 Follows the continuation chain to the last predicate.
 
bool is_non_det ()
 Determines if the predicate is non-deterministic.
 
void wrap_with_once ()
 Wraps the predicate with a once.
 
virtual ~Pred ()=default
 Virtual destructor for proper cleanup.
 
std::string get_name ()
 For debugging.
 

Protected Attributes

std::vector< PredPtrpreds
 The predicates in the disjunction.
 
int index
 index of the current predicate choice
 
- Protected Attributes inherited from pl_search::Pred
PredPtr continuation
 The continuation of the predicate.
 
Engineengine
 

Detailed Description

Represents a disjunction of predicates.

Constructor & Destructor Documentation

◆ DisjPred()

pl_search::DisjPred::DisjPred ( Engine eng,
std::vector< PredPtr preds 
)
inline

Constructs a DisjPred with the given predicates.

Parameters
engPointer to the engine.
predsA vector of shared pointers to the predicates.

preds become the list of choices - when a choice is made that choice becomes the next predicate to be called.

Member Function Documentation

◆ apply_choice()

bool pl_search::DisjPred::apply_choice ( )
inlineoverridevirtual

Applies a choice.

Returns
True if the choice is applied successfully, false otherwise.

< Get the next choice

By setting continuation to choice, it will be the next predicate to be called

Reimplemented from pl_search::Pred.

◆ initialize_call()

void pl_search::DisjPred::initialize_call ( )
inlineoverridevirtual

Initializes the predicate call.

< Set the continuations for each of preds to this continuation

Reimplemented from pl_search::Pred.

◆ more_choices()

bool pl_search::DisjPred::more_choices ( )
inlineoverridevirtual

Checks if there are more choices.

Returns
True if there are more choices, false otherwise.

Reimplemented from pl_search::Pred.

Member Data Documentation

◆ index

int pl_search::DisjPred::index
protected

index of the current predicate choice

◆ preds

std::vector<PredPtr> pl_search::DisjPred::preds
protected

The predicates in the disjunction.


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