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

Combines a generation engine with a scoped environment. More...

#include <generation_context.hpp>

Collaboration diagram for generation_context:
Collaboration graph

Public Types

using entries = generation_environment::entries
 

Public Member Functions

 generation_context (std::uint64_t seed, entries initial={})
 Constructs a context with a specific seed and optional entries.
 
 generation_context (entries initial={})
 Constructs a context with a random seed and optional entries.
 
generation_context child (entries overrides) const
 Creates a child context with the same engine but overridden env.
 
generation_engineengine ()
 Returns the generation engine.
 
const generation_environmentenv () const
 Returns the generation environment.
 
std::uint64_t seed () const
 
boost::uuids::uuid generate_uuid ()
 
int random_int (int min, int max)
 
bool random_bool (double probability=0.5)
 
std::chrono::system_clock::time_point past_timepoint (int years_back=3)
 
std::string alphanumeric (std::size_t length)
 
template<typename T >
const T & pick (const std::vector< T > &items)
 
template<typename T , std::size_t N>
const T & pick (const std::array< T, N > &items)
 

Detailed Description

Combines a generation engine with a scoped environment.

The engine is shared across parent and child contexts so random sequences remain consistent. The environment supports parent-child scoping for passing contextual data (tenant_id, modified_by, FK references) through entity generation graphs.