Class Log::Reader

Nested Relationships

This class is a nested type of Class Log.

Nested Types

Class Documentation

class Reader

A Reader that can iterate through the Views of Logs. The Reader will keep track of which Entries have already been viewed, so every Entry read by a single Reader instance is unique.

Public Functions

Reader()

Construct a Reader.

Iterable read(const View &view)

Create an object that can iterate through the entries of a View. Any entries that have been read by this Reader in the past will be skipped. This can be used in a range-based for loop, e.g.:

for (const auto& entry : reader.read(view))
{
  std::cout << entry.text() << std::endl;
}
class Iterable

Public Types

using const_iterator = iterator

Public Functions

iterator begin() const

Get the beginning iterator of the read.

iterator end() const

Get the ending iterator of the read.

class iterator

Public Functions

const Entry &operator*() const

Dereference operator.

const Entry *operator->() const

Drill-down operator.

iterator &operator++()

Pre-increment operator: ++it

Note

This is more efficient than the post-increment operator.

Warning

It is undefined behavior to perform this operation on an iterator that is equal to Log::Reader::Iterable::end().

Returns:

a reference to the iterator itself

iterator operator++(int)

Post-increment operator: it++

Warning

It is undefined behavior to perform this operation on an iterator that is equal to Log::Reader::Iterable::end().

Returns:

a copy of the iterator before it was incremented.

bool operator==(const iterator &other) const

Equality comparison operator.

bool operator!=(const iterator &other) const

Inequality comparison operator.