27#include <SimoxUtility/color/Color.h>
28#include <SimoxUtility/color/GlasbeyLUT.h>
40 std::unique_lock lock(mutex);
44 if (marker.seq == seq)
52 const simox::color::Color color = simox::color::GlasbeyLUT::at(colorIndex++);
57 marker.
color = QColor(color.r, color.g, color.b);
58 entries.push_back(std::move(marker));
69 std::unique_lock lock(mutex);
70 for (
auto it = entries.begin(); it != entries.end(); ++it)
91 std::unique_lock lock(mutex);
92 const auto newEnd = std::remove_if(entries.begin(),
95 { return marker.seq < firstSeq; });
96 changed = newEnd != entries.end();
97 entries.erase(newEnd, entries.end());
109 bool changed =
false;
111 std::unique_lock lock(mutex);
116 marker.color = color;
131 bool changed =
false;
133 std::unique_lock lock(mutex);
134 changed = !entries.empty();
146 std::unique_lock lock(mutex);
147 return entries.empty();
150 std::vector<LogMarker>
153 std::unique_lock lock(mutex);
160 std::unique_lock lock(mutex);
163 if (marker.seq == seq)
174 std::unique_lock lock(mutex);
177 if (marker.seq == seq)
bool expireBefore(LogSeq firstSeq)
Remove every marker whose line has been dropped from the store, i.e.
LogMarkerId markerIdForSeq(LogSeq seq) const
Id of the marker pinning seq, or 0 if it is not pinned.
void recolor(LogMarkerId id, const QColor &color)
Reassign a marker's color (no-op if unknown).
bool isMarked(LogSeq seq) const
Whether seq is pinned.
LogMarkerRegistry(QObject *parent=nullptr)
QColor colorForSeq(LogSeq seq) const
Color of the marker pinning seq, or an invalid QColor if it is not pinned.
void add(LogSeq seq)
Pin the store entry seq, assigning it the next Glasbey color.
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
quint64 LogSeq
Identifies a stored log entry for as long as it is retained.
A single pinned log line: the store entry it refers to plus the color assigned to it.
LogSeq seq
The pinned line, as a sequence number into the shared LogStore.