Clingo
Loading...
Searching...
No Matches
Clingo::SolveHandle::iterator Class Reference

Iterator to iterate over models found during solving. More...

#include <solve.hh>

Public Types

using iterator_category = std::input_iterator_tag
 The iterator category.
 
using difference_type = std::ptrdiff_t
 The difference type.
 
using value_type = ConstModel
 The value type, which are models.
 
using pointer = ConstModel *
 The pointer type.
 
using reference = ConstModel &
 The reference type.
 

Public Member Functions

 iterator ()=default
 The default constructor.
 
auto operator* () const -> reference
 Get a reference to the current model.
 
auto operator-> () const -> pointer
 Member access operator to get a pointer to the current model.
 
auto operator++ () -> iterator &
 Increment the iterator to the next model.
 
auto operator++ (int) -> iterator
 Postfix increment the iterator.
 

Friends

class SolveHandle
 
auto operator== (const iterator &a, const iterator &b) -> bool
 Compare iterators for equality.
 
auto operator== (iterator const &a, sentinel const &b) -> bool
 Check whether all models have been exhausted.
 

Detailed Description

Iterator to iterate over models found during solving.

Constructor & Destructor Documentation

◆ iterator()

Clingo::SolveHandle::iterator::iterator ( )
default

The default constructor.

Construct an iterator in invalid state. For interface completeness.

Member Function Documentation

◆ operator++()

auto Clingo::SolveHandle::iterator::operator++ ( int  ) -> iterator
inline

Postfix increment the iterator.

For interface completeness. Do not use.

Friends And Related Symbol Documentation

◆ operator== [1/2]

auto operator== ( const iterator a,
const iterator b 
) -> bool
friend

Compare iterators for equality.

For interface completeness. Do not use.

Parameters
athe first iterator to compare
bthe second iterator to compare
Returns
whether the iterators are equal

◆ operator== [2/2]

auto operator== ( iterator const a,
sentinel const b 
) -> bool
friend

Check whether all models have been exhausted.

Parameters
athe iterator to compare
bthe sentinel to compare
Returns
whether all models have been exhausted

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