Clingo
|
An atom base that maps symbols to atoms. More...
#include <base.hh>
Public Types | |
using | key_type = Symbol |
The key type. | |
using | mapped_type = Atom |
The mapped type. | |
using | value_type = std::pair< key_type, mapped_type > |
The value type. | |
using | size_type = std::size_t |
The size type. | |
using | difference_type = std::ptrdiff_t |
The difference type. | |
using | reference = value_type |
The reference type. | |
using | pointer = Detail::ArrowProxy< value_type > |
The pointer type. | |
using | iterator = Detail::RandomAccessIterator< AtomBase > |
The iterator type. | |
Public Member Functions | |
AtomBase (clingo_atom_base_t const *base) | |
Construct an atom base from its C representation. | |
auto | size () const -> size_type |
The size of the atom base. | |
auto | at (size_t index) const -> value_type |
Get the symbol atom pair at the given index. | |
auto | contains (key_type const &symbol) const -> bool |
Whether the atom base contains the given symbol. | |
auto | get (key_type const &symbol, std::optional< mapped_type > def=std::nullopt) const -> std::optional< mapped_type > |
Get the atom for the given symbol. | |
auto | begin () const -> iterator |
Get an iterator pointing to the first element of the atom base. | |
auto | end () const -> iterator |
Get an iterator pointing to the end of the atom base. | |
An atom base that maps symbols to atoms.
|
inlineexplicit |
Construct an atom base from its C representation.
For internal use.
base | the C atom base |
|
inline |
Get the symbol atom pair at the given index.
index | the index of the atom |
Get an iterator pointing to the first element of the atom base.
Whether the atom base contains the given symbol.
symbol | the symbol to check |
Get an iterator pointing to the end of the atom base.
|
inline |
Get the atom for the given symbol.
symbol | the symbol to look for |
def | the default value to return if the symbol is not found |
The size of the atom base.