|
Occupation Generator 3.0.1
Employment status and occupation by country, age, sex and education for C++23
|
Return type for occupation generation. More...
#include <occupationgen.hpp>
Public Member Functions | |
| std::uint64_t | seed () const |
| Retrieve the random seed used to generate this occupation. | |
| const core::seed_signature & | signature () const |
| The seed and the data this occupation was generated from. | |
| std::string | to_string () const |
| Human-readable summary string. | |
| void | to_json (core::json_writer &w) const |
| Write this occupation as a JSON object. | |
| std::string | to_json () const |
| This occupation as a JSON document. | |
| operator std::string () const | |
| Implicit conversion to std::string. | |
Public Attributes | |
| std::string | country_code |
| ISO 3166-1 alpha-2 code of the country drawn from. | |
| sex | person_sex {sex::male} |
| Sex (given or drawn). | |
| std::uint8_t | age {0} |
| Age in completed years. | |
| employment_status | status {employment_status::employed} |
| Employment status. | |
| std::optional< education_level > | education |
| Education; unknown under 15 when not given. | |
| std::optional< job_info > | job |
Friends | |
| class | ocg |
| std::ostream & | operator<< (std::ostream &os, const occupation &v) |
| Stream the summary to an output stream. | |
Return type for occupation generation.
Supports implicit conversion to std::string (the job label, or the status when there is no job), streaming via operator<< and JSON output via to_json().
Definition at line 122 of file occupationgen.hpp.
|
inline |
Implicit conversion to std::string.
Definition at line 199 of file occupationgen.hpp.
|
inline |
Retrieve the random seed used to generate this occupation.
Definition at line 137 of file occupationgen.hpp.
|
inline |
The seed and the data this occupation was generated from.
data is ocg::data_hash() at the time of generation. Definition at line 142 of file occupationgen.hpp.
|
inline |
This occupation as a JSON document.
{"country_code":"BR","sex":"male","age":30,"status":"employed","education":"intermediate","job":{...},"signature":{...}}. Definition at line 190 of file occupationgen.hpp.
|
inline |
Write this occupation as a JSON object.
| w | Writer positioned where a value is allowed. |
Definition at line 153 of file occupationgen.hpp.
|
inline |
Human-readable summary string.
Definition at line 146 of file occupationgen.hpp.
|
friend |
Definition at line 223 of file occupationgen.hpp.
|
friend |
Stream the summary to an output stream.
| os | Output stream. |
| v | The occupation to stream. |
Definition at line 208 of file occupationgen.hpp.
| std::uint8_t dasmig::occupation::age {0} |
Age in completed years.
Definition at line 127 of file occupationgen.hpp.
| std::string dasmig::occupation::country_code |
ISO 3166-1 alpha-2 code of the country drawn from.
Definition at line 125 of file occupationgen.hpp.
| std::optional<education_level> dasmig::occupation::education |
Education; unknown under 15 when not given.
Definition at line 129 of file occupationgen.hpp.
| std::optional<job_info> dasmig::occupation::job |
The job: the current one when employed, the last or usual one when unemployed, retired or inactive; none for students and for the inactive under 6.
Definition at line 130 of file occupationgen.hpp.
| sex dasmig::occupation::person_sex {sex::male} |
Sex (given or drawn).
Definition at line 126 of file occupationgen.hpp.
| employment_status dasmig::occupation::status {employment_status::employed} |
Employment status.
Definition at line 128 of file occupationgen.hpp.