8#include <unordered_map>
11#include "gsl/pointers"
63 gsl::not_null<TextFormatter *> format, std::vector<std::unique_ptr<ConfigProvider>> &&providers)
64 : format_{format}, providers_{std::move(providers)}
81 providers_{std::move(providers)}
97 void add_provider(std::unique_ptr<ConfigProvider> provider)
override;
233 [[nodiscard]] std::vector<ProvenanceChainLink<std::size_t>>
248 [[nodiscard]] std::vector<ProvenanceChainLink<std::size_t>>
263 [[nodiscard]] std::vector<ProvenanceChainLink<std::size_t>>
278 [[nodiscard]] std::vector<ProvenanceChainLink<std::size_t>>
293 [[nodiscard]] std::vector<ProvenanceChainLink<std::size_t>>
308 [[nodiscard]] std::vector<ProvenanceChainLink<std::size_t>>
323 [[nodiscard]] std::vector<ProvenanceChainLink<std::size_t>>
338 [[nodiscard]] std::vector<ProvenanceChainLink<std::size_t>>
353 [[nodiscard]] std::vector<ProvenanceChainLink<Rgba32>>
368 [[nodiscard]] std::vector<ProvenanceChainLink<ArtifactEditMode>>
383 [[nodiscard]] std::vector<ProvenanceChainLink<ArtifactEditMode>>
398 [[nodiscard]] std::vector<ProvenanceChainLink<bool>>
413 [[nodiscard]] std::vector<ProvenanceChainLink<std::vector<PaletteHint>>>
428 [[nodiscard]] std::vector<ProvenanceChainLink<PackingStrategyType>>
443 [[nodiscard]] std::vector<ProvenanceChainLink<PackingStrategyParams>>
458 [[nodiscard]] std::vector<ProvenanceChainLink<TileSharingPacking>>
473 [[nodiscard]] std::vector<ProvenanceChainLink<TileSharingAlignment>>
488 [[nodiscard]] std::vector<ProvenanceChainLink<TilesPalMode>>
503 [[nodiscard]] std::vector<ProvenanceChainLink<AnimPalResolutionStrategy>>
518 [[nodiscard]] std::vector<ProvenanceChainLink<AnimKeyFrameResolutionStrategy>>
533 [[nodiscard]] std::vector<ProvenanceChainLink<AnimMultiPalSubtileResolutionStrategy>>
548 [[nodiscard]] std::vector<ProvenanceChainLink<FrameLinking>>
563 [[nodiscard]] std::vector<ProvenanceChainLink<PerAnimOverrides>>
578 [[nodiscard]] std::vector<ProvenanceChainLink<bool>>
593 [[nodiscard]] std::vector<ProvenanceChainLink<bool>>
608 [[nodiscard]] std::vector<ProvenanceChainLink<PrimaryPairingMode>>
623 [[nodiscard]] std::vector<ProvenanceChainLink<std::vector<std::string>>>
638 [[nodiscard]] std::vector<ProvenanceChainLink<std::vector<std::string>>>
653 [[nodiscard]] std::vector<ProvenanceChainLink<std::vector<std::string>>>
668 [[nodiscard]] std::vector<ProvenanceChainLink<std::vector<std::string>>>
683 [[nodiscard]] std::vector<ProvenanceChainLink<std::vector<std::string>>>
698 [[nodiscard]] std::vector<ProvenanceChainLink<std::string>>
713 [[nodiscard]] std::vector<ProvenanceChainLink<std::string>>
728 [[nodiscard]] std::vector<ProvenanceChainLink<std::string>>
743 [[nodiscard]] std::vector<ProvenanceChainLink<std::string>>
758 [[nodiscard]] std::vector<ProvenanceChainLink<std::size_t>>
773 [[nodiscard]] std::vector<ProvenanceChainLink<bool>>
791 std::unique_ptr<TextFormatter> owned_format_;
794 std::vector<std::unique_ptr<ConfigProvider>> providers_;
797 mutable std::map<std::string, std::any> cache_;
799 mutable std::unordered_map<std::string, std::string> cache_value_strings_;
802 mutable std::unordered_map<std::string, std::string> source_key_;
805 mutable std::unordered_map<std::string, std::string> source_;
806 mutable std::unordered_map<std::string, std::vector<std::string>> source_details_;
817 template <
typename T>
819 const std::string &cache_key,
820 const std::string &canonical_name,
835 template <
typename T>
836 std::vector<ProvenanceChainLink<T>>
Interface that defines a complete app layer configuration.
A result type that maintains a chainable sequence of errors for debugging and error reporting.
An interface which config implementations can use to load config values.
Interface that defines a complete domain layer configuration.
Interface that defines a complete infra layer configuration.
A Config implementation that lazily pulls a config value by consulting multiple priority-ordered back...
ChainableResult< ConfigValue< std::vector< std::string > > > diagnostic_warnings_exclude_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< std::string > > tileset_paths_primary_src_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tileset_paths_primary_src.
std::vector< ProvenanceChainLink< bool > > pal_hints_enabled_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for pal_hints_enabled.
std::vector< ProvenanceChainLink< bool > > tileset_animations_wire_anim_code_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tileset_animations_wire_anim_code.
ChainableResult< ConfigValue< ArtifactEditMode > > pals_edit_mode_raw(ConfigScopeType type, const std::string &scope) const override
LazyLayeredConfig(std::vector< std::unique_ptr< ConfigProvider > > &&providers)
Constructs a LazyLayeredConfig with a default PlainTextFormatter.
ChainableResult< ConfigValue< std::string > > tileset_paths_primary_bin_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< bool > > verify_checksums_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for verify_checksums.
std::vector< ProvenanceChainLink< FrameLinking > > global_frame_linking_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for global_frame_linking.
std::vector< ProvenanceChainLink< std::vector< std::string > > > diagnostic_remarks_exclude_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for diagnostic_remarks_exclude.
ChainableResult< ConfigValue< std::size_t > > num_metatiles_total_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< std::vector< std::string > > > primary_pairing_partners_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for primary_pairing_partners.
std::vector< ProvenanceChainLink< std::size_t > > max_map_data_size_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for max_map_data_size.
ChainableResult< ConfigValue< AnimMultiPalSubtileResolutionStrategy > > global_anim_multi_pal_subtile_resolution_strategy_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< FrameLinking > > global_frame_linking_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::size_t > > num_tiles_total_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::size_t > > num_pals_in_primary_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::vector< PaletteHint > > > pal_hints_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::size_t > > num_pals_total_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::string > > tileset_paths_secondary_bin_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< TileSharingPacking > > tile_sharing_packing_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tile_sharing_packing.
ChainableResult< ConfigValue< PerAnimOverrides > > per_anim_overrides_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< PackingStrategyParams > > packing_strategy_params_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< Rgba32 > > extrinsic_transparency_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::vector< std::string > > > diagnostic_remarks_include_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< std::vector< std::string > > > diagnostic_warnings_exclude_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for diagnostic_warnings_exclude.
ChainableResult< ConfigValue< bool > > cross_tileset_anim_linking_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< Rgba32 > > extrinsic_transparency_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for extrinsic_transparency.
std::vector< ProvenanceChainLink< std::size_t > > num_metatiles_in_primary_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_metatiles_in_primary.
ChainableResult< ConfigValue< std::size_t > > num_metatiles_in_primary_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< AnimMultiPalSubtileResolutionStrategy > > global_anim_multi_pal_subtile_resolution_strategy_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for global_anim_multi_pal_subtile_resolution_strategy.
std::vector< ProvenanceChainLink< std::size_t > > num_tiles_in_primary_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_tiles_in_primary.
std::vector< ProvenanceChainLink< std::vector< std::string > > > diagnostic_warnings_include_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for diagnostic_warnings_include.
std::vector< ProvenanceChainLink< std::string > > tileset_paths_secondary_src_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tileset_paths_secondary_src.
ChainableResult< ConfigValue< std::size_t > > num_tiles_in_primary_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::size_t > > num_tiles_per_metatile_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< bool > > pal_hints_enabled_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::vector< std::string > > > diagnostic_remarks_exclude_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< PackingStrategyType > > packing_strategy_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< TilesPalMode > > tiles_pal_mode_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< std::size_t > > num_tiles_per_metatile_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_tiles_per_metatile.
std::vector< ProvenanceChainLink< PerAnimOverrides > > per_anim_overrides_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for per_anim_overrides.
std::vector< ProvenanceChainLink< ArtifactEditMode > > tiles_edit_mode_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tiles_edit_mode.
std::vector< ProvenanceChainLink< AnimKeyFrameResolutionStrategy > > global_anim_key_frame_resolution_strategy_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for global_anim_key_frame_resolution_strategy.
std::vector< ProvenanceChainLink< std::size_t > > num_pals_total_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_pals_total.
ChainableResult< ConfigValue< bool > > verify_checksums_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< bool > > cross_tileset_anim_linking_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for cross_tileset_anim_linking.
std::vector< ProvenanceChainLink< std::size_t > > num_metatiles_total_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_metatiles_total.
std::vector< ProvenanceChainLink< AnimPalResolutionStrategy > > global_anim_pal_resolution_strategy_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for global_anim_pal_resolution_strategy.
std::vector< ProvenanceChainLink< std::vector< std::string > > > diagnostic_remarks_include_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for diagnostic_remarks_include.
std::vector< ProvenanceChainLink< TileSharingAlignment > > tile_sharing_alignment_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tile_sharing_alignment.
ChainableResult< ConfigValue< TileSharingPacking > > tile_sharing_packing_raw(ConfigScopeType type, const std::string &scope) const override
LazyLayeredConfig(gsl::not_null< TextFormatter * > format, std::vector< std::unique_ptr< ConfigProvider > > &&providers)
Constructs a LazyLayeredConfig with a list of ConfigProviders in priority order, highest to lowest.
ChainableResult< ConfigValue< PrimaryPairingMode > > primary_pairing_mode_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< bool > > tileset_animations_wire_anim_code_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::size_t > > metatile_attr_size_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< PrimaryPairingMode > > primary_pairing_mode_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for primary_pairing_mode.
ChainableResult< ConfigValue< AnimPalResolutionStrategy > > global_anim_pal_resolution_strategy_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< std::string > > tileset_paths_secondary_bin_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tileset_paths_secondary_bin.
std::vector< ProvenanceChainLink< std::vector< PaletteHint > > > pal_hints_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for pal_hints.
std::vector< ProvenanceChainLink< std::size_t > > num_tiles_total_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_tiles_total.
ChainableResult< ConfigValue< std::string > > tileset_paths_primary_src_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< std::size_t > > num_pals_in_primary_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_pals_in_primary.
ChainableResult< ConfigValue< std::vector< std::string > > > diagnostic_warnings_include_raw(ConfigScopeType type, const std::string &scope) const override
void dump_config(std::ostream &out, ConfigScopeType type, const std::string &scope) const
Dumps the full provenance chain for all config values to an output stream.
void add_provider(std::unique_ptr< ConfigProvider > provider) override
Prepends a ConfigProvider to the provider chain at highest priority and invalidates resolution caches...
ChainableResult< ConfigValue< std::vector< std::string > > > primary_pairing_partners_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< TileSharingAlignment > > tile_sharing_alignment_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::size_t > > max_map_data_size_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< std::size_t > > metatile_attr_size_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for metatile_attr_size.
std::vector< ProvenanceChainLink< std::string > > tileset_paths_primary_bin_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tileset_paths_primary_bin.
std::vector< ProvenanceChainLink< ArtifactEditMode > > pals_edit_mode_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for pals_edit_mode.
std::vector< ProvenanceChainLink< PackingStrategyType > > packing_strategy_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for packing_strategy.
ChainableResult< ConfigValue< std::string > > tileset_paths_secondary_src_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< AnimKeyFrameResolutionStrategy > > global_anim_key_frame_resolution_strategy_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< PackingStrategyParams > > packing_strategy_params_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for packing_strategy_params.
std::vector< ProvenanceChainLink< TilesPalMode > > tiles_pal_mode_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tiles_pal_mode.
ChainableResult< ConfigValue< ArtifactEditMode > > tiles_edit_mode_raw(ConfigScopeType type, const std::string &scope) const override
TextFormatter implementation that strips all styling from text.
Abstract base class for applying text styling with context-aware formatting.
ConfigScopeType
Specifies the scope type for configuration value lookups.
A small container that holds an optional-wrapped value, validation state, and metadata about the valu...