118 const Bytes& data, int64_t* microseconds_timestamp =
nullptr,
bool immediate =
false)
override;
151 void open(
const std::string& path);
157 bool load_schema(
const std::string& ser_type,
SchemaType& schema_type,
SchemaData& schema_data);
159 bool write(
const std::string& url,
const std::string& ser_type,
SchemaType schema_type,
ActionType action_type,
160 const Bytes& data, int64_t microseconds_timestamp);
162 bool write_filex(
bool complete =
true);
164 std::unique_ptr<struct McapWriterImpl> impl_;
Abstract base class for VLink bag file recording with split, compression and global writer support.
BagWriter(const std::string &path, const Config &config={})
Constructs a BagWriter for path with the given config.
std::function< void(int split_index, const std::string &split_filename)> SplitCallback
Callback fired when a split occurs.
定义 bag_writer.h:154
std::function< SchemaData(const std::string &ser_type, SchemaType schema_type)> SchemaCallback
Callback that resolves a serialisation type string to a SchemaData.
定义 bag_writer.h:165
Versatile 128-byte byte buffer with SBO, five ownership modes and compression helpers.
定义 bytes.h:113
McapWriter(const std::string &path, const Config &config={})
Constructs an McapWriter for the given path.
bool push_schema(const SchemaData &schema_data, bool immediate=false) override
Embeds a SchemaData into the MCAP file for offline introspection.
void on_begin() override
Called from the loop thread just before the first task is processed.
int64_t push(const std::string &url, const std::string &ser_type, SchemaType schema_type, ActionType action_type, const Bytes &data, int64_t *microseconds_timestamp=nullptr, bool immediate=false) override
Records one message to the MCAP file.
void register_schema_callback(SchemaCallback &&callback) override
Registers a callback that resolves serialisation type strings to SchemaData.
size_t get_max_task_count() const override
Returns the maximum queue depth.
void on_end() override
Called from the loop thread just after the last task has been processed.
bool is_dumping() const override
Returns true if the writer is actively recording to disk.
bool is_split_mode() const override
Returns true if split-file mode is active.
void set_url_loss(const std::string &url, double loss) override
Sets the expected message loss ratio for a given URL.
void register_split_callback(SplitCallback &&callback, bool before) override
Registers a callback invoked when a file split occurs.
int get_split_index() const override
Returns the zero-based index of the current split file.
~McapWriter() override
Destructor – finalises the MCAP file footer and flushes all pending writes.
#define VLINK_EXPORT
定义 macros.h:85
#define VLINK_DISALLOW_COPY_AND_ASSIGN(classname)
Deletes the copy constructor and copy-assignment operator of classname.
定义 macros.h:184
SchemaType
Coarse runtime schema family used by discovery, bag metadata, and proxy routing.
定义 types.h:184
ActionType
Identifies the type of message action for recording purposes.
定义 types.h:162
Configuration for recording behaviour, splitting, compression, and limits.
定义 bag_writer.h:122
Carries one serialized schema blob for runtime registration or embedding.
定义 types.h:246