RTC Toolkit 5.0.0
Loading...
Searching...
No Matches
rtcComponentArgs.hpp
Go to the documentation of this file.
1
13#ifndef RTCTK_COMPONENTFRAMEWORK_RTCCOMPONENTARGS_HPP
14#define RTCTK_COMPONENTFRAMEWORK_RTCCOMPONENTARGS_HPP
15
17
18#include <mal/Cii.hpp>
19
20#include <CLI/CLI.hpp>
21
22#include <filesystem>
23#include <optional>
24#include <string>
25
27
33class Args {
34public:
39 Args(int argc, char** argv);
40
46 std::string GetComponentName() const;
47
53 elt::mal::Uri GetServiceDiscEndpoint() const;
54
60 std::optional<std::filesystem::path> GetLogPropsFile() const;
61
67 bool GetDebugMode() const;
68
74 std::optional<elt::mal::Uri> GetModelExportFile() const;
75
80 void Parse();
81
90 int PrintHelpOrErrMsg(const CLI::Error& e) const;
91
92private:
93 int m_argc;
94 char** m_argv;
95
96 CLI::App m_cli_app;
97
98 std::string m_component_name;
99 elt::mal::Uri m_service_disc_endpoint{"consul://localhost:8500"};
100 std::filesystem::path m_log_props_file;
101 bool m_debug_mode = false;
102 elt::mal::Uri m_model_export_file;
103};
104
105} // namespace rtctk::componentFramework
106
107#endif // RTCTK_COMPONENTFRAMEWORK_RTCCOMPONENTARGS_HPP
Class used to parse default command line arguments.
Definition rtcComponentArgs.hpp:33
bool GetDebugMode() const
Get debug mode.
Definition rtcComponentArgs.cpp:36
std::optional< std::filesystem::path > GetLogPropsFile() const
Get name of optionally provided log4cplus log properties file.
Definition rtcComponentArgs.cpp:28
std::optional< elt::mal::Uri > GetModelExportFile() const
Get name of optionally provided state machine model export file.
Definition rtcComponentArgs.cpp:40
void Parse()
do the actual parsing of CLI
Definition rtcComponentArgs.cpp:48
std::string GetComponentName() const
Get component name or identifier.
Definition rtcComponentArgs.cpp:20
Args(int argc, char **argv)
Constructor for Args class.
Definition rtcComponentArgs.cpp:17
elt::mal::Uri GetServiceDiscEndpoint() const
Get service discovery endpoint.
Definition rtcComponentArgs.cpp:24
int PrintHelpOrErrMsg(const CLI::Error &e) const
Print parsing help/version msg or error msg, and return 0 or 1.
Definition rtcComponentArgs.cpp:67
Provides macros and utilities for exception handling.
Definition commandReplier.cpp:22
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:23