1 #ifndef VTESTBED_GUI_CIRCULARLINEBUFFER_HH 2 #define VTESTBED_GUI_CIRCULARLINEBUFFER_HH 8 #include <vtestbed/core/circular_buffer.hh> 14 enum class LogLineMarker {Output, Error, Log};
20 LogLineMarker _marker = static_cast<LogLineMarker>(0);
24 LogLine() { this->_string.reserve(512); }
28 _string(s), _marker(m) {}
36 marker(LogLineMarker m) {
47 return this->_marker != LogLineMarker(0);
52 return this->_marker == LogLineMarker::Error;
61 matches(
const char* keyword)
const {
62 return this->_string.find(keyword) != std::string::npos;
67 this->_string.clear();
68 this->_marker = static_cast<LogLineMarker>(0);
78 typedef const T* const_pointer;
80 const_pointer first, last;
82 inline const_pointer begin()
const {
return first; }
83 inline const_pointer end()
const {
return last; }
84 inline size_t size()
const {
return last-first; }
100 static constexpr
const size_t max_lines = 500;
121 this->_mutex.unlock();
131 bool old = this->_dirty;
132 this->_dirty =
false;
146 #endif // vim:filetype=cpp