25#include <SimoxUtility/color/Color.h>
26#include <SimoxUtility/color/GlasbeyLUT.h>
35 LogMarkerRegistry::sameLine(
const LogMessage& a,
const LogMessage& b)
37 return a.time == b.time && a.who == b.who && a.what == b.what;
44 std::unique_lock lock(mutex);
48 if (sameLine(marker.snapshot, snapshot))
56 const simox::color::Color color = simox::color::GlasbeyLUT::at(colorIndex++);
61 marker.
color = QColor(color.r, color.g, color.b);
62 entries.push_back(std::move(marker));
76 std::unique_lock lock(mutex);
77 for (
auto it = entries.begin(); it != entries.end(); ++it)
98 std::unique_lock lock(mutex);
103 marker.color = color;
118 bool changed =
false;
120 std::unique_lock lock(mutex);
121 changed = !entries.empty();
130 std::vector<LogMarker>
133 std::unique_lock lock(mutex);
140 std::unique_lock lock(mutex);
143 if (sameLine(marker.snapshot, message))
const LogMarker * markerForMessage(const LogMessage &message) const
Marker for a message identical to message, or nullptr.
void recolor(LogMarkerId id, const QColor &color)
Reassign a marker's color (no-op if unknown).
LogMarkerRegistry(QObject *parent=nullptr)
bool isMarked(const LogMessage &message) const
Whether any marker's snapshot is identical to message.
const LogMarker * add(const LogMessage &snapshot)
Pin the given message.
void clear()
Drop all markers.
std::vector< LogMarker > markers() const
Ordered (insertion-order) view of all markers.
void remove(LogMarkerId id)
Remove the marker with the given id (no-op if unknown).
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::uint64_t LogMarkerId
A single pinned log line: a snapshot of the message plus the color assigned to it.