Clingo
Loading...
Searching...
No Matches
CppClingo::Ground::BaseImpl< KeyType, BaseType > Class Template Reference

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.
 

Detailed Description

template<class KeyType, class BaseType>
class CppClingo::Ground::BaseImpl< KeyType, BaseType >

The base implementation of an atom base.

It implements generation counting and support for adding a context object.

Member Function Documentation

◆ context()

template<class KeyType , class BaseType >
template<class T >
auto CppClingo::Ground::BaseImpl< KeyType, BaseType >::context ( ) -> T &
inline

Get the context of the base with the desired type.

Creates one if the base has none yet.


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