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 | List of all members
scifir::address Class Reference

#include <address.hpp>

Collaboration diagram for scifir::address:
Collaboration graph
[legend]

Public Types

enum  type { EXTERNAL , INTERNAL }
 

Public Member Functions

 address ()
 
 address (const address &x)
 
 address (address &&x)
 
 address (const scifir::zid &new_zid, const string &new_location, const string &new_inner_location, const string &new_postal_code)
 
addressoperator= (const address &x)
 
addressoperator= (address &&x)
 
address::type get_type () const
 
string display () const
 
string partial_display () const
 
string text_display () const
 

Public Attributes

scifir::zid zid
 
string location
 
string inner_location
 
string postal_code
 

Detailed Description

Definition at line 14 of file address.hpp.

Member Enumeration Documentation

◆ type

Enumerator
EXTERNAL 
INTERNAL 

Definition at line 17 of file address.hpp.

Constructor & Destructor Documentation

◆ address() [1/4]

scifir::address::address ( )

Definition at line 7 of file address.cpp.

8 {}
string inner_location
Definition address.hpp:35
string location
Definition address.hpp:34
string postal_code
Definition address.hpp:36
scifir::zid zid
Definition address.hpp:33

◆ address() [2/4]

scifir::address::address ( const address x)

Definition at line 10 of file address.cpp.

10 : zid(x.zid),location(x.location),inner_location(x.inner_location),postal_code(x.postal_code)
11 {}

◆ address() [3/4]

scifir::address::address ( address &&  x)

Definition at line 13 of file address.cpp.

13 : zid(std::move(x.zid)),location(std::move(x.location)),inner_location(std::move(x.inner_location)),postal_code(std::move(x.postal_code))
14 {}

◆ address() [4/4]

scifir::address::address ( const scifir::zid new_zid,
const string new_location,
const string new_inner_location,
const string new_postal_code 
)
explicit

Definition at line 16 of file address.cpp.

16 : zid(new_zid),location(new_location),inner_location(new_inner_location),postal_code(new_postal_code)
17 {}

Member Function Documentation

◆ display()

string scifir::address::display ( ) const

Definition at line 49 of file address.cpp.

50 {
51 if (inner_location != "")
52 {
53 return zid + ", " + location + " " + inner_location;
54 }
55 else
56 {
57 return partial_display();
58 }
59 }
string partial_display() const
Definition address.cpp:61

◆ get_type()

address::type scifir::address::get_type ( ) const

Definition at line 37 of file address.cpp.

38 {
39 if (inner_location != "")
40 {
41 return address::INTERNAL;
42 }
43 else
44 {
45 return address::EXTERNAL;
46 }
47 }

◆ operator=() [1/2]

address & scifir::address::operator= ( address &&  x)

Definition at line 28 of file address.cpp.

29 {
30 zid = std::move(x.zid);
31 location = std::move(x.location);
32 inner_location = std::move(x.inner_location);
33 postal_code = std::move(x.postal_code);
34 return *this;
35 }

◆ operator=() [2/2]

address & scifir::address::operator= ( const address x)

Definition at line 19 of file address.cpp.

20 {
21 zid = x.zid;
22 location = x.location;
23 inner_location = x.inner_location;
24 postal_code = x.postal_code;
25 return *this;
26 }
zid()
Default constructor. There's no data about any zone, the aid member-variable is also empty.
Definition zid.cpp:12

◆ partial_display()

string scifir::address::partial_display ( ) const

Definition at line 61 of file address.cpp.

62 {
63 return location + " " + inner_location;
64 }

◆ text_display()

string scifir::address::text_display ( ) const

Definition at line 66 of file address.cpp.

67 {
68 ostringstream out;
69 out << zid << "\n";
70 out << location << "\n";
71 out << inner_location << "\n";
72 return out.str();
73 }

Member Data Documentation

◆ inner_location

string scifir::address::inner_location

Definition at line 35 of file address.hpp.

◆ location

string scifir::address::location

Definition at line 34 of file address.hpp.

◆ postal_code

string scifir::address::postal_code

Definition at line 36 of file address.hpp.

◆ zid

scifir::zid scifir::address::zid

Definition at line 33 of file address.hpp.


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