VLink  2.0.0
A high-performance communication middleware
vcap_writer.h File Reference

Recorder that serialises VLink traffic into the MCAP container (.vcap / .vcapx). More...

#include <memory>
#include <string>
#include "./bag_writer.h"
Include dependency graph for vcap_writer.h:

Go to the source code of this file.

Classes

class  vlink::VCAPWriter
 Concrete MCAP-format BagWriter implementation with optional Zstd compression. More...
 

Namespaces

 

Detailed Description

Recorder that serialises VLink traffic into the MCAP container (.vcap / .vcapx).

VCAPWriter materialises a BagWriter that emits Foxglove-compatible MCAP files. It inherits the cross-format split-recording machinery from BagWriter and produces files that any MCAP-aware tool can replay. Compression flips between no-compression and Zstd when the build links libzstd; other selectors degrade to plain chunks.

File-format diagram
push_schema() --> schema record
push(frame) --> channel record (once per URL)
--> message chunk (Zstd optional)
on_end() --> attachments + summary section + footer (index of summary)
Writer states
+----------+ on_begin() +---------+ push()/push_schema() +-----------+
| closed | ------------> | opening | -----------------------> | recording |
+----------+ +---------+ +-----------+
^ |
| v split triggered
| +-------------+
| | rotating |
| | (new .vcap) |
| +-------------+
| |
+-------------------- on_end() / dtor --------------------- finalising
|
v
sealed
Example
auto writer = vlink::BagWriter::create("/data/recording.vcap");
writer->async_run();
writer->push_schema(my_schema);
frame.timestamp = -1; // < 0 => writer auto-assigns from its clock (0 is recorded verbatim)
frame.url = "dds://lidar/front";
frame.ser_type = "demo.proto.PointCloud";
frame.data = serialized_bytes;
writer->push(frame);
See also
BagWriter, VDBWriter