|
persona-generator 4.1.3
Complete characters composed from the other dasmig generators for C++23
|
Return type for persona generation. More...
#include <personagen.hpp>
Public Member Functions | |
| std::uint64_t | seed () const |
| Retrieve the random seed used to generate this persona. | |
| const core::seed_signature & | signature () const |
| The seed and the data this persona was generated from. | |
| sex | person_sex () const |
| Biological sex of the persona. | |
| unsigned | age () const |
| Age in completed years at the request's reference date. | |
| std::string | to_string () const |
| One-line summary: name, age, sex, city, country and job. | |
| void | to_json (core::json_writer &w) const |
| Write this persona as a JSON object. | |
| std::string | to_json () const |
| This persona as a JSON document. | |
| operator std::string () const | |
| Implicit conversion to std::string. | |
Public Attributes | |
| std::string | name |
| Full name (UTF-8), from the country's culture and the sex. | |
| dasmig::country | country_info |
| The country. | |
| dasmig::city | city_info |
| The city of residence, in the country. | |
| std::string | admin1 |
| Name of the city's state or province; empty when city-generator has no admin1 names loaded. | |
| dasmig::birth | birthday |
| Birth date, completed-year age and sex. | |
| dasmig::biodata | body |
| Height, weight, eyes, hair, skin and blood type, at the persona's age and sex. | |
| dasmig::personality | traits |
| Personality traits and axes. | |
| dasmig::interest | interests |
| Religion, hobbies and media. | |
| dasmig::occupation | job |
| Employment status, education and job. | |
| std::optional< family > | relatives {} |
The persona's family; set only when persona_request::relations was. // NOLINT(readability-redundant-member-init) | |
Friends | |
| class | psg |
| std::ostream & | operator<< (std::ostream &os, const persona &v) |
| Stream the summary to an output stream. | |
Return type for persona generation.
Holds the typed result of every library in the pipeline. Supports implicit conversion to std::string (a one-line summary), streaming via operator<< and JSON output via to_json().
Definition at line 89 of file personagen.hpp.
|
inline |
Age in completed years at the request's reference date.
Definition at line 122 of file personagen.hpp.
|
inline |
Implicit conversion to std::string.
Definition at line 185 of file personagen.hpp.
|
inline |
Biological sex of the persona.
Definition at line 118 of file personagen.hpp.
|
inline |
Retrieve the random seed used to generate this persona.
Definition at line 106 of file personagen.hpp.
|
inline |
The seed and the data this persona was generated from.
data combines the data hashes of the eight libraries and the request. Definition at line 111 of file personagen.hpp.
|
inline |
This persona as a JSON document.
Definition at line 176 of file personagen.hpp.
|
inline |
Write this persona as a JSON object.
Each library's result is written as that library writes it (country, city, birth, biodata, personality, interest, occupation), next to name, sex, age, admin1 and signature, and relatives (the family) when the request asked for it.
| w | Writer positioned where a value is allowed. |
Definition at line 143 of file personagen.hpp.
|
inline |
One-line summary: name, age, sex, city, country and job.
Ana Silva, 34, female, Porto, Portugal, Teacher. Definition at line 126 of file personagen.hpp.
|
friend |
Stream the summary to an output stream.
| os | Output stream. |
| v | The persona to stream. |
Definition at line 194 of file personagen.hpp.
|
friend |
Definition at line 202 of file personagen.hpp.
| std::string dasmig::persona::admin1 |
Name of the city's state or province; empty when city-generator has no admin1 names loaded.
Definition at line 95 of file personagen.hpp.
| dasmig::birth dasmig::persona::birthday |
Birth date, completed-year age and sex.
Definition at line 96 of file personagen.hpp.
| dasmig::biodata dasmig::persona::body |
Height, weight, eyes, hair, skin and blood type, at the persona's age and sex.
Definition at line 97 of file personagen.hpp.
| dasmig::city dasmig::persona::city_info |
The city of residence, in the country.
Definition at line 94 of file personagen.hpp.
| dasmig::country dasmig::persona::country_info |
The country.
Definition at line 93 of file personagen.hpp.
| dasmig::interest dasmig::persona::interests |
Religion, hobbies and media.
Definition at line 99 of file personagen.hpp.
| dasmig::occupation dasmig::persona::job |
Employment status, education and job.
Definition at line 100 of file personagen.hpp.
| std::string dasmig::persona::name |
Full name (UTF-8), from the country's culture and the sex.
Definition at line 92 of file personagen.hpp.
| std::optional<family> dasmig::persona::relatives {} |
The persona's family; set only when persona_request::relations was. // NOLINT(readability-redundant-member-init)
Definition at line 101 of file personagen.hpp.
| dasmig::personality dasmig::persona::traits |
Personality traits and axes.
Definition at line 98 of file personagen.hpp.