Clingo
|
Class modeling a mutable view on a map of statistics entries. More...
#include <stats.hh>
Public Types | |
using | key_type = std::string_view |
The key type of the map, which is a string view. | |
using | mapped_type = Stats |
The mapped type of the map, which is a mutable stats entry. | |
using | value_type = std::pair< key_type, mapped_type > |
The value type of the map, which is a pair of key and mapped type. | |
using | size_type = std::size_t |
The size type of the map. | |
using | difference_type = std::ptrdiff_t |
The difference type of the map. | |
using | reference = value_type |
The reference type of the map, which corresponds to the value type. | |
using | pointer = Detail::ArrowProxy< value_type > |
The pointer type of the map, which is a proxy to the value type. | |
using | iterator = Detail::RandomAccessIterator< StatsMap > |
The iterator type, which is a random access iterator over value types. | |
![]() | |
using | key_type = std::string_view |
The key type of the map, which is a string view. | |
using | mapped_type = ConstStats |
The mapped type of the map, which is an immutable stats entry. | |
using | value_type = std::pair< key_type, mapped_type > |
The value type of the map, which is a pair of key and mapped type. | |
using | size_type = std::size_t |
The size type of the map. | |
using | difference_type = std::ptrdiff_t |
The difference type of the map. | |
using | reference = value_type |
The reference type of the map, which is a pair of key and mapped type. | |
using | pointer = Detail::ArrowProxy< value_type > |
The pointer type of the map, which is a proxy to the value type. | |
using | iterator = Detail::RandomAccessIterator< ConstStatsMap > |
The iterator type, which is a random access iterator over value types. | |
Public Member Functions | |
StatsMap (clingo_stats_t *stats, uint64_t key) | |
Construct a statistics map from a pointer to the C API and a key. | |
auto | at (size_t index) const -> value_type |
Get the name entry pair at the given index. | |
auto | operator[] (std::string_view name) const -> Stats |
Get a statistics entry with the given name if the entry is a map. | |
auto | get (std::string_view name) const -> Stats |
Get a statistics entry with the given name if the entry is a map. | |
auto | insert (std::string_view name, StatsType type) const -> Stats |
Insert a statistics entry with the given name and type into the map. | |
auto | begin () const -> iterator |
Get an iterator to the beginning of the map. | |
auto | end () const -> iterator |
Get an iterator to the end of the map. | |
![]() | |
ConstStatsMap (clingo_stats_t const *stats, uint64_t key) | |
Construct a statistics map from a pointer to the C API and a key. | |
auto | size () const -> size_t |
Get the size of the map. | |
auto | at (size_t index) const -> value_type |
Get the name entry pair at the given index. | |
auto | operator[] (std::string_view name) const -> ConstStats |
Get a statistics entry with the given name if the entry is a map. | |
auto | get (std::string_view name) const -> ConstStats |
Get a statistics entry with the given name if the entry is a map. | |
auto | contains (std::string_view name) const -> bool |
Check if the map contains a subkey with the given name. | |
auto | begin () const -> iterator |
Get an iterator to the beginning of the map. | |
auto | end () const -> iterator |
Get an iterator to the end of the map. | |
Class modeling a mutable view on a map of statistics entries.
|
inlineexplicit |
Construct a statistics map from a pointer to the C API and a key.
stats | the statistics entry to construct the map from |
key | the key of the statistics entry |
|
inline |
Get the name entry pair at the given index.
index | the index of the entry to get |
Get an iterator to the beginning of the map.
Get an iterator to the end of the map.
Get a statistics entry with the given name if the entry is a map.
name | the name of the statistics entry to get |
Insert a statistics entry with the given name and type into the map.
If the map already contains an entry with the given name, the existing entry is returned.
New entries have their default values; empty for arrays and lists, zero for numbers.
name | the name of the statistics entry to insert |
type | the type of the statistics entry to insert |
Get a statistics entry with the given name if the entry is a map.
name | the name of the statistics entry to get |