LogTableModel Class Reference

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

+ Inheritance diagram for LogTableModel:

Public Types

enum class  UserRoles : int { FullMsgRole = Qt::UserRole + 1 }
 

Public Slots

int addEntries (const std::vector< LogMessage > &entryList, const QString &filterStr)
 
bool addEntry (const LogMessage &entry, int *entriesAdded=NULL)
 
void refreshMarkers ()
 Rebuild the set of injected pin rows and re-color native rows (full reset).
 

Public Member Functions

void addFilter (const std::string &columnName, const std::string &filter, MatchMode mode=MatchMode::Contains)
 
int clearData ()
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
bool containsNativeLine (const LogMessage &message) const
 Whether this model holds message as a native (non-injected) row.
 
QVariant data (const QModelIndex &index, int role) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
int getColumn (const std::string &columnName) const
 
QString getCurrentSearchStr ()
 
const std::vector< LogFilter > & getFilters () const
 
const LogMessage & getLogEntry (size_t row) const
 
MessageType getMaxNewLogLevelType ()
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const override
 
bool insertRows (int row, int count, const QModelIndex &parent) override
 
bool isRowMarked (int row) const
 Whether the given display row is currently pinned (has a label color).
 
int lineCountAt (int row) const
 Number of display lines of the message column for the given row (precomputed).
 
 LogTableModel (QObject *parent=0)
 
bool msgContainsString (const LogMessage &logMsg, QString searchStr) const
 
void reapplyAllFilters ()
 
void resetFilters ()
 
bool rowContainsString (int row, const QString &searchStr) const
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
int rowForMessage (const LogMessage &message) const
 Display row of the (first) line identical to message, or -1 if not shown.
 
void search (const QString &searchStr)
 
bool setData (const QModelIndex &index, const QVariant &value, int role) override
 
void setMarkerRegistry (LogMarkerRegistry *registry)
 Attach the shared pin registry.
 
void setMaxEntries (std::size_t maxEntries)
 Upper bound on retained log entries.
 
void updateView ()
 

Protected Member Functions

bool applyFilter (const LogFilter &filter, const LogMessage &logMsg)
 
bool applyFilters (const LogMessage &logMsg)
 
void enforceMaxEntries ()
 Trim the oldest entries once the buffer exceeds its bound (see setMaxEntries).
 

Detailed Description

Definition at line 73 of file LogTableModel.h.

Member Enumeration Documentation

◆ UserRoles

enum class UserRoles : int
strong
Enumerator
FullMsgRole 

Definition at line 77 of file LogTableModel.h.

Constructor & Destructor Documentation

◆ LogTableModel()

LogTableModel ( QObject * parent = 0)
explicit

Definition at line 136 of file LogTableModel.cpp.

Member Function Documentation

◆ addEntries

int addEntries ( const std::vector< LogMessage > & entryList,
const QString & filterStr )
slot

Definition at line 867 of file LogTableModel.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addEntry

bool addEntry ( const LogMessage & entry,
int * entriesAdded = NULL )
slot

Definition at line 826 of file LogTableModel.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addFilter()

void addFilter ( const std::string & columnName,
const std::string & filter,
MatchMode mode = MatchMode::Contains )

Definition at line 637 of file LogTableModel.cpp.

+ Here is the caller graph for this function:

◆ applyFilter()

bool applyFilter ( const LogFilter & filter,
const LogMessage & logMsg )
protected

Definition at line 994 of file LogTableModel.cpp.

+ Here is the caller graph for this function:

◆ applyFilters()

bool applyFilters ( const LogMessage & logMsg)
protected

Definition at line 1034 of file LogTableModel.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clearData()

int clearData ( )

Definition at line 957 of file LogTableModel.cpp.

◆ columnCount()

int columnCount ( const QModelIndex & parent = QModelIndex()) const
override

Definition at line 149 of file LogTableModel.cpp.

+ Here is the caller graph for this function:

◆ containsNativeLine()

bool containsNativeLine ( const LogMessage & message) const

Whether this model holds message as a native (non-injected) row.

Used by the viewer to expire pins once their source line has aged out of every buffer.

Definition at line 801 of file LogTableModel.cpp.

◆ data()

