ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
generation_environment Class Referencefinal

Scoped key-value store for generation context data. More...

#include <generation_environment.hpp>

Collaboration diagram for generation_environment:
Collaboration graph

Public Types

using entries = std::unordered_map< std::string, std::string >
 

Public Member Functions

 generation_environment (entries initial={})
 Constructs a root environment with optional initial entries.
 
 generation_environment (std::shared_ptr< const generation_environment > parent, entries overrides)
 Constructs a child environment with overrides.
 
std::optional< std::string > get (std::string_view key) const
 Gets a value by key, searching parent chain.
 
std::string get_or (std::string_view key, const std::string &default_value) const
 Gets a value by key, returning default if not found.
 
bool has (std::string_view key) const
 Checks if a key exists in this environment or parents.
 
std::shared_ptr< const generation_environmentparent () const
 Returns the parent environment, if any.
 

Detailed Description

Scoped key-value store for generation context data.

Supports parent-child chaining: a child environment inherits all entries from its parent, with overrides taking precedence.