Clingo
|
The base capturing derived head aggregate atoms. More...
#include <head_aggregate.hh>
Public Types | |
using | AtomMap = Util::ordered_map< Symbol const *, AtomHdAggr, Util::array_hash, Util::array_equal_to > |
Map containing the atoms. | |
![]() | |
using | Key = Symbol const * |
The key identifies an atom and is usually associated with further state. | |
Public Member Functions | |
BaseHdAggr (size_t size) | |
Construct an empty base. | |
auto | add (Symbol const *sym, AggregateFunction fun) -> std::pair< AtomMap::iterator, bool > |
Add an atom to the current generation. | |
auto | size () const -> size_t |
Get the number of derived atoms. | |
auto | index (Symbol const *sym) const -> size_t |
Get the atom index of the given symbol. | |
auto | nth (size_t i) const -> AtomMap::const_iterator |
Get the i-th atom in the base. | |
auto | nth (size_t i) -> AtomMap::iterator |
Get the i-th atom in the base. | |
auto | atoms () -> AtomMap & |
Get the underlying atom map. | |
auto | contains (Key const &sym, MatcherType type) const -> std::optional< size_t > |
Check if the base contains the given atom with in the given generation. | |
![]() | |
auto | begin (MatcherType type) const -> size_t |
Get the index of the first atom in the given generation. | |
auto | end (MatcherType type) const -> size_t |
Get the index plus one of the last atom in the given generation. | |
auto | contains (Key const &sym, MatcherType type) const -> std::optional< size_t > |
Check if the base contains the given atom with in the given generation. | |
void | update (size_t generation) |
Update the generation counts. | |
void | ensure (size_t generation) |
Ensure that atoms are added to the given generation. | |
auto | context () -> T & |
Get the context of the base with the desired type. | |
void | clear_context () |
Clear the current context. | |
auto | has_update () const -> bool |
Check if the base has an update. | |
The base capturing derived head aggregate atoms.
auto CppClingo::Ground::BaseHdAggr::index | ( | Symbol const * | sym | ) | const -> size_t |
Get the atom index of the given symbol.
Note that only derived atoms have indices.