Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Asynchronous CSV dumper. Writes entries to CSV file from background thread. Recommended to be used from a single thread. More...
#include <csv_dumper.h>
Public Member Functions | |
CsvDumper (const char *path, const CsvConfig &config, IArena &arena) | |
Open file. path - output file. max_interval - maximum number of writes per second for each entry type. More... | |
~CsvDumper () | |
Close file. More... | |
bool | is_valid () const |
Check if opened without errors. More... | |
bool | would_write (char type) |
Check whether write() would enqueue or drop entry. Lock-free operation. More... | |
void | write (const CsvEntry &entry) |
Enqueue entry for writing. Makes a copy of entry and pushes it to a lock-free ring buffer. If buffer size limit or rate limit is exceeded, entry is dropped. Lock-free operation. More... | |
void | stop () |
Stop background thread. More... | |
Public Member Functions inherited from roc::core::Thread | |
bool | is_joinable () const |
Check if thread was started and can be joined. More... | |
ROC_ATTR_NODISCARD bool | start () |
Start thread. More... | |
void | join () |
Join thread. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from roc::core::Thread | |
static uint64_t | get_pid () |
Get numeric identifier of current process. More... | |
static uint64_t | get_tid () |
Get numeric identifier of current thread. More... | |
static ROC_ATTR_NODISCARD bool | enable_realtime () |
Raise current thread priority to realtime. More... | |
Asynchronous CSV dumper. Writes entries to CSV file from background thread. Recommended to be used from a single thread.
Definition at line 64 of file csv_dumper.h.
Open file. path
- output file. max_interval
- maximum number of writes per second for each entry type.
roc::core::CsvDumper::~CsvDumper | ( | ) |
Close file.
bool roc::core::CsvDumper::is_valid | ( | ) | const |
Check if opened without errors.
void roc::core::CsvDumper::stop | ( | ) |
Stop background thread.
bool roc::core::CsvDumper::would_write | ( | char | type | ) |
Check whether write() would enqueue or drop entry. Lock-free operation.
void roc::core::CsvDumper::write | ( | const CsvEntry & | entry | ) |
Enqueue entry for writing. Makes a copy of entry and pushes it to a lock-free ring buffer. If buffer size limit or rate limit is exceeded, entry is dropped. Lock-free operation.