86 std::function<
void(std::span<const uint8_t> data)>
write,
103 std::function<
void(std::span<const uint8_t> data)>
write,
145 struct WriterThreadState;
147 void BufferHalfFull() final;
148 bool BufferFull() final;
150 void StartLogFile(WriterThreadState&
state);
152 void WriterThreadMain(
153 std::function<
void(
std::span<const uint8_t> data)>
write);
157 bool m_doFlush{
false};
158 bool m_shutdown{
false};
166 std::string m_newFilename;
167 std::thread m_thread;
A data log background writer that periodically flushes the data log on a background thread.
Definition: DataLogBackgroundWriter.h:38
DataLogBackgroundWriter(std::string_view dir="", std::string_view filename="", double period=0.25, std::string_view extraHeader="")
Construct a new Data Log.
void Flush() final
Explicitly flushes the log data to disk.
void Resume() final
Resumes appending of data records to the log.
DataLogBackgroundWriter(std::function< void(std::span< const uint8_t > data)> write, double period=0.25, std::string_view extraHeader="")
Construct a new Data Log that passes its output to the provided function rather than a file.
void Pause() final
Pauses appending of data records to the log.
void Stop() final
Stops appending all records to the log, and closes the log file.
DataLogBackgroundWriter(wpi::Logger &msglog, std::string_view dir="", std::string_view filename="", double period=0.25, std::string_view extraHeader="")
Construct a new Data Log.
DataLogBackgroundWriter(wpi::Logger &msglog, std::function< void(std::span< const uint8_t > data)> write, double period=0.25, std::string_view extraHeader="")
Construct a new Data Log that passes its output to the provided function rather than a file.
~DataLogBackgroundWriter() final
void SetFilename(std::string_view filename)
Change log filename.
A data log for high-speed writing of data values.
Definition: DataLog.h:68
auto write(OutputIt out, const std::tm &time, const std::locale &loc, char format, char modifier=0) -> OutputIt
Definition: chrono.h:449
state
Definition: base.h:2361
Implement std::hash so that hash_code can be used in STL containers.
Definition: array.h:89
Definition: ntcore_cpp.h:31
Definition: ntcore_cpp.h:26
::std::condition_variable condition_variable
Definition: condition_variable.h:16
::std::mutex mutex
Definition: mutex.h:17
basic_string_view< char > string_view
Definition: base.h:601