Clingo
|
A term base that maps symbols to terms. More...
#include <base.hh>
Public Types | |
using | key_type = Symbol |
The key type. | |
using | mapped_type = Term |
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< TermBase > |
The iterator type. | |
Public Member Functions | |
TermBase (clingo_term_base_t const &base) | |
Construct a term base from its C representation. | |
auto | size () const -> size_type |
The size of the term base. | |
auto | at (size_t index) const -> value_type |
Get the symbol term pair at the given index. | |
auto | contains (key_type const &symbol) const -> bool |
Whether the term 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 term for the given symbol. | |
auto | begin () const -> iterator |
Get an iterator pointing to the first element of the term base. | |
auto | end () const -> iterator |
Get an iterator pointing to the end of the term base. | |
A term base that maps symbols to terms.
|
inlineexplicit |
Construct a term base from its C representation.
base | the C term base |
|
inline |
Get the symbol term pair at the given index.
index | the index of the term |
Get an iterator pointing to the first element of the term base.
Whether the term base contains the given symbol.
symbol | the symbol to check |
Get an iterator pointing to the end of the term base.
|
inline |
Get the term 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 term base.