LogStore Class Reference

The single bounded buffer holding every log line the viewer retains. More...

#include <ArmarXGui/gui-plugins/LoggingPlugin/ArmarXLogViewer/LogStore.h>

Public Member Functions

LogSeq append (const LogMessage &message)
 Append message, deriving its display data, and return its sequence number.
 
const StoredLogEntry & at (LogSeq seq) const
 Only valid if contains(seq).
 
void clear ()
 Drop everything.
 
bool contains (LogSeq seq) const
 
LogSeq endSeq () const
 One past the sequence number of the newest retained entry.
 
LogSeq firstSeq () const
 Sequence number of the oldest retained entry.
 
 LogStore (std::size_t maxEntries)
 
std::size_t size () const
 
bool trim ()
 Drop the oldest entries until the bound is met.
 

Detailed Description

The single bounded buffer holding every log line the viewer retains.

Filters do not own their messages: each LogTableModel keeps a vector of LogSeq into this store. A message accepted by "All Messages", by its logging group filter and by its component filter is therefore stored – and has its display data derived – once instead of three times.

GUI thread only, like the rest of the viewer's model state. LogViewer::writeLog runs on an Ice dispatch thread but only appends to its own staging queue; everything reaching the store goes through insertPendingEntries on the GUI thread.

Constructor & Destructor Documentation

◆ LogStore()

LogStore ( std::size_t maxEntries)
explicit

Member Function Documentation

◆ append()

LogSeq append ( const LogMessage & message)

Append message, deriving its display data, and return its sequence number.

◆ at()

const StoredLogEntry & at ( LogSeq seq) const

Only valid if contains(seq).

◆ clear()

void clear ( )

Drop everything.

Sequence numbers keep counting up, so references to the discarded entries stay invalid rather than aliasing new ones.

◆ contains()

bool contains ( LogSeq seq) const

◆ endSeq()

LogSeq endSeq ( ) const

One past the sequence number of the newest retained entry.

◆ firstSeq()

LogSeq firstSeq ( ) const

Sequence number of the oldest retained entry.

◆ size()

std::size_t size ( ) const

◆ trim()

bool trim ( )

Drop the oldest entries until the bound is met.

Returns true if anything was dropped, in which case firstSeq() has advanced and every model has to discard the rows below it (see LogTableModel::dropRowsBefore).


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