Birth Generator 3.2.2
Procedural birth date generation for C++23
Loading...
Searching...
No Matches
dasmig::birth_request Struct Reference

All per-call birth filters and settings. More...

#include <birthgen.hpp>

Public Attributes

std::optional< std::string > country_code {}
 ISO 3166-1 alpha-2 code, or random.
 
std::optional< dasmig::sex > bio_sex {}
 Fixed biological sex, or drawn.
 
std::optional< year_t > year {}
 Fixed birth year, or derived from age.
 
std::optional< age_range > ages {}
 Inclusive ages; values above 100 clamp to 100.
 
bool weighted {true}
 Population-weighted (true) or uniform country.
 
std::chrono::year_month_day reference_date {default_reference_date}
 Date ages are computed at.
 

Static Public Attributes

static constexpr std::chrono::year_month_day default_reference_date
 1 July 2023, the date of the UN population estimates.
 

Detailed Description

All per-call birth filters and settings.

An omitted country selects a random country. Omitted sex, year and ages use the country's demographic distributions. A fixed year and an age range are mutually exclusive. Replay requires the same request and data.

Definition at line 62 of file birthgen.hpp.

Member Data Documentation

◆ ages

std::optional<age_range> dasmig::birth_request::ages {}

Inclusive ages; values above 100 clamp to 100.

Definition at line 75 of file birthgen.hpp.

◆ bio_sex

std::optional<dasmig::sex> dasmig::birth_request::bio_sex {}

Fixed biological sex, or drawn.

Definition at line 71 of file birthgen.hpp.

◆ country_code

std::optional<std::string> dasmig::birth_request::country_code {}

ISO 3166-1 alpha-2 code, or random.

Definition at line 69 of file birthgen.hpp.

◆ default_reference_date

constexpr std::chrono::year_month_day dasmig::birth_request::default_reference_date
staticconstexpr
Initial value:
{
std::chrono::year{2023}, std::chrono::July, std::chrono::day{1}}

1 July 2023, the date of the UN population estimates.

Definition at line 65 of file birthgen.hpp.

◆ reference_date

std::chrono::year_month_day dasmig::birth_request::reference_date {default_reference_date}

Date ages are computed at.

Definition at line 77 of file birthgen.hpp.

◆ weighted

bool dasmig::birth_request::weighted {true}

Population-weighted (true) or uniform country.

Definition at line 76 of file birthgen.hpp.

◆ year

std::optional<year_t> dasmig::birth_request::year {}

Fixed birth year, or derived from age.

Definition at line 73 of file birthgen.hpp.


The documentation for this struct was generated from the following file: