|
EnigmaMachineCore 0.1.0
A modular Enigma Machine simulation in C++20
|
Accepted
The Enigma Machine Core is designed to be universal, supporting platforms from high-end Linux systems to low-end bare-metal microcontrollers and WebAssembly (WASM). Loading configuration files (TOML) directly from the filesystem (std::ifstream) creates a hard dependency on an OS-level filesystem, which is absent in many of our target environments (e.g., WASM, Zephyr RTOS).
We will decouple the Enigma Engine from the physical filesystem by introducing the IAssetProvider interface.
IAssetProvider defines a single loadAsset(assetName) method that returns a std::string containing the asset's content.EnigmaMachine and its components will not perform file I/O. Instead, they will receive an IAssetProvider (Dependency Injection) and use it to retrieve configuration data.FileAssetProvider: For platforms with a filesystem (CLI, Desktop).MemoryAssetProvider (Planned): For platforms like WASM or Embedded where assets are pre-loaded or linked into the binary.