Merge cdc_stream into asset_stream_manager (#26)

Adds start and stop commands to asset_stream_manager.
asset_stream_manager will be renamed to cdc_stream next.
This commit is contained in:
Lutz Justen
2022-12-01 12:40:00 +01:00
committed by GitHub
parent 876e59409f
commit f0539226a2
23 changed files with 507 additions and 281 deletions
+3 -13
View File
@@ -31,6 +31,8 @@ class command;
namespace cdc_ft {
class BaseCommand;
// Class containing all configuration settings for asset streaming.
// Reads flags from the command line and optionally applies overrides from
// a json file.
@@ -41,7 +43,7 @@ class AssetStreamConfig {
~AssetStreamConfig();
// Registers arguments with Lyra.
void RegisterCommandLineFlags(lyra::command& cmd);
void RegisterCommandLineFlags(lyra::command& cmd, BaseCommand& base_command);
// Loads a configuration from the JSON file at |path| and overrides any config
// values that are set in this file. Sample json file:
@@ -88,16 +90,7 @@ class AssetStreamConfig {
// Whether to log to a file or to stdout.
bool log_to_stdout() const { return log_to_stdout_; }
// Workaround for Lyra not accepting errors from parsers.
const std::string& jedec_parse_error() const { return jedec_parse_error_; }
private:
// Jedec parser for Lyra options. Usage:
// lyra::opt(JedecParser("size-flag", &size_bytes), "bytes"))
// Sets jedec_parse_error_ on error, Lyra doesn't support errors from lambdas.
std::function<void(const std::string&)> JedecParser(const char* flag_name,
uint64_t* bytes);
SessionConfig session_cfg_;
bool log_to_stdout_ = false;
@@ -111,9 +104,6 @@ class AssetStreamConfig {
// Maps flags to errors occurred while reading this flag.
std::map<std::string, std::string> flag_read_errors_;
// Errors from parsing JEDEC sizes.
std::string jedec_parse_error_;
};
}; // namespace cdc_ft