|
|
A filtered view onto the shared LogStore. More...
#include <ArmarXGui/gui-plugins/LoggingPlugin/ArmarXLogViewer/LogTableModel.h>
Inheritance diagram for LogTableModel:Public Types | |
| enum class | UserRoles : int { FullMsgRole = Qt::UserRole + 1 } |
Public Slots | |
| void | refreshMarkers () |
| Rebuild the set of injected pin rows and re-color rows (full reset). | |
Public Member Functions | |
| int | addEntries (const std::vector< LogSeq > &seqs, MessageType *batchMaxLevelOut=nullptr) |
Append those of seqs that pass this model's filters, in one insertion. | |
| void | addFilter (const std::string &columnName, const std::string &filter, MatchMode mode=MatchMode::Contains) |
| int | clearData () |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
| QVariant | data (const QModelIndex &index, int role) const override |
| void | dropRowsBefore (LogSeq firstSeq) |
| Discard rows whose store entry has been dropped. Called after the store trims. | |
| 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 |
| The message shown in the given row. Only valid while the row exists. | |
| MessageType | getMaxNewLogLevelType () |
| QVariant | headerData (int section, Qt::Orientation orientation, int role) const override |
| bool | isMaterialised () const |
| 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. | |
| 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 | rowForSeq (LogSeq seq) const |
Display row showing seq, or -1 if it is not shown. | |
| void | search (const QString &searchStr) |
| LogSeq | seqAt (int row) const |
| Store sequence number of the given display row, or 0 if the row is invalid. | |
| bool | setData (const QModelIndex &index, const QVariant &value, int role) override |
| void | setMarkerRegistry (LogMarkerRegistry *registry) |
| Attach the shared pin registry. | |
| void | setMaterialised (bool materialised) |
| Build rows (materialised) or drop them and only keep counting (not). | |
| void | setMaxEntries (std::size_t maxEntries) |
| Upper bound on displayed rows. | |
| void | setStore (const LogStore *store) |
| Attach the shared backing store. Must be called before any ingestion. | |
Protected Member Functions | |
| bool | applyFilter (const LogFilter &filter, const LogMessage &logMsg) |
| bool | applyFilters (const LogMessage &logMsg) |
| void | enforceMaxEntries () |
| Trim the oldest rows once the display window is exceeded. | |
A filtered view onto the shared LogStore.
The model does not own any log message. It keeps a vector of LogSeq – one per displayed row – into the store owned by the LogViewer, plus the little per-filter state that genuinely differs between filters (search match, pin color, and whether the row is an injected pin rather than a row this filter accepted).
A model is materialised only while its table is visible. A hidden filter keeps counting the messages it accepts (for the new-message badge) but builds no rows at all, which is what keeps ingestion independent of how many filters exist. Rows are rebuilt from the store when the table is shown again.
Definition at line 93 of file LogTableModel.h.
|
strong |
| Enumerator | |
|---|---|
| FullMsgRole | |
Definition at line 97 of file LogTableModel.h.
|
explicit |
Definition at line 94 of file LogTableModel.cpp.
| int addEntries | ( | const std::vector< LogSeq > & | seqs, |
| MessageType * | batchMaxLevelOut = nullptr ) |
Append those of seqs that pass this model's filters, in one insertion.
The messages themselves are read from the shared store. Returns how many were accepted – which is counted even while the model is not materialised, so the new-message badge of a hidden filter stays correct. batchMaxLevelOut, if given, receives the highest severity among the accepted messages.
Definition at line 758 of file LogTableModel.cpp.
Here is the call graph for this function:| void addFilter | ( | const std::string & | columnName, |
| const std::string & | filter, | ||
| MatchMode | mode = MatchMode::Contains ) |
|
protected |
|
protected |
Definition at line 1077 of file LogTableModel.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| int clearData | ( | ) |
Definition at line 987 of file LogTableModel.cpp.
|
override |
|
override |
Definition at line 134 of file LogTableModel.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void dropRowsBefore | ( | LogSeq | firstSeq | ) |
Discard rows whose store entry has been dropped. Called after the store trims.
Definition at line 899 of file LogTableModel.cpp.
|
protected |
Trim the oldest rows once the display window is exceeded.
Definition at line 865 of file LogTableModel.cpp.
Here is the caller graph for this function:
|
override |
| int getColumn | ( | const std::string & | columnName | ) | const |
Definition at line 966 of file LogTableModel.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 124 of file LogTableModel.h.
|
inline |
Definition at line 144 of file LogTableModel.h.
| const LogMessage & getLogEntry | ( | size_t | row | ) | const |
The message shown in the given row. Only valid while the row exists.
Definition at line 1014 of file LogTableModel.cpp.
|
inline |
Definition at line 130 of file LogTableModel.h.
|
override |
|
inline |
Definition at line 160 of file LogTableModel.h.
| bool isRowMarked | ( | int | row | ) | const |
Whether the given display row is currently pinned (has a label color).
Definition at line 955 of file LogTableModel.cpp.
| int lineCountAt | ( | int | row | ) | const |
Number of display lines of the message column for the given row.
Definition at line 1027 of file LogTableModel.cpp.
Here is the caller graph for this function:| bool msgContainsString | ( | const LogMessage & | logMsg, |
| QString | searchStr ) const |
| void reapplyAllFilters | ( | ) |
Definition at line 550 of file LogTableModel.cpp.
|
slot |
Rebuild the set of injected pin rows and re-color rows (full reset).
Definition at line 600 of file LogTableModel.cpp.
Here is the caller graph for this function:| void resetFilters | ( | ) |
Definition at line 572 of file LogTableModel.cpp.
| bool rowContainsString | ( | int | row, |
| const QString & | searchStr ) const |
Definition at line 352 of file LogTableModel.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
override |
Definition at line 106 of file LogTableModel.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| int rowForSeq | ( | LogSeq | seq | ) | const |
Display row showing seq, or -1 if it is not shown.
Definition at line 941 of file LogTableModel.cpp.
| void search | ( | const QString & | searchStr | ) |
Definition at line 414 of file LogTableModel.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| LogSeq seqAt | ( | int | row | ) | const |
Store sequence number of the given display row, or 0 if the row is invalid.
Definition at line 930 of file LogTableModel.cpp.
Here is the caller graph for this function:
|
override |
Definition at line 516 of file LogTableModel.cpp.
| void setMarkerRegistry | ( | LogMarkerRegistry * | registry | ) |
Attach the shared pin registry.
The model then shows registry markers that are not already present as rows of its own (injected, in time position), colors pinned rows, and refreshes whenever the registry changes.
Definition at line 578 of file LogTableModel.cpp.
Here is the call graph for this function:| void setMaterialised | ( | bool | materialised | ) |
Build rows (materialised) or drop them and only keep counting (not).
Definition at line 730 of file LogTableModel.cpp.
Here is the caller graph for this function:| void setMaxEntries | ( | std::size_t | maxEntries | ) |
Upper bound on displayed rows.
0 disables the bound. The store keeps more history than this so that a quiet filter can still fill its window; this bounds what any single table has to lay out and paint.
Definition at line 858 of file LogTableModel.cpp.
Here is the call graph for this function:| void setStore | ( | const LogStore * | store | ) |
Attach the shared backing store. Must be called before any ingestion.
Definition at line 100 of file LogTableModel.cpp.