acquisition: drive a DataSource from the registry; --source and --source-opt

This commit is contained in:
Martino Ferrari committed 2026-10-31 19:59:51 +01:00
1 parent 46076312cc
commit 504bc193ea
8 files changed
+156 -164

No files matched your search

+19
View File
@@ -6,6 +6,8 @@
#include <cstdint>
#include <string>
#include "source/source_config.hpp"
namespace udpscope {
/// Everything the command line can say. Defaults are the ones the spec names
@@ -21,6 +23,23 @@ struct Config {
/// `server` valid". The default stays a usable value for every other path.
bool server_specified = false;
/// `--source NAME`: which registered kind opens. `udps` is the default, and `--server/--port/
/// --multicast/--interface` keep meaning UDPS.
std::string source_kind = "udps";
/// Whether `--source` was given (the other half of "did the user choose a source").
bool source_specified = false;
/// Repeatable `--source-opt k=v`: the kind's own settings. For `udps` they overlay the fields above.
SourceConfig source_opts;
/// A source was named on the command line (`--server` or `--source`), so the chooser is skipped.
bool has_source() const noexcept { return server_specified || source_specified; }
/// The settings the kind's `make()` receives: for UDPS the four connection fields plus the receive
/// buffer, then `source_opts` on top.
SourceConfig source_config() const;
/// The (host, port) that name this source's session file; see `session_host()` in the registry.
std::string session_host() const;
std::uint16_t session_port() const;
/// Size of *each* of the two sample buffers, in megabytes. The application
/// always allocates two identical buffers (spec item 1).
double buffer_mb = 200.0;