QVariant data ( const QModelIndex & index,
int role ) const
override

Definition at line 155 of file LogTableModel.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enforceMaxEntries()

void enforceMaxEntries ( )
protected

Trim the oldest entries once the buffer exceeds its bound (see setMaxEntries).

Definition at line 902 of file LogTableModel.cpp.

+ Here is the caller graph for this function:

◆ flags()

Qt::ItemFlags flags ( const QModelIndex & index) const
override

Definition at line 596 of file LogTableModel.cpp.

+ Here is the call graph for this function:

◆ getColumn()

int getColumn ( const std::string & columnName) const

Definition at line 936 of file LogTableModel.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentSearchStr()

QString getCurrentSearchStr ( )
inline

Definition at line 103 of file LogTableModel.h.

◆ getFilters()

const std::vector< LogFilter > & getFilters ( ) const
inline

Definition at line 123 of file LogTableModel.h.

◆ getLogEntry()

const LogMessage & getLogEntry ( size_t row) const

Definition at line 977 of file LogTableModel.cpp.

+ Here is the caller graph for this function:

◆ getMaxNewLogLevelType()

MessageType getMaxNewLogLevelType ( )
inline

Definition at line 109 of file LogTableModel.h.

+ Here is the caller graph for this function:

◆ headerData()

QVariant headerData ( int section,
Qt::Orientation orientation,
int role ) const
override

Definition at line 483 of file LogTableModel.cpp.

+ Here is the caller graph for this function:

◆ insertRows()

bool insertRows ( int row,
int count,
const QModelIndex & parent )
override

Definition at line 622 of file LogTableModel.cpp.

◆ isRowMarked()

bool isRowMarked ( int row) const

Whether the given display row is currently pinned (has a label color).

Definition at line 815 of file LogTableModel.cpp.

◆ lineCountAt()

int lineCountAt ( int row) const

Number of display lines of the message column for the given row (precomputed).

Definition at line 983 of file LogTableModel.cpp.

◆ msgContainsString()

bool msgContainsString ( const LogMessage & logMsg,
QString searchStr ) const

Definition at line 419 of file LogTableModel.cpp.

+ Here is the caller graph for this function:

◆ reapplyAllFilters()

void reapplyAllFilters ( )

Definition at line 645 of file LogTableModel.cpp.

+ Here is the call graph for this function:

◆ refreshMarkers

void refreshMarkers ( )
slot

Rebuild the set of injected pin rows and re-color native rows (full reset).

Definition at line 722 of file LogTableModel.cpp.

+ Here is the caller graph for this function:

◆ resetFilters()

void resetFilters ( )

Definition at line 675 of file LogTableModel.cpp.

◆ rowContainsString()

bool rowContainsString ( int row,
const QString & searchStr ) const

Definition at line 398 of file LogTableModel.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rowCount()

int rowCount ( const QModelIndex & parent = QModelIndex()) const
override

Definition at line 143 of file LogTableModel.cpp.

+ Here is the caller graph for this function:

◆ rowForMessage()

int rowForMessage ( const LogMessage & message) const

Display row of the (first) line identical to message, or -1 if not shown.

Definition at line 787 of file LogTableModel.cpp.

◆ search()

void search ( const QString & searchStr)

Definition at line 460 of file LogTableModel.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setData()

bool setData ( const QModelIndex & index,
const QVariant & value,
int role )
override

Definition at line 590 of file LogTableModel.cpp.

◆ setMarkerRegistry()

void setMarkerRegistry ( LogMarkerRegistry * registry)

Attach the shared pin registry.

The model then shows registry markers that are not already present as native rows (injected, in time position), colors pinned rows, and refreshes whenever the registry changes.

Definition at line 700 of file LogTableModel.cpp.

+ Here is the call graph for this function:

◆ setMaxEntries()

void setMaxEntries ( std::size_t maxEntries)

Upper bound on retained log entries.

0 disables the bound. When the buffer grows past maxEntries by a small headroom factor, the oldest entries are trimmed back down to maxEntries.

Definition at line 895 of file LogTableModel.cpp.

+ Here is the call graph for this function:

◆ updateView()

void updateView ( )

Definition at line 609 of file LogTableModel.cpp.

+ Here is the caller graph for this function:

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