8#include <unordered_map>
11#include "gsl/pointers"
57 gsl::not_null<TextFormatter *> format, std::vector<std::unique_ptr<ConfigProvider>> &&providers)
58 : format_{format}, providers_{std::move(providers)}
73 providers_{std::move(providers)}
231 [[nodiscard]] std::vector<ProvenanceChainLink<std::size_t>>
244 [[nodiscard]] std::vector<ProvenanceChainLink<std::size_t>>
257 [[nodiscard]] std::vector<ProvenanceChainLink<std::size_t>>
270 [[nodiscard]] std::vector<ProvenanceChainLink<std::size_t>>
283 [[nodiscard]] std::vector<ProvenanceChainLink<std::size_t>>
296 [[nodiscard]] std::vector<ProvenanceChainLink<std::size_t>>
309 [[nodiscard]] std::vector<ProvenanceChainLink<std::size_t>>
322 [[nodiscard]] std::vector<ProvenanceChainLink<std::size_t>>
335 [[nodiscard]] std::vector<ProvenanceChainLink<Rgba32>>
348 [[nodiscard]] std::vector<ProvenanceChainLink<bool>>
361 [[nodiscard]] std::vector<ProvenanceChainLink<ArtifactEditMode>>
374 [[nodiscard]] std::vector<ProvenanceChainLink<ArtifactEditMode>>
387 [[nodiscard]] std::vector<ProvenanceChainLink<bool>>
400 [[nodiscard]] std::vector<ProvenanceChainLink<std::vector<PaletteHint>>>
413 [[nodiscard]] std::vector<ProvenanceChainLink<PackingStrategyType>>
426 [[nodiscard]] std::vector<ProvenanceChainLink<PackingStrategyParams>>
439 [[nodiscard]] std::vector<ProvenanceChainLink<TileSharingPacking>>
452 [[nodiscard]] std::vector<ProvenanceChainLink<TileSharingAlignment>>
465 [[nodiscard]] std::vector<ProvenanceChainLink<TilesPaletteMode>>
478 [[nodiscard]] std::vector<ProvenanceChainLink<AnimPaletteResolutionStrategy>>
491 [[nodiscard]] std::vector<ProvenanceChainLink<AnimKeyFrameResolutionStrategy>>
504 [[nodiscard]] std::vector<ProvenanceChainLink<AnimMultiPaletteSubtileResolutionStrategy>>
518 [[nodiscard]] std::vector<ProvenanceChainLink<FrameLinking>>
531 [[nodiscard]] std::vector<ProvenanceChainLink<PerAnimOverrides>>
544 [[nodiscard]] std::vector<ProvenanceChainLink<bool>>
557 [[nodiscard]] std::vector<ProvenanceChainLink<bool>>
570 [[nodiscard]] std::vector<ProvenanceChainLink<PrimaryPairingMode>>
583 [[nodiscard]] std::vector<ProvenanceChainLink<std::vector<std::string>>>
596 [[nodiscard]] std::vector<ProvenanceChainLink<std::vector<std::string>>>
609 [[nodiscard]] std::vector<ProvenanceChainLink<std::vector<std::string>>>
622 [[nodiscard]] std::vector<ProvenanceChainLink<std::vector<std::string>>>
635 [[nodiscard]] std::vector<ProvenanceChainLink<std::vector<std::string>>>
648 [[nodiscard]] std::vector<ProvenanceChainLink<std::string>>
661 [[nodiscard]] std::vector<ProvenanceChainLink<std::string>>
674 [[nodiscard]] std::vector<ProvenanceChainLink<std::string>>
687 [[nodiscard]] std::vector<ProvenanceChainLink<std::string>>
700 [[nodiscard]] std::vector<ProvenanceChainLink<std::optional<std::size_t>>>
713 [[nodiscard]] std::vector<ProvenanceChainLink<std::optional<std::size_t>>>
726 [[nodiscard]] std::vector<ProvenanceChainLink<MetatileAttributeFieldDefinitions>>
739 [[nodiscard]] std::vector<ProvenanceChainLink<MetatileAttributeFieldOverrides>>
752 [[nodiscard]] std::vector<ProvenanceChainLink<RolePinDefinitions>>
765 [[nodiscard]] std::vector<ProvenanceChainLink<bool>>
781 std::unique_ptr<TextFormatter> owned_format_;
784 std::vector<std::unique_ptr<ConfigProvider>> providers_;
787 mutable std::map<std::string, std::any> cache_;
789 mutable std::unordered_map<std::string, std::string> cache_value_strings_;
792 mutable std::unordered_map<std::string, std::string> source_key_;
795 mutable std::unordered_map<std::string, std::string> source_;
796 mutable std::unordered_map<std::string, std::vector<std::string>> source_details_;
805 template <
typename T>
807 const std::string &cache_key,
808 const std::string &canonical_name,
821 template <
typename T>
822 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< RolePinDefinitions > > role_pins_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for role_pins.
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 > > 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< std::size_t > > num_palettes_total_raw(ConfigScopeType type, const std::string &scope) const override
LazyLayeredConfig(std::vector< std::unique_ptr< ConfigProvider > > &&providers)
Constructs a LazyLayeredConfig with a default PlainTextFormatter.
std::vector< ProvenanceChainLink< AnimPaletteResolutionStrategy > > global_anim_palette_resolution_strategy_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for global_anim_palette_resolution_strategy.
ChainableResult< ConfigValue< std::vector< PaletteHint > > > palette_hints_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::string > > tileset_paths_primary_bin_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< AnimMultiPaletteSubtileResolutionStrategy > > global_anim_multi_palette_subtile_resolution_strategy_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.
ChainableResult< ConfigValue< AnimPaletteResolutionStrategy > > global_anim_palette_resolution_strategy_raw(ConfigScopeType type, const std::string &scope) const override
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.
std::vector< ProvenanceChainLink< AnimMultiPaletteSubtileResolutionStrategy > > global_anim_multi_palette_subtile_resolution_strategy_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for global_anim_multi_palette_subtile_resolution_strategy.
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.
ChainableResult< ConfigValue< ArtifactEditMode > > palettes_edit_mode_raw(ConfigScopeType type, const std::string &scope) const override
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< 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
std::vector< ProvenanceChainLink< std::size_t > > num_palettes_in_primary_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_palettes_in_primary.
ChainableResult< ConfigValue< MetatileAttributeFieldOverrides > > metatile_attribute_field_overrides_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
std::vector< ProvenanceChainLink< std::size_t > > num_palettes_total_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_palettes_total.
ChainableResult< ConfigValue< std::vector< std::string > > > diagnostic_remarks_include_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::optional< std::size_t > > > metatile_attribute_size_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::optional< std::size_t > > > metatile_attribute_declaration_size_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.
std::vector< ProvenanceChainLink< TilesPaletteMode > > tiles_palette_mode_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tiles_palette_mode.
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< 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< bool > > palette_hints_enabled_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for palette_hints_enabled.
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.
ChainableResult< ConfigValue< bool > > palette_hints_enabled_raw(ConfigScopeType type, const std::string &scope) const override
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< std::vector< std::string > > > diagnostic_remarks_exclude_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< bool > > ignore_triple_layer_content_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< PackingStrategyType > > packing_strategy_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::optional< std::size_t > > > metatile_attribute_declaration_size_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for metatile_attribute_declaration_size.
ChainableResult< ConfigValue< MetatileAttributeFieldDefinitions > > metatile_attribute_fields_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< ArtifactEditMode > > palettes_edit_mode_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for palettes_edit_mode.
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::vector< PaletteHint > > > palette_hints_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for palette_hints.
std::vector< ProvenanceChainLink< std::optional< std::size_t > > > metatile_attribute_size_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for metatile_attribute_size.
std::vector< ProvenanceChainLink< bool > > ignore_triple_layer_content_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for ignore_triple_layer_content.
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< 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.
ChainableResult< ConfigValue< TilesPaletteMode > > tiles_palette_mode_raw(ConfigScopeType type, const std::string &scope) const override
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< std::size_t > > num_palettes_in_primary_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< RolePinDefinitions > > role_pins_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
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.
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::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
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...
std::vector< ProvenanceChainLink< MetatileAttributeFieldOverrides > > metatile_attribute_field_overrides_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for metatile_attribute_field_overrides.
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::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< 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< MetatileAttributeFieldDefinitions > > metatile_attribute_fields_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for metatile_attribute_fields.
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...