VLink  2.0.0
A high-performance communication middleware
vcap_writer.h 文件参考

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

#include <memory>
#include <string>
#include "./bag_writer.h"
vcap_writer.h 的引用(Include)关系图:

浏览源代码.

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

命名空间

 

详细描述

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);
参见
BagWriter, VDBWriter