138 #include "../base/plugin.h"
139 #include "../impl/types.h"
303 virtual void flush();
Abstract plugin base shared by bag playback and bag recording.
Definition: bag_plugin_interface.h:154
void bind_direction(Direction direction)
Records the binding direction so the plugin can branch on read vs write.
Definition: bag_plugin_interface.h:330
virtual void on_reset()
Discards state retained from an earlier read-side playback session.
Definition: bag_plugin_interface.h:345
Direction get_direction() const
Returns the side this plugin is currently bound to.
Definition: bag_plugin_interface.h:332
virtual bool convert_url_meta(std::string &url, std::string &ser_type, SchemaType &schema_type)
Rewrites or filters a stored URL before playback begins (read side).
Definition: bag_plugin_interface.h:336
virtual void flush()
Drains any internally-buffered frames downstream before the host unbinds and tears down.
Definition: bag_plugin_interface.h:347
virtual void on_write(const Frame &frame)=0
Intercepts a frame before it is persisted (write side).
virtual ~BagPluginInterface()=default
BagPluginInterface()=default
void do_callback(const Frame &frame)
Forwards one frame downstream through the registered sink.
Definition: bag_plugin_interface.h:349
FrameCallback Callback
Forwarding sink used by do_callback() to re-emit a frame downstream.
Definition: bag_plugin_interface.h:179
void register_callback(Callback &&callback)
Stores the forwarding sink used by do_callback().
Definition: bag_plugin_interface.h:334
virtual void on_read(const Frame &frame)=0
Intercepts a replayed frame on its way to the user (read side).
Direction
Identifies whether the plugin is bound to a reader or a writer.
Definition: bag_plugin_interface.h:166
@ kWrite
Bound to a BagWriter; the plugin forwards frames before they are persisted.
Definition: bag_plugin_interface.h:168
@ kRead
Bound to a BagReader; the plugin forwards replayed frames.
Definition: bag_plugin_interface.h:167
Direction direction_
Definition: bag_plugin_interface.h:318
Move-only type-erased callable analogue of std::move_only_function with pool spill.
Definition: functional.h:135
#define VLINK_DISALLOW_COPY_AND_ASSIGN(classname)
Deletes the copy constructor and copy-assignment operator of classname.
Definition: macros.h:174
SchemaType
Coarse runtime schema family used by discovery, bag metadata and proxy routing.
Definition: types.h:203
MoveFunction< void(const Frame &)> FrameCallback
Frame sink reused by every bag frame interface.
Definition: types.h:243
#define VLINK_PLUGIN_REGISTER(InterfaceType)
Declares a plugin's identity from the demangled name of its abstract interface.
Definition: plugin.h:347
One recorded or replayed message as it flows through the bag pipeline.
Definition: types.h:226