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 StoredLogEntryat (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.

Definition at line 62 of file LogStore.h.

Constructor & Destructor Documentation

◆ LogStore()

LogStore ( std::size_t maxEntries)
explicit

Definition at line 79 of file LogStore.cpp.

Member Function Documentation

◆ append()

LogSeq append ( const LogMessage & message)

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

Definition at line 84 of file LogStore.cpp.

+ Here is the call graph for this function:

◆ at()

const StoredLogEntry & at ( LogSeq seq) const

Only valid if contains(seq).

Definition at line 129 of file LogStore.cpp.

◆ clear()

void clear ( )

Drop everything.

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

Definition at line 141 of file LogStore.cpp.

+ Here is the call graph for this function:

◆ contains()

bool contains ( LogSeq seq) const

Definition at line 123 of file LogStore.cpp.

+ Here is the call graph for this function:

◆ endSeq()

LogSeq endSeq ( ) const

One past the sequence number of the newest retained entry.

Definition at line 117 of file LogStore.cpp.

+ Here is the caller graph for this function:

◆ firstSeq()

LogSeq firstSeq ( ) const

Sequence number of the oldest retained entry.

Definition at line 111 of file LogStore.cpp.

◆ size()

std::size_t size ( ) const

Definition at line 135 of file LogStore.cpp.

+ Here is the caller graph for this function:

◆ 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).

Definition at line 97 of file LogStore.cpp.


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