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 stores astronomical ids, not as an integer but with an string as identifier. Initialization string example: "(P) universe:milky-way:solar-system:earth". More...
#include <aid.hpp>
Public Types | |
enum | type : int8_t { NONE , UNIVERSE , GALAXY , SOLAR_SYSTEM , PLANET , STAR , ASTEROID , MOON , METEOR } |
Type of astronomical body. More... | |
Public Member Functions | |
aid () | |
Default constructor. The astronomical type is NONE, the other member-variables are empty strings. | |
aid (const aid &x) | |
Copy constructor. The member-variables are copied from the aid x. | |
aid (aid &&x) | |
Move constructor. The member-variables are moved from the aid x. | |
aid (const scifir::astronomical_body &predefined_astronomical_body) | |
Constructor of predefined astronomical bodies. Initializes aid to be one predefined astronomical bodies of the enum astronomical_body. | |
aid (const aid::type &new_astronomical_type, const string &new_astro1, const string &new_astro2="", const string &new_astro3="", const string &new_astro4="") | |
aid (const string &init_aid) | |
Constructor of any astronomical body. It uses an initialization string of aid to initialized all member-variables. | |
aid & | operator= (const aid &x) |
Copy assignment. The member-variables are copied from the aid x. | |
aid & | operator= (aid &&x) |
Move assignment. The member-variables are moved from the aid x. | |
aid & | operator= (const string &init_aid) |
Assignment operator with an initialization string of aid. | |
bool | has_no_universe () const |
bool | has_unknown_universe () const |
Returns true if the universe has the special value "unknown-universe". | |
bool | has_no_galaxy () const |
bool | has_unknown_galaxy () const |
Returns true if the galaxy has the special value "unknown-galaxy". | |
bool | has_no_solar_system () const |
bool | has_unknown_solar_system () const |
Returns true if the solar system has the special value "unknown-solar-system". | |
bool | has_unknown_planet () const |
Returns true if the planet has the special value "unknown-planet". | |
bool | has_unknown_moon () const |
Returns true if the moon has the special value "unknown-moon". | |
bool | has_unknown_star () const |
Returns true if the star has the special value "unknown-star". | |
bool | has_unknown_asteroid () const |
Returns true if the asteroid has the special value "unknown-asteroid". | |
string | display () const |
Returns a string representation of aid. | |
Public Attributes | |
string | universe |
The universe of the astronomical body. The predefined value no-universe means that there's no universe, it's intended for fiction locations. The predefined value unknown-universe means that it's not known the universe of the astronomical object. | |
string | galaxy |
The galaxy of the astronomical body. The predefined value no-galaxy means that the astronomical object is not inside a galaxy. The predefined value unknown-galaxy means that it's not known the galaxy of the astronomical object. | |
string | solar_system |
The solar system of the astronomical body. The predefined value no-solar-system means that the astronomical object is not inside a solar system, it's alone. The predefined value unknown-solar-system means that it's not known the solar system of the astronomical object. | |
string | astronomical_body |
The name of the astronomical body. The predefined value unknown-planet means that it's not known the planet of the astronomical object. The predefined value unknown-moon means that it's not known the moon of the astronomical object. The predefined value unknown-star means that it's not known the star of the astronomical object. The predefined value unknown-asteroid means that it's not known the asteroid of the astronomical object. | |
aid::type | astronomical_type |
The type of the astronomical body, which can be any value of the enum aid::type. | |
Private Member Functions | |
void | initialize_from_string (const string &init_aid) |
Internal function. Initializes the member-variables with an initialization string of aid. | |
Class that stores astronomical ids, not as an integer but with an string as identifier. Initialization string example: "(P) universe:milky-way:solar-system:earth".
Type of astronomical body.
Definition at line 16 of file aid.hpp.
aid::aid | ( | ) |
Default constructor. The astronomical type is NONE, the other member-variables are empty strings.
Definition at line 13 of file aid.cpp.
Copy constructor. The member-variables are copied from the aid x.
Definition at line 16 of file aid.cpp.
aid::aid | ( | aid && | x | ) |
Move constructor. The member-variables are moved from the aid x.
Definition at line 19 of file aid.cpp.
|
explicit |
Constructor of predefined astronomical bodies. Initializes aid to be one predefined astronomical bodies of the enum astronomical_body.
Definition at line 22 of file aid.cpp.
|
explicit |
Definition at line 312 of file aid.cpp.
Constructor of any astronomical body. It uses an initialization string of aid to initialized all member-variables.
Definition at line 363 of file aid.cpp.
string aid::display | ( | ) | const |
Returns a string representation of aid.
Definition at line 540 of file aid.cpp.
bool scifir::aid::has_no_galaxy | ( | ) | const |
bool scifir::aid::has_no_solar_system | ( | ) | const |
bool scifir::aid::has_no_universe | ( | ) | const |
bool aid::has_unknown_asteroid | ( | ) | const |
Returns true if the asteroid has the special value "unknown-asteroid".
bool aid::has_unknown_galaxy | ( | ) | const |
bool aid::has_unknown_moon | ( | ) | const |
Returns true if the moon has the special value "unknown-moon".
bool aid::has_unknown_planet | ( | ) | const |
Returns true if the planet has the special value "unknown-planet".
bool aid::has_unknown_solar_system | ( | ) | const |
Returns true if the solar system has the special value "unknown-solar-system".
bool aid::has_unknown_star | ( | ) | const |
Returns true if the star has the special value "unknown-star".
bool aid::has_unknown_universe | ( | ) | const |
Internal function. Initializes the member-variables with an initialization string of aid.
Definition at line 444 of file aid.cpp.
Move assignment. The member-variables are moved from the aid x.
Definition at line 378 of file aid.cpp.
Copy assignment. The member-variables are copied from the aid x.
Definition at line 368 of file aid.cpp.
Assignment operator with an initialization string of aid.
string aid::astronomical_body |
The name of the astronomical body. The predefined value unknown-planet means that it's not known the planet of the astronomical object. The predefined value unknown-moon means that it's not known the moon of the astronomical object. The predefined value unknown-star means that it's not known the star of the astronomical object. The predefined value unknown-asteroid means that it's not known the asteroid of the astronomical object.
aid::type aid::astronomical_type |
string aid::galaxy |
string aid::solar_system |
The solar system of the astronomical body. The predefined value no-solar-system means that the astronomical object is not inside a solar system, it's alone. The predefined value unknown-solar-system means that it's not known the solar system of the astronomical object.
string aid::universe |