-
Notifications
You must be signed in to change notification settings - Fork 236
Description
Is your feature request related to a problem? Please describe.
Rather than compiling-in various values (e.g. via cfe_platform_cfg.h or cfe_mission_cfg.h) it would be more flexible and more useful to put many of these configuration items into some type of simple runtime registry.
The registry would be a simple key/value store, where the key is the configurable item ID, and the value is either an integer or a pointer to a global data object (ideally const, to avoid sharing/concurrent access issues).
The registry can be somewhat dynamic, allowing registry items to be easily added/extended. Default values and text-based descriptions can also be potentially included.
Describe the solution you'd like
User API that works something like:
uint32 CFE_ES_RegistryGetInt(uint32 Key);const void* CFE_ES_RegistryGetPointer(uint32 Key);
Additional context
This would reduce dependency on cfe_platform_cfg.h and cfe_mission_cfg.h for keeping this type of value, and also provide a place for the version info currently in cfe_version.h. Thereby consolidating the current bunch of different types of info with different access methods into one generic registry with a common, simple access method.
Similar model exists in UNIX/POSIX in the sysconf facility - so certain platform-specific values do not need to be compiled into binaries, thereby improving binary portability (i.e. compile once for a CPU arch, run anywhere that has that arch). This would make the long-desired feature of separate CFE core and app builds closer to reality.
Of course Windows has its well-known registry, which is huge and unwieldy - this should not turn into that. More like UNIX sysconf, but with pointers/strings also supported, not just integers.
Other issues with #define-ed config values:
- Value is effectively compiled-into the binary, so if the value ever changes, modular binaries become incompatible (but this is not actively detected - its a subtle, silent incompatibility).
- Works OK for integers, but not as well for strings, even less well for structured data
- Requires that the
cfe_mission_cfg.h/cfe_platform_cfg.hbe kept in sync with the source code. New variables added in new builds must be manually propagated to the user build.
Requester Info
Joseph Hickey, Vantage Systems, Inc.