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
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Private Member Functions | List of all members
scifir::aid Class Reference

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.
 
aidoperator= (const aid &x)
 Copy assignment. The member-variables are copied from the aid x.
 
aidoperator= (aid &&x)
 Move assignment. The member-variables are moved from the aid x.
 
aidoperator= (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.
 

Detailed Description

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".

Definition at line 13 of file aid.hpp.

Member Enumeration Documentation

◆ type

Type of astronomical body.

Enumerator
NONE 

No astronomical body.

UNIVERSE 

A universe. His string representation is U.

GALAXY 

A galaxy. His string representation is G.

SOLAR_SYSTEM 

A solar system. A solar system is composed of planets orbiting a star. His string representation is SS.

PLANET 

A planet. A planet is an astronomical object with atmosphere. His string representation is P.

STAR 

A star. His string representation is ST.

ASTEROID 

An asteroid. An asteroid is an astronomical object that orbits another astronomical object. His string representation is A.

MOON 

A moon. A moon is a natural satellite of a planet. His string representation is MN.

METEOR 

A meteor. His string representation is MT.

Definition at line 16 of file aid.hpp.

@ NONE
No astronomical body.
Definition aid.hpp:16
@ MOON
A moon. A moon is a natural satellite of a planet. His string representation is MN.
Definition aid.hpp:16
@ ASTEROID
An asteroid. An asteroid is an astronomical object that orbits another astronomical object....
Definition aid.hpp:16
@ METEOR
A meteor. His string representation is MT.
Definition aid.hpp:16
@ GALAXY
A galaxy. His string representation is G.
Definition aid.hpp:16
@ SOLAR_SYSTEM
A solar system. A solar system is composed of planets orbiting a star. His string representation is S...
Definition aid.hpp:16
@ UNIVERSE
A universe. His string representation is U.
Definition aid.hpp:16
@ STAR
A star. His string representation is ST.
Definition aid.hpp:16
@ PLANET
A planet. A planet is an astronomical object with atmosphere. His string representation is P.
Definition aid.hpp:16

Constructor & Destructor Documentation

◆ aid() [1/6]

aid::aid ( )

Default constructor. The astronomical type is NONE, the other member-variables are empty strings.

Definition at line 13 of file aid.cpp.

14 {}
string universe
The universe of the astronomical body. The predefined value no-universe means that there's no univers...
Definition aid.hpp:42
string galaxy
The galaxy of the astronomical body. The predefined value no-galaxy means that the astronomical objec...
Definition aid.hpp:43
aid::type astronomical_type
The type of the astronomical body, which can be any value of the enum aid::type.
Definition aid.hpp:46
string solar_system
The solar system of the astronomical body. The predefined value no-solar-system means that the astron...
Definition aid.hpp:44
string astronomical_body
The name of the astronomical body. The predefined value unknown-planet means that it's not known the ...
Definition aid.hpp:45

◆ aid() [2/6]

aid::aid ( const aid x)

Copy constructor. The member-variables are copied from the aid x.

Definition at line 16 of file aid.cpp.

16 : universe(x.universe),galaxy(x.galaxy),solar_system(x.solar_system),astronomical_body(x.astronomical_body),astronomical_type(x.astronomical_type)
17 {}

◆ aid() [3/6]

aid::aid ( aid &&  x)

Move constructor. The member-variables are moved from the aid x.

Definition at line 19 of file aid.cpp.

19 : universe(std::move(x.universe)),galaxy(std::move(x.galaxy)),solar_system(std::move(x.solar_system)),astronomical_body(std::move(x.astronomical_body)),astronomical_type(std::move(x.astronomical_type))
20 {}

◆ aid() [4/6]

aid::aid ( const scifir::astronomical_body predefined_astronomical_body)
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.

22 : aid()
23 {
24 if (predefined_astronomical_body != astronomical_body::NONE)
25 {
26 universe = "universe";
27 }
28 if (predefined_astronomical_body == astronomical_body::MILKY_WAY)
29 {
30 galaxy = "milky-way";
32 }
33 else if (predefined_astronomical_body == astronomical_body::ANDROMEDA)
34 {
35 galaxy = "andromeda";
37 }
38 else if (predefined_astronomical_body == astronomical_body::SOLAR_SYSTEM)
39 {
40 galaxy = "milky-way";
41 solar_system = "solar-system";
43 }
44 else if (predefined_astronomical_body == astronomical_body::SUN)
45 {
46 galaxy = "milky-way";
47 solar_system = "solar-system";
48 astronomical_body = "sun";
50 }
51 else if (predefined_astronomical_body == astronomical_body::MOON)
52 {
53 galaxy = "milky-way";
54 solar_system = "solar-system";
55 astronomical_body = "moon";
57 }
58 else if (predefined_astronomical_body == astronomical_body::MERCURY)
59 {
60 galaxy = "milky-way";
61 solar_system = "solar-system";
62 astronomical_body = "mercury";
64 }
65 else if (predefined_astronomical_body == astronomical_body::VENUS)
66 {
67 galaxy = "milky-way";
68 solar_system = "solar-system";
69 astronomical_body = "venus";
71 }
72 else if (predefined_astronomical_body == astronomical_body::EARTH)
73 {
74 galaxy = "milky-way";
75 solar_system = "solar-system";
76 astronomical_body = "earth";
78 }
79 else if (predefined_astronomical_body == astronomical_body::MARS)
80 {
81 galaxy = "milky-way";
82 solar_system = "solar-system";
83 astronomical_body = "mars";
85 }
86 else if (predefined_astronomical_body == astronomical_body::JUPITER)
87 {
88 galaxy = "milky-way";
89 solar_system = "solar-system";
90 astronomical_body = "jupiter";
92 }
93 else if (predefined_astronomical_body == astronomical_body::SATURN)
94 {
95 galaxy = "milky-way";
96 solar_system = "solar-system";
97 astronomical_body = "saturn";
99 }
100 else if (predefined_astronomical_body == astronomical_body::URANUS)
101 {
102 galaxy = "milky-way";
103 solar_system = "solar-system";
104 astronomical_body = "uranus";
106 }
107 else if (predefined_astronomical_body == astronomical_body::NEPTUNE)
108 {
109 galaxy = "milky-way";
110 solar_system = "solar-system";
111 astronomical_body = "neptune";
113 }
114 else if (predefined_astronomical_body == astronomical_body::CERES)
115 {
116 galaxy = "milky-way";
117 solar_system = "solar-system";
118 astronomical_body = "ceres";
120 }
121 else if (predefined_astronomical_body == astronomical_body::ORCUS)
122 {
123 galaxy = "milky-way";
124 solar_system = "solar-system";
125 astronomical_body = "orcus";
127 }
128 else if (predefined_astronomical_body == astronomical_body::PLUTO)
129 {
130 galaxy = "milky-way";
131 solar_system = "solar-system";
132 astronomical_body = "pluto";
134 }
135 else if (predefined_astronomical_body == astronomical_body::HAUMEA)
136 {
137 galaxy = "milky-way";
138 solar_system = "solar-system";
139 astronomical_body = "haumea";
141 }
142 else if (predefined_astronomical_body == astronomical_body::QUAOAR)
143 {
144 galaxy = "milky-way";
145 solar_system = "solar-system";
146 astronomical_body = "quaoar";
148 }
149 else if (predefined_astronomical_body == astronomical_body::MAKEMAKE)
150 {
151 galaxy = "milky-way";
152 solar_system = "solar-system";
153 astronomical_body = "makemake";
155 }
156 else if (predefined_astronomical_body == astronomical_body::GONGGONG)
157 {
158 galaxy = "milky-way";
159 solar_system = "solar-system";
160 astronomical_body = "gonggong";
162 }
163 else if (predefined_astronomical_body == astronomical_body::ERIS)
164 {
165 galaxy = "milky-way";
166 solar_system = "solar-system";
167 astronomical_body = "eris";
169 }
170 else if (predefined_astronomical_body == astronomical_body::SEDNA)
171 {
172 galaxy = "milky-way";
173 solar_system = "solar-system";
174 astronomical_body = "sedna";
176 }
177 else if (predefined_astronomical_body == astronomical_body::IO)
178 {
179 galaxy = "milky-way";
180 solar_system = "solar-system";
181 astronomical_body = "io";
183 }
184 else if (predefined_astronomical_body == astronomical_body::EUROPA)
185 {
186 galaxy = "milky-way";
187 solar_system = "solar-system";
188 astronomical_body = "europa";
190 }
191 else if (predefined_astronomical_body == astronomical_body::GANYMEDE)
192 {
193 galaxy = "milky-way";
194 solar_system = "solar-system";
195 astronomical_body = "ganymede";
197 }
198 else if (predefined_astronomical_body == astronomical_body::CALLISTO)
199 {
200 galaxy = "milky-way";
201 solar_system = "solar-system";
202 astronomical_body = "callisto";
204 }
205 else if (predefined_astronomical_body == astronomical_body::MIMAS)
206 {
207 galaxy = "milky-way";
208 solar_system = "solar-system";
209 astronomical_body = "mimas";
211 }
212 else if (predefined_astronomical_body == astronomical_body::ENCELADUS)
213 {
214 galaxy = "milky-way";
215 solar_system = "solar-system";
216 astronomical_body = "enceladus";
218 }
219 else if (predefined_astronomical_body == astronomical_body::TETHYS)
220 {
221 galaxy = "milky-way";
222 solar_system = "solar-system";
223 astronomical_body = "tethys";
225 }
226 else if (predefined_astronomical_body == astronomical_body::DIONE)
227 {
228 galaxy = "milky-way";
229 solar_system = "solar-system";
230 astronomical_body = "dione";
232 }
233 else if (predefined_astronomical_body == astronomical_body::RHEA)
234 {
235 galaxy = "milky-way";
236 solar_system = "solar-system";
237 astronomical_body = "rhea";
239 }
240 else if (predefined_astronomical_body == astronomical_body::TITAN)
241 {
242 galaxy = "milky-way";
243 solar_system = "solar-system";
244 astronomical_body = "titan";
246 }
247 else if (predefined_astronomical_body == astronomical_body::IAPETUS)
248 {
249 galaxy = "milky-way";
250 solar_system = "solar-system";
251 astronomical_body = "iapetus";
253 }
254 else if (predefined_astronomical_body == astronomical_body::MIRANDA)
255 {
256 galaxy = "milky-way";
257 solar_system = "solar-system";
258 astronomical_body = "miranda";
260 }
261 else if (predefined_astronomical_body == astronomical_body::ARIEL)
262 {
263 galaxy = "milky-way";
264 solar_system = "solar-system";
265 astronomical_body = "ariel";
267 }
268 else if (predefined_astronomical_body == astronomical_body::UMBRIEL)
269 {
270 galaxy = "milky-way";
271 solar_system = "solar-system";
272 astronomical_body = "umbriel";
274 }
275 else if (predefined_astronomical_body == astronomical_body::TITANIA)
276 {
277 galaxy = "milky-way";
278 solar_system = "solar-system";
279 astronomical_body = "titania";
281 }
282 else if (predefined_astronomical_body == astronomical_body::OBERON)
283 {
284 galaxy = "milky-way";
285 solar_system = "solar-system";
286 astronomical_body = "oberon";
288 }
289 else if (predefined_astronomical_body == astronomical_body::TRITON)
290 {
291 galaxy = "milky-way";
292 solar_system = "solar-system";
293 astronomical_body = "triton";
295 }
296 else if (predefined_astronomical_body == astronomical_body::CHARON)
297 {
298 galaxy = "milky-way";
299 solar_system = "solar-system";
300 astronomical_body = "charon";
302 }
303 else if (predefined_astronomical_body == astronomical_body::DYSNOMIA)
304 {
305 galaxy = "milky-way";
306 solar_system = "solar-system";
307 astronomical_body = "dysnomia";
309 }
310 }
aid()
Default constructor. The astronomical type is NONE, the other member-variables are empty strings.
Definition aid.cpp:13
@ IAPETUS
The moon of Saturn Iapetus.
@ DYSNOMIA
The moon of Eris Dysnomia.
@ ENCELADUS
The moon of Saturn Enceladus.
@ MILKY_WAY
The Milky Way galaxy.
@ MIMAS
The moon of Saturn Mimas.
@ CERES
The dwarf planet Ceres.
@ OBERON
The moon of Uranus Oberon.
@ RHEA
The moon of Saturn Rhea.
@ ANDROMEDA
The Andromeda galaxy, 2.5 million light years from Earth.
@ GANYMEDE
The moon of Jupiter Ganymede.
@ EUROPA
The moon of Jupiter Europa.
@ TITANIA
The moon of Uranus Titania.
@ SATURN
The planet Saturn.
@ MARS
The planet Mars.
@ HAUMEA
The dwarf planet Haumea.
@ MIRANDA
The moon of Uranus Miranda.
@ UMBRIEL
The moon of Uranus Umbriel.
@ QUAOAR
The dwarf planet Quaoar.
@ URANUS
The planet Uranus.
@ TITAN
The moon of Saturn Titan.
@ ERIS
The dwarf planet Eris.
@ GONGGONG
The possible dwarf planet Gonggong.
@ SUN
The Sun, the sun of the solar system of the Earth.
@ TRITON
The moon of Neptune Triton.
@ VENUS
The planet Venus.
@ ARIEL
The moon of Uranus Ariel.
@ JUPITER
The planet Jupiter.
@ NEPTUNE
The planet Neptune.
@ SEDNA
The minor body Sedna.
@ CALLISTO
The moon of Jupiter Callisto.
@ MERCURY
The planet Mercury.
@ TETHYS
The moon of Saturn Tethys.
@ NONE
No predefined astronomical body selected.
@ EARTH
The planet Earth.
@ DIONE
The moon of Saturn Dione.
@ CHARON
The moon of Pluto Charon.
@ PLUTO
The dwarf planet Pluto.
@ MAKEMAKE
The dwarf planet Makemake.
@ MOON
The Moon of the Earth.
@ IO
The moon of Jupiter Io.
@ ORCUS
The possible dwarf planet Orcus.
@ SOLAR_SYSTEM
The Solar System of the Earth.

◆ aid() [5/6]

scifir::aid::aid ( const aid::type new_astronomical_type,
const string new_astro1,
const string new_astro2 = "",
const string new_astro3 = "",
const string new_astro4 = "" 
)
explicit

Definition at line 312 of file aid.cpp.

313 {
314 if (new_astronomical_type == aid::UNIVERSE)
315 {
316 universe = new_astro1;
318 }
319 else if (new_astronomical_type == aid::GALAXY)
320 {
321 if (new_astro2 != "")
322 {
323 universe = new_astro2;
324 }
325 else
326 {
327 universe = "universe";
328 }
329 galaxy = new_astro1;
331 }
332 else if (new_astronomical_type == aid::SOLAR_SYSTEM)
333 {
334 if (new_astro3 != "")
335 {
336 universe = new_astro3;
337 }
338 else
339 {
340 universe = "universe";
341 }
342 galaxy = new_astro1;
343 solar_system = new_astro2;
345 }
346 else if (new_astronomical_type != aid::UNIVERSE and new_astronomical_type != aid::GALAXY and new_astronomical_type != aid::SOLAR_SYSTEM and new_astronomical_type != aid::NONE)
347 {
348 if (new_astro4 != "")
349 {
350 universe = new_astro4;
351 }
352 else
353 {
354 universe = "universe";
355 }
356 galaxy = new_astro1;
357 solar_system = new_astro2;
358 astronomical_body = new_astro3;
359 astronomical_type = new_astronomical_type;
360 }
361 }

◆ aid() [6/6]

aid::aid ( const string init_aid)
explicit

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.

363 : aid()
364 {
365 initialize_from_string(init_aid);
366 }
void initialize_from_string(const string &init_aid)
Internal function. Initializes the member-variables with an initialization string of aid.
Definition aid.cpp:444

Member Function Documentation

◆ display()

string aid::display ( ) const

Returns a string representation of aid.

Definition at line 540 of file aid.cpp.

541 {
543 {
544 ostringstream out;
545 out << "(" << to_string(astronomical_type) << ") ";
547 {
548 out << universe;
549 }
550 else if (astronomical_type == aid::GALAXY)
551 {
552 if (universe != "" and universe != "universe")
553 {
554 out << universe << ":";
555 }
556 out << galaxy;
557 }
559 {
560 if (universe != "" and universe != "universe")
561 {
562 out << universe << ":";
563 }
564 out << galaxy << ":" << solar_system;
565 }
566 else
567 {
568 if (universe != "" and universe != "universe")
569 {
570 out << universe << ":";
571 }
572 out << galaxy << ":" << solar_system << ":" << astronomical_body;
573 }
574 return out.str();
575 }
576 else
577 {
578 return "";
579 }
580 }
string to_string(const aid &x)
Creates a string representation of aid, it's for aid equivalent to the display() function of aid.
Definition aid.cpp:582

◆ has_no_galaxy()

bool scifir::aid::has_no_galaxy ( ) const

Definition at line 404 of file aid.cpp.

405 {
406 return (galaxy == "no-galaxy");
407 }

◆ has_no_solar_system()

bool scifir::aid::has_no_solar_system ( ) const

Definition at line 419 of file aid.cpp.

420 {
421 return (solar_system == "no-solar-system");
422 }

◆ has_no_universe()

bool scifir::aid::has_no_universe ( ) const

Definition at line 394 of file aid.cpp.

395 {
396 return (universe == "no-universe");
397 }

◆ has_unknown_asteroid()

bool aid::has_unknown_asteroid ( ) const

Returns true if the asteroid has the special value "unknown-asteroid".

Definition at line 439 of file aid.cpp.

440 {
441 return (astronomical_body == "unknown-asteroid");
442 }

◆ has_unknown_galaxy()

bool aid::has_unknown_galaxy ( ) const

Returns true if the galaxy has the special value "unknown-galaxy".

Definition at line 409 of file aid.cpp.

410 {
411 return (galaxy == "unknown-galaxy");
412 }

◆ has_unknown_moon()

bool aid::has_unknown_moon ( ) const

Returns true if the moon has the special value "unknown-moon".

Definition at line 429 of file aid.cpp.

430 {
431 return (astronomical_body == "unknown-moon");
432 }

◆ has_unknown_planet()

bool aid::has_unknown_planet ( ) const

Returns true if the planet has the special value "unknown-planet".

Definition at line 424 of file aid.cpp.

425 {
426 return (astronomical_body == "unknown-planet");
427 }

◆ has_unknown_solar_system()

bool aid::has_unknown_solar_system ( ) const

Returns true if the solar system has the special value "unknown-solar-system".

Definition at line 414 of file aid.cpp.

415 {
416 return (solar_system == "unknown-solar-system");
417 }

◆ has_unknown_star()

bool aid::has_unknown_star ( ) const

Returns true if the star has the special value "unknown-star".

Definition at line 434 of file aid.cpp.

435 {
436 return (astronomical_body == "unknown-star");
437 }

◆ has_unknown_universe()

bool aid::has_unknown_universe ( ) const

Returns true if the universe has the special value "unknown-universe".

Definition at line 399 of file aid.cpp.

400 {
401 return (universe == "unknown-universe");
402 }

◆ initialize_from_string()

void aid::initialize_from_string ( const string init_aid)
private

Internal function. Initializes the member-variables with an initialization string of aid.

Definition at line 444 of file aid.cpp.

445 {
446 vector<string> values;
447 boost::split(values,init_aid,boost::is_any_of(":"));
448 string aid_type;
449 if (values[0].front() == '(' and isalpha(values[0][1]))
450 {
451 string new_value1;
452 if (isalpha(values[0][2]))
453 {
454 astronomical_type = create_astronomical_type(values[0].substr(1,2));
455 if (values[0].at(4) != ' ')
456 {
457 new_value1 = values[0].substr(4);
458 }
459 else
460 {
461 new_value1 = values[0].substr(5);
462 }
463 }
464 else
465 {
466 astronomical_type = create_astronomical_type(values[0].substr(1,1));
467 if (values[0].at(3) != ' ')
468 {
469 new_value1 = values[0].substr(3);
470 }
471 else
472 {
473 new_value1 = values[0].substr(4);
474 }
475 }
477 {
478 if (values.size() == 4)
479 {
480 universe = new_value1;
481 galaxy = values[1];
482 solar_system = values[2];
483 astronomical_body = values[3];
484 }
485 else if (values.size() == 3)
486 {
487 universe = "universe";
488 galaxy = new_value1;
489 solar_system = values[1];
490 astronomical_body = values[2];
491 }
492 else
493 {
495 }
496 }
498 {
499 if (values.size() == 3)
500 {
501 universe = new_value1;
502 galaxy = values[1];
503 solar_system = values[2];
504 }
505 else if (values.size() == 2)
506 {
507 universe = "universe";
508 galaxy = new_value1;
509 solar_system = values[1];
510 }
511 else
512 {
514 }
515 }
516 else if (astronomical_type == aid::GALAXY)
517 {
518 if (values.size() == 2)
519 {
520 universe = new_value1;
521 galaxy = values[1];
522 }
523 else if (values.size() == 1)
524 {
525 universe = "universe";
526 galaxy = new_value1;
527 }
528 else
529 {
531 }
532 }
534 {
535 universe = new_value1;
536 }
537 }
538 }
aid::type create_astronomical_type(const string &astronomical_type_abbreviation)
Creates an instance of an aid::type with the given string, which is the reverse as the to_string() fu...
Definition aid.cpp:613

◆ operator=() [1/3]

aid & aid::operator= ( aid &&  x)

Move assignment. The member-variables are moved from the aid x.

Definition at line 378 of file aid.cpp.

379 {
380 universe = std::move(x.universe);
381 galaxy = std::move(x.galaxy);
382 solar_system = std::move(x.solar_system);
383 astronomical_body = std::move(x.astronomical_body);
384 astronomical_type = std::move(x.astronomical_type);
385 return *this;
386 }

◆ operator=() [2/3]

aid & aid::operator= ( const aid x)

Copy assignment. The member-variables are copied from the aid x.

Definition at line 368 of file aid.cpp.

369 {
370 universe = x.universe;
371 galaxy = x.galaxy;
372 solar_system = x.solar_system;
373 astronomical_body = x.astronomical_body;
374 astronomical_type = x.astronomical_type;
375 return *this;
376 }

◆ operator=() [3/3]

aid & aid::operator= ( const string init_aid)

Assignment operator with an initialization string of aid.

Definition at line 388 of file aid.cpp.

389 {
390 initialize_from_string(init_aid);
391 return *this;
392 }

Member Data Documentation

◆ astronomical_body

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.

Definition at line 45 of file aid.hpp.

◆ astronomical_type

aid::type aid::astronomical_type

The type of the astronomical body, which can be any value of the enum aid::type.

Definition at line 46 of file aid.hpp.

◆ galaxy

string aid::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.

Definition at line 43 of file aid.hpp.

◆ solar_system

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.

Definition at line 44 of file aid.hpp.

◆ universe

string aid::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.

Definition at line 42 of file aid.hpp.


The documentation for this class was generated from the following files: