Restructure access to members of Configuration - #868
Draft
SebSparrowHawk wants to merge 9 commits into
Draft
Conversation
| void InitializeRuntime(const std::int32_t argc, score::StringLiteral argv[]) | ||
| // NOLINTNEXTLINE(modernize-avoid-c-arrays):C-style array tolerated for command line arguments. This API is deprecated | ||
| // and it will be removed. | ||
| void InitializeRuntime(const std::int32_t argc, const char* argv[]) |
Contributor
Author
There was a problem hiding this comment.
Change was actually not part of this PR, fixed with rebase
| std::vector<safecpp::zstring_view> command_line_arguments{}; | ||
| for (std::int32_t arg_idx = 0U; arg_idx < argc; arg_idx++) | ||
| { | ||
| auto argument = std::string_view{argv[arg_idx]}; |
Contributor
Author
There was a problem hiding this comment.
Change was actually not part of this PR, fixed with rebase
| for (std::int32_t arg_idx = 0U; arg_idx < argc; arg_idx++) | ||
| { | ||
| auto argument = std::string_view{argv[arg_idx]}; | ||
| command_line_arguments.push_back(safecpp::zstring_view{argument.data(), argument.size()}); |
Contributor
Author
There was a problem hiding this comment.
Change was actually not part of this PR, fixed with rebase
Moved external validation functions inside Configuration so that following object-oriented design a Configuration can call its own validation methods. This is a preparation step for our goal to limit access to the Configuration's data elements.
Public API has been added to Configuration to check if it contains any LoLa services. Adapted BindingRuntimeFactory so that it will use this method instead of iterating over all services types to check if LoLa services are defined.
Public API has been added to Configuration to get names of ServiceIdentifierTypes of all configured services. Adapted TracingFilterConfigParser to use this method instead of accessing list of service types and calculating service names this way.
Public API has been added to Configuration to get names of all service elements of a specific type for a specific service. During tracing config parsing this method will be called instead of the free floating function.
Public API has been added to Configuration to get information of all allowed users of all service instances for a specific ASIL level. This functionality has previously been implemented in impl/runtime.cpp, which will now call this method instead.
Public API has been added to query service instance identifiers for a given service type. TracingFilterConfigParser has been adapted to call this method instead of having its own implementation of this functionality.
…ethods Users of Configuration shall not have direct access to the map of service type deployments and service instance deployments. Instead the newly added methods shall be used to find the necessary information and entities. This will allow us in a later step to update existing configurations because access can be controlled this way.
Avoid concurrent access to the underlying maps using std::mutex.
Based on recent refactorings.
SebSparrowHawk
force-pushed
the
ssp_configuration_update
branch
from
August 7, 2026 07:33
b3a4153 to
0a4322b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently a Configuration provides direct access to its member variables (of type std::unordered_map) for service types and service instances.
With this PR the access to these members would be limited, but on the other side the public API of Configuration has been extended so that the necessary information can be retrieved directly and the Configuration can validate itself. (Consumers of a configuration can now call these methods directly, instead of accessing the underlying data and extracting the relevant information. )
With this stricter encapsulation we want to gain the possibility to update configurations after they have been initially loaded.