-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[config] Implementation of new configuration management #1505
[config] Implementation of new configuration management #1505
Conversation
…tructor. Some renaming.
…ubscriber config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
Configuration::Configuration() : | ||
share_topic_type(eCAL::Config::IsTopicTypeSharingEnabled()), | ||
share_topic_description(eCAL::Config::IsTopicDescriptionSharingEnabled()) | ||
Configuration::Configuration() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: tcp, share_topic_type, share_topic_description [cppcoreguidelines-pro-type-member-init]
ecal/core/include/ecal/config/ecal_publisher_config.h:137:
- TCP::Configuration tcp;
+ TCP::Configuration tcp{};
ecal/core/include/ecal/config/ecal_publisher_config.h:139:
- bool share_topic_type; //!< share topic type via registration
- bool share_topic_description; //!< share topic description via registration
+ bool share_topic_type{}; //!< share topic type via registration
+ bool share_topic_description{}; //!< share topic description via registration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
Configuration::Configuration() : | ||
share_topic_type(eCAL::Config::IsTopicTypeSharingEnabled()), | ||
share_topic_description(eCAL::Config::IsTopicDescriptionSharingEnabled()) | ||
Configuration::Configuration() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: tcp, share_topic_type, share_topic_description [cppcoreguidelines-pro-type-member-init]
ecal/core/include/ecal/config/publisher.h:137:
- TCP::Configuration tcp;
+ TCP::Configuration tcp{};
ecal/core/include/ecal/config/publisher.h:139:
- bool share_topic_type; //!< share topic type via registration
- bool share_topic_description; //!< share topic description via registration
+ bool share_topic_type{}; //!< share topic type via registration
+ bool share_topic_description{}; //!< share topic description via registration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
std::string ecal_ini_file_path{}; | ||
|
||
private: | ||
ECAL_API void Init(std::vector<std::string>& args_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'eCAL::Configuration::Init' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]
ECAL_API void Init(std::vector<std::string>& args_);
^
Additional context
ecal/core/src/config/ecal_config_initializer.cpp:238: the definition seen here
void Configuration::Init(std::vector<std::string>& arguments_)
^
ecal/core/include/ecal/config/configuration.h:77: differing parameters are named here: ('args_'), in definition: ('arguments_')
ECAL_API void Init(std::vector<std::string>& args_);
^
|
||
eCAL::Config::CmdParser parser; | ||
|
||
std::vector<std::string> arguments; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'arguments' is not initialized [cppcoreguidelines-init-variables]
std::vector<std::string> arguments; | |
std::vector<std::string> arguments = 0; |
{ | ||
eCAL::Config::CmdParser parser; | ||
|
||
std::vector<std::string> arguments; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'arguments' is not initialized [cppcoreguidelines-init-variables]
std::vector<std::string> arguments; | |
std::vector<std::string> arguments = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed together with @Peguen. Further restructuring of configuration object is needed but can be handled in a subsequent PR.
Description
Introduced config management via structs which opens the possibilty for users to configure eCAL in code. In addition, evaluation of the inputs will be easily possible.
If assigned configuration values can be evaluated and are incorrect, the program will exit with an error.
Internally also the new config structs will be used.