Clingo
|
Class modeling an immutable 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 = 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 | |
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. | |
Friends | |
class | StatsMap |
Class modeling an immutable 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.
Check if the map contains a subkey with the given name.
name | the name of the subkey to check |
Get an iterator to the end of the map.
|
inline |
Get a statistics entry with the given name if the entry is a map.
name | the name of the statistics entry to get |
|
inline |
Get a statistics entry with the given name if the entry is a map.
name | the name of the statistics entry to get |
Get the size of the map.