scifir-units 2.0.0
scifir-units is a library of units of measurement, angles, coordinates, fields, and related data, all lightweight, that help in the development of scientific software and scientific machines
|
Class that allows to store information about a zone, including the astronomical object inside which the zone is. The zone can be in any astronomical object, not only the Earth is supported. Initialization string example: "(P) universe:milky-way:solar-system:earth (Z) chile:region-metropolitana:santiago:providencia". More...
#include <zid.hpp>
Public Types | |
enum | type : int8_t { NONE , COUNTRY , REGION , SETTLEMENT , ZONE } |
Type of zone. More... | |
Public Member Functions | |
zid () | |
Default constructor. There's no data about any zone, the aid member-variable is also empty. | |
zid (const zid &x) | |
Copy constructor. The zid is initialized copying the member-variables of the zid x. | |
zid (zid &&x) | |
Move constructor. The zid is initialized moving the member-variables of the zid x. | |
zid (const scifir::aid &new_aid, const zid::type &new_zid_type, const string &new_country) | |
Constructor. It initializes a country as the entire zone of zid. | |
zid (const scifir::aid &new_aid, const string &new_country, const vector< string > &new_regions) | |
Constructor. It initializes a region as the entire zone of zid, which is the last region specified, the one inside the other regions given if there's more than one region initialized. | |
zid (const scifir::aid &new_aid, const zid::type &new_zid_type, const string &new_country, const vector< string > &new_regions, const string &new_zone) | |
Constructor. The aid is new_aid, the country is new_country, the regions are new_regions and zone is new_zone. The zone_type can be ZONE or SETTLEMENT. | |
zid (const scifir::aid &new_aid, const string &init_zid) | |
Constructor. The aid is new_aid, init_zid initializes the other member-variables. | |
zid (const string &init_zid_full) | |
Constructor. Initializes all the member-variables with init_zid_full, which is a union is init_aid and init_zid. | |
zid & | operator= (const zid &x) |
Copy assigment. The member-variables are copied from the zid x. | |
zid & | operator= (zid &&x) |
Move assigment. The member-variables are moved from the zid x. | |
zid & | operator= (const string &init_zid_full) |
Assignment. Initializes all the member-variables with init_zid_full, which is a union is init_aid and init_zid. | |
bool | has_no_country () const |
Returns true if the value of country is the predefined value 'no-country'. | |
bool | has_unknown_country () const |
Returns true if the value of country is the predefined value 'unknown-country'. | |
string | display () const |
Returns a string representation of zid, including the string representation of his aid. | |
string | partial_display () const |
Returns a string representation of zid, without the string representation of his aid. | |
Public Attributes | |
scifir::aid | aid |
The aid of the astronomical object where the zone is. | |
vector< string > | regions |
The different administrative regions where the zone is. There can be any number of administrative regions, each inside the other. There can't be regions that aren't inside another region here. | |
string | country |
The country where the zone is. In extraterrestrial planets, it's considered a country any division of territory ruled with their own laws. The predefined value no-country means that the zone is not inside a country. The predefined value unknown-country means that it's not known the country where the zone is, but that it's known that it's a country. | |
string | zone |
The name of the zone. Personal zones with a personal name are allowed, it's not necessary that the zone is registered by a country or another organization. | |
zid::type | zone_type |
The type of zone. It can be any value of the enum zid::type. The possible values are COUNTRY, REGION and ZONE. A zone can be any surface inside an astronomical object, of any shape, and it's not necessary to be a zone registered by a country or organization. A personal zone with a personal name is allowed. | |
Private Member Functions | |
void | initialize_from_string (const string &init_zid_full) |
Internal function. It's used by the string constructor and the string assignment of zid to initialize the member-variables using the initialization string init_zid_full. | |
Class that allows to store information about a zone, including the astronomical object inside which the zone is. The zone can be in any astronomical object, not only the Earth is supported. Initialization string example: "(P) universe:milky-way:solar-system:earth (Z) chile:region-metropolitana:santiago:providencia".
Type of zone.
Definition at line 16 of file zid.hpp.
zid::zid | ( | ) |
Default constructor. There's no data about any zone, the aid member-variable is also empty.
Definition at line 12 of file zid.cpp.
zid::zid | ( | zid && | x | ) |
|
explicit |
Constructor. It initializes a region as the entire zone of zid, which is the last region specified, the one inside the other regions given if there's more than one region initialized.
|
explicit |
Constructor. The aid is new_aid, the country is new_country, the regions are new_regions and zone is new_zone. The zone_type can be ZONE or SETTLEMENT.
|
explicit |
Constructor. The aid is new_aid, init_zid initializes the other member-variables.
Definition at line 46 of file zid.cpp.
Constructor. Initializes all the member-variables with init_zid_full, which is a union is init_aid and init_zid.
Definition at line 98 of file zid.cpp.
string zid::display | ( | ) | const |
Returns a string representation of zid, including the string representation of his aid.
Definition at line 139 of file zid.cpp.
bool zid::has_no_country | ( | ) | const |
bool zid::has_unknown_country | ( | ) | const |
Internal function. It's used by the string constructor and the string assignment of zid to initialize the member-variables using the initialization string init_zid_full.
Definition at line 181 of file zid.cpp.
Assignment. Initializes all the member-variables with init_zid_full, which is a union is init_aid and init_zid.
Copy assigment. The member-variables are copied from the zid x.
Definition at line 103 of file zid.cpp.
Move assigment. The member-variables are moved from the zid x.
string zid::partial_display | ( | ) | const |
Returns a string representation of zid, without the string representation of his aid.
scifir::aid zid::aid |
string zid::country |
The country where the zone is. In extraterrestrial planets, it's considered a country any division of territory ruled with their own laws. The predefined value no-country means that the zone is not inside a country. The predefined value unknown-country means that it's not known the country where the zone is, but that it's known that it's a country.
string zid::zone |
string zid::zone_type |
The type of zone. It can be any value of the enum zid::type. The possible values are COUNTRY, REGION and ZONE. A zone can be any surface inside an astronomical object, of any shape, and it's not necessary to be a zone registered by a country or organization. A personal zone with a personal name is allowed.