Clingo
Loading...
Searching...
No Matches
Clingo::ConstStatsArray Class Reference

Class modeling an immutable view on an array of statistics entries. More...

#include <stats.hh>

Inheritance diagram for Clingo::ConstStatsArray:
Clingo::StatsArray

Public Types

using value_type = ConstStats
 The value type of the array, which are stats entries.
 
using size_type = std::size_t
 The size type of the array.
 
using difference_type = std::ptrdiff_t
 The difference type of the array.
 
using reference = value_type
 The reference type of the array, which are stats entries.
 
using pointer = Detail::ArrowProxy< value_type >
 The pointer type of the array, which is a proxy to stats entries.
 
using iterator = Detail::RandomAccessIterator< ConstStatsArray >
 The iterator type, which is a random access iterator over stats entries.
 

Public Member Functions

 ConstStatsArray (clingo_stats_t const *stats, uint64_t key)
 Construct a statistics array from a pointer to the C API and a key.
 
auto at (size_t index) const -> ConstStats
 Get a statistics entry at the given index if the entry is an array.
 
auto operator[] (size_t index) const -> ConstStats
 Get a statistics entry at the given index if the entry is an array.
 
auto size () const -> size_t
 Get the size of the array.
 
auto begin () const -> iterator
 Get an iterator to the beginning of the array.
 
auto end () const -> iterator
 Get an iterator to the end of the array.
 

Friends

class StatsArray
 

Detailed Description

Class modeling an immutable view on an array of statistics entries.

Constructor & Destructor Documentation

◆ ConstStatsArray()

Clingo::ConstStatsArray::ConstStatsArray ( clingo_stats_t const stats,
uint64_t  key 
)
inlineexplicit

Construct a statistics array from a pointer to the C API and a key.

Parameters
statsthe statistics entry to construct the array from
keythe key of the statistics entry

Member Function Documentation

◆ at()

auto Clingo::ConstStatsArray::at ( size_t  index) const -> ConstStats
inline

Get a statistics entry at the given index if the entry is an array.

Parameters
indexthe index of the statistics entry to get
Returns
a statistics entry at the given index

◆ begin()

auto Clingo::ConstStatsArray::begin ( ) const -> iterator
inline

Get an iterator to the beginning of the array.

Returns
an iterator to the beginning of the array

◆ end()

auto Clingo::ConstStatsArray::end ( ) const -> iterator
inline

Get an iterator to the end of the array.

Returns
an iterator to the end of the array

◆ operator[]()

auto Clingo::ConstStatsArray::operator[] ( size_t  index) const -> ConstStats
inline

Get a statistics entry at the given index if the entry is an array.

Parameters
indexthe index of the statistics entry to get
Returns
a statistics entry at the given index

◆ size()

auto Clingo::ConstStatsArray::size ( ) const -> size_t
inline

Get the size of the array.

Returns
the size of the array

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