RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
rtcComponentArgs.hpp
Go to the documentation of this file.
1
11
12#ifndef RTCTK_COMPONENTFRAMEWORK_RTCCOMPONENTARGS_HPP
13#define RTCTK_COMPONENTFRAMEWORK_RTCCOMPONENTARGS_HPP
14
16
17#include <mal/Cii.hpp>
18
19#include <CLI/CLI.hpp>
20
21#include <filesystem>
22#include <optional>
23#include <string>
24
26
32class Args {
33public:
38 Args(int argc, char** argv);
39
45 const std::string& GetComponentName() const;
46
52 elt::mal::Uri GetServiceDiscEndpoint() const;
53
59 std::optional<std::filesystem::path> GetLogPropsFile() const;
60
66 bool GetDebugMode() const;
67
73 std::optional<elt::mal::Uri> GetModelExportFile() const;
74
79 void Parse();
80
89 int PrintHelpOrErrMsg(const CLI::Error& e) const;
90
91private:
92 int m_argc;
93 char** m_argv;
94
95 CLI::App m_cli_app;
96
97 std::string m_component_name;
98 elt::mal::Uri m_service_disc_endpoint{"consul://localhost:8500"};
99 std::filesystem::path m_log_props_file;
100 bool m_debug_mode = false;
101 elt::mal::Uri m_model_export_file;
102};
103
104} // namespace rtctk::componentFramework
105
106#endif // RTCTK_COMPONENTFRAMEWORK_RTCCOMPONENTARGS_HPP
bool GetDebugMode() const
Get debug mode.
Definition rtcComponentArgs.cpp:35
std::optional< std::filesystem::path > GetLogPropsFile() const
Get name of optionally provided log4cplus log properties file.
Definition rtcComponentArgs.cpp:27
std::optional< elt::mal::Uri > GetModelExportFile() const
Get name of optionally provided state machine model export file.
Definition rtcComponentArgs.cpp:39
void Parse()
do the actual parsing of CLI
Definition rtcComponentArgs.cpp:47
const std::string & GetComponentName() const
Get component name or identifier.
Definition rtcComponentArgs.cpp:19
Args(int argc, char **argv)
Constructor for Args class.
Definition rtcComponentArgs.cpp:16
elt::mal::Uri GetServiceDiscEndpoint() const
Get service discovery endpoint.
Definition rtcComponentArgs.cpp:23
int PrintHelpOrErrMsg(const CLI::Error &e) const
Print parsing help/version msg or error msg, and return 0 or 1.
Definition rtcComponentArgs.cpp:66
Provides macros and utilities for exception handling.
Definition commandReplier.cpp:21