Clingo
|
The base implementation of an atom base. More...
#include <base.hh>
Public Types | |
using | Key = KeyType |
The key identifies an atom and is usually associated with further state. | |
Public Member Functions | |
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. | |
template<class T > | |
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 implementation of an atom base.
It implements generation counting and support for adding a context object.
|
inline |
Get the context of the base with the desired type.
Creates one if the base has none yet.