|
| | DatabaseReader (const std::string &path, bool read_only=true, bool try_to_fix=false) |
| | Constructs a DatabaseReader for the given path.
|
| | ~DatabaseReader () override |
| | Destructor – stops playback and closes the SQLite database handle.
|
| void | bind_plugin_interface (const std::shared_ptr< BagReaderPluginInterface > &plugin_interface) override |
| | Attaches a BagReaderPluginInterface for custom URL/type conversion.
|
| void | register_status_callback (StatusCallback &&status_callback) override |
| | Registers a callback fired whenever the playback status changes.
|
| void | register_ready_callback (ReadyCallback &&ready_callback) override |
| | Registers a callback fired when the reader is ready to start playing.
|
| void | register_finish_callback (FinishCallback &&finish_callback) override |
| | Registers a callback fired when playback ends or is interrupted.
|
| void | register_output_callback (OutputCallback &&output_callback) override |
| | Registers the callback that receives replayed messages.
|
| void | play (const Config &config) override |
| | Starts playback with the given configuration.
|
| void | stop () override |
| | Stops playback and resets the reader to the beginning.
|
| void | pause () override |
| | Pauses playback at the current position.
|
| void | resume () override |
| | Resumes a paused playback from the current position.
|
| void | pause_to_next () override |
| | Advances one message while paused, then pauses again.
|
| void | jump (int64_t begin_time, double rate, int times, bool force_to_play=false) override |
| | Seeks to begin_time and resumes playback.
|
| std::future< bool > | check () override |
| | Verifies the integrity of the SQLite bag file asynchronously.
|
| std::future< bool > | reindex () override |
| | Rebuilds the index tables asynchronously.
|
| std::future< bool > | fix (bool rebuild=false) override |
| | Repairs a corrupt SQLite bag file asynchronously.
|
| void | tag (const std::string &tag_name) override |
| | Updates the tag name stored in the bag metadata.
|
| int64_t | get_timestamp () const override |
| | Returns the current playback position as a recording-relative timestamp.
|
| int64_t | get_real_timestamp () const override |
| | Returns the real elapsed wall-clock time since playback started.
|
| Status | get_status () const override |
| | Returns the current playback status.
|
| const Info & | get_info () const override |
| | Returns the bag file metadata and per-URL statistics.
|
| std::vector< SchemaData > | detect_schema () override |
| | Scans the SQLite bag and returns all embedded schemas.
|
| std::string | get_ser_type (const std::string &url) const override |
| | Returns the serialisation type string for a given URL.
|
| SchemaType | get_schema_type (const std::string &url) const override |
| | Returns the coarse schema family for a given URL.
|
| bool | is_split_mode () const override |
| | Returns true if the bag spans multiple split files.
|
| int | get_split_index () const override |
| | Returns the zero-based index of the current split file being read.
|
| bool | is_jumping () const override |
| | Returns true if a jump-to-timestamp seek is currently in progress.
|
| | BagReader (const std::string &path, bool read_only=true, bool try_to_fix=false) |
| | Constructs the reader for path.
|
| virtual | ~BagReader () |
| | Destructor – stops playback and releases file resources.
|
| | MessageLoop () |
| | Constructs a MessageLoop with kNormalType queue.
|
| | MessageLoop (Type type) |
| | Constructs a MessageLoop with the specified queue type.
|
| virtual | ~MessageLoop () |
| | Destructor. Calls quit(true) and waits for the background thread (if any).
|
| void | set_name (const std::string &name) |
| | Sets a human-readable name for this loop (visible in profiling tools).
|
| const std::string & | get_name () const |
| | Returns the name set via set_name().
|
| Type | get_type () const |
| | Returns the queue type this loop was constructed with.
|
| Strategy | get_strategy () const |
| | Returns the current idle dispatch strategy.
|
| void | set_strategy (Strategy strategy) |
| | Changes the idle dispatch strategy.
|
| void | register_begin_handler (Callback &&callback) |
| | Registers a callback invoked once when the loop thread starts.
|
| void | register_end_handler (Callback &&callback) |
| | Registers a callback invoked once when the loop thread exits.
|
| void | register_idle_handler (Callback &&callback) |
| | Registers a callback invoked each time the task queue becomes empty.
|
| bool | run () |
| | Runs the message loop on the calling thread (blocking).
|
| bool | async_run () |
| | Starts the message loop on a new background thread (non-blocking).
|
| bool | spin () |
| | Runs the loop continuously in a spin mode (blocking; no background thread).
|
| bool | spin_once (bool block=true) |
| | Processes one batch of pending tasks and timers.
|
| bool | quit (bool force=false) |
| | Requests the loop to exit cleanly.
|
| bool | wait_for_idle (int ms=Timer::kInfinite, bool check=true) |
| | Waits until the task queue is drained.
|
| bool | wait_for_quit (int ms=Timer::kInfinite, bool check=true) |
| | Waits until the loop has fully exited (after quit() was called).
|
| bool | post_task (Callback &&callback) |
| | Posts a task to the queue for execution on the loop thread.
|
| bool | post_task_with_priority (Callback &&callback, uint16_t priority) |
| | Posts a task with an explicit priority (requires kPriorityType loop).
|
| template<typename CallbackT, typename = std::enable_if_t<!std::is_convertible_v<CallbackT, Schedule::RetCallback>>> |
| Schedule::Status | exec_task (const Schedule::Config &config, CallbackT &&callback) |
| | Posts a scheduled task and returns a Schedule::Status for chaining callbacks.
|
| template<typename CallbackT, typename = std::enable_if_t<std::is_convertible_v<CallbackT, Schedule::RetCallback>>> |
| Schedule::RetStatus | exec_task (const Schedule::Config &config, CallbackT &&callback) |
| | Posts a scheduled task and returns a Schedule::RetStatus for chaining callbacks.
|
| bool | wakeup () |
| | Wakes the loop thread if it is sleeping (e.g., in kBlockStrategy).
|
| void | reset_lockfree_capacity () |
| | Resets the lock-free queue to its initial capacity.
|
| bool | is_running () const |
| | Returns true if the loop is currently running (started and not quit).
|
| bool | is_ready_to_quit () const |
| | Returns true if quit() has been called and the loop is winding down.
|
| bool | is_busy () const |
| | Returns true if the loop is currently executing a task.
|
| size_t | get_task_count () const |
| | Returns the number of tasks currently in the queue.
|
| virtual size_t | get_max_timer_count () const |
| | Returns the maximum number of timers that can be attached to this loop.
|
| virtual uint32_t | get_max_elapsed_time () const |
| | Returns the maximum allowed task execution time in milliseconds.
|
| virtual bool | is_in_same_thread () const |
| | Returns true if the calling thread is the same as the loop thread.
|
| template<class FunctionT, class... ArgsT, typename ResultT = std::invoke_result_t<FunctionT, ArgsT...>> |
| std::future< ResultT > | invoke_task (FunctionT &&function, ArgsT &&... args) |
| | Dispatches a callable to the loop thread and returns a std::future for the result.
|
| template<class FunctionT, class... ArgsT, typename ResultT = std::invoke_result_t<FunctionT, ArgsT...>> |
| std::future< ResultT > | invoke_task_with_priority (FunctionT &&function, uint16_t priority, ArgsT &&... args) |
| | Dispatches a callable with an explicit priority and returns a std::future.
|
|
| enum | Status : uint8_t { kStoped = 0
, kPaused = 1
, kPlaying = 2
} |
| | Playback state of the reader. More...
|
| using | OutputCallback |
| | Callback type fired for each replayed message.
|
| using | StatusCallback = std::function<void(Status status)> |
| | Callback fired whenever the playback Status changes.
|
| using | ReadyCallback = std::function<void()> |
| | Callback fired when the reader has opened the file and is ready to start playing.
|
| using | FinishCallback = std::function<void(bool is_interrupted)> |
| | Callback fired when playback has finished (or was interrupted).
|
| enum | Type : uint8_t { kNormalType = 0
, kLockfreeType = 1
, kPriorityType = 2
} |
| | Queue implementation type. More...
|
| enum | Strategy : uint8_t { kOptimizationStrategy = 0
, kPopStrategy = 1
, kBlockStrategy = 2
} |
| | Idle strategy controlling CPU and latency trade-offs. More...
|
| enum | Priority : uint16_t {
kNoPriority = 0
, kLowestPriority = 1
, kTimerPriority = 50
, kNormalPriority = 100
,
kHighestPriority = std::numeric_limits<uint16_t>::max()
} |
| | Pre-defined task priority levels for kPriorityType loops. More...
|
| using | Callback = std::function<void()> |
| | Callback type for tasks and event handlers.
|
| static std::shared_ptr< BagReader > | create (const std::string &path, bool read_only=true, bool try_to_fix=false) |
| | Creates a concrete BagReader for path, selecting the implementation by extension.
|
| static constexpr int | kInfinite {-1} |
| | Sentinel value for the Config::times field to indicate endless loop playback.
|
| static void | rebuild_url_meta_maps (const std::vector< Info::UrlMeta > &url_metas, std::unordered_map< std::string, std::string > &ser_map, std::unordered_map< std::string, SchemaType > &schema_type_map) |
| | Rebuilds URL metadata lookup maps after plugin remapping.
|
| static ActionType | convert_action (std::string_view str) |
Concrete SQLite-backed bag file player.
All virtual methods from BagReader are implemented. Prefer using BagReader::create() for format-agnostic construction.