Fix #1979, implement abstract config registry module #1980
Merged
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.
Describe the contribution
Adds a new module called "config" that tracks simple key/value pairs. All values are const.
As a proof of concept, all version information is mirrored into this key store, and ES is updated to use this instead
of the GLOBAL_CONFIGDATA when generating events.
Fixes #1979
Testing performed
Build and sanity check CFE, run all tests.
Expected behavior changes
Slightly different version display during startup (module names are ALL_CAPS, mainly). Otherwise pretty transparent.
System(s) tested on
Ubuntu
Additional context
This attempts to balance the advantages/disadvantages of having a string-based key/value store and an integer-based key/value store. In this implementation, the table is primarily indexed by an integer, which is assigned at compile time, so its fast (direct lookup from key to table entry). But the downside to this is that it creates a compile-time dependency on the assigned integer IDs. So, the keys also have string names associated with them, such that an app can find a key by name, to avoid having a hard compile-time dependency on a particular configuration item, such as if its an optional component.
This also has the side effect of improving branch/line coverage in ES where it was reading the "const" configdata objects. Due to the fact that configdata is declared "const", it means that coverage test can also only run with one copy. Therefore, it could not cover all the branches as a result.
Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.