1 | /* |
---|
2 | Copyright (C) 2014 |
---|
3 | Alejandro Mujica (amujica@cenditel.gob.ve) |
---|
4 | José Ruiz (jruiz@cenditel.gob.ve) |
---|
5 | Julie Vera (jvera@cenditel.gob.ve) |
---|
6 | |
---|
7 | CENDITEL Fundación Centro Nacional de Desarrollo e Investigación en |
---|
8 | Tecnologías Libres |
---|
9 | |
---|
10 | Este programa es software libre; Usted puede usarlo bajo los términos de la |
---|
11 | licencia de software GPL versión 2.0 de la Free Software Foundation. |
---|
12 | |
---|
13 | Este programa se distribuye con la esperanza de que sea útil, pero SIN |
---|
14 | NINGUNA GARANTÍA; tampoco las implícitas garantías de MERCANTILIDAD o |
---|
15 | ADECUACIÓN A UN PROPÓSITO PARTICULAR. |
---|
16 | Consulte la licencia GPL para más detalles. Usted debe recibir una copia |
---|
17 | de la GPL junto con este programa; si no, escriba a la Free Software |
---|
18 | Foundation Inc. 51 Franklin Street,5 Piso, Boston, MA 02110-1301, USA. |
---|
19 | */ |
---|
20 | |
---|
21 | /* |
---|
22 | Autor: Alejandro J. Mujica |
---|
23 | Fecha de creación: 09/06/2014 |
---|
24 | Este archivo contiene la implementación de la abstracción de empresa o unidad |
---|
25 | económica. |
---|
26 | */ |
---|
27 | |
---|
28 | # include <company.H> |
---|
29 | |
---|
30 | Company::Company() |
---|
31 | : rif(), name(), working_day(0) |
---|
32 | { |
---|
33 | // Empty |
---|
34 | } |
---|
35 | |
---|
36 | Company::Company(const Company & company) |
---|
37 | : rif(company.rif), name(company.name), working_day(company.working_day) |
---|
38 | { |
---|
39 | // Empty |
---|
40 | } |
---|
41 | |
---|
42 | Company::Company(Company && company) |
---|
43 | : rif(), name(), working_day(0) |
---|
44 | { |
---|
45 | std::swap(rif, company.rif); |
---|
46 | std::swap(name, company.name); |
---|
47 | std::swap(working_day, company.working_day); |
---|
48 | } |
---|
49 | |
---|
50 | const std::string & Company::get_rif() const |
---|
51 | { |
---|
52 | return rif; |
---|
53 | } |
---|
54 | |
---|
55 | void Company::set_rif(const std::string & _rif) |
---|
56 | { |
---|
57 | rif = _rif; |
---|
58 | } |
---|
59 | |
---|
60 | void Company::set_rif(std::string && _rif) |
---|
61 | { |
---|
62 | rif = std::move(_rif); |
---|
63 | } |
---|
64 | |
---|
65 | const std::string & Company::get_name() const |
---|
66 | { |
---|
67 | return name; |
---|
68 | } |
---|
69 | |
---|
70 | void Company::set_name(const std::string & _name) |
---|
71 | { |
---|
72 | name = _name; |
---|
73 | } |
---|
74 | |
---|
75 | void Company::set_name(std::string && _name) |
---|
76 | { |
---|
77 | name = std::move(_name); |
---|
78 | } |
---|
79 | |
---|
80 | const real & Company::get_working_day() const |
---|
81 | { |
---|
82 | return working_day; |
---|
83 | } |
---|
84 | |
---|
85 | void Company::set_working_day(const real & _working_day) |
---|
86 | { |
---|
87 | working_day = _working_day; |
---|
88 | } |
---|
89 | |
---|
90 | Company & Company::operator = (const Company & company) |
---|
91 | { |
---|
92 | if (&company == this) |
---|
93 | return *this; |
---|
94 | |
---|
95 | rif = company.rif; |
---|
96 | name = company.name; |
---|
97 | working_day = company.working_day; |
---|
98 | |
---|
99 | return *this; |
---|
100 | } |
---|
101 | |
---|
102 | Company & Company::operator = (Company && company) |
---|
103 | { |
---|
104 | std::swap(rif, company.rif); |
---|
105 | std::swap(name, company.name); |
---|
106 | std::swap(working_day, company.working_day); |
---|
107 | |
---|
108 | return *this; |
---|
109 | } |
---|
110 | |
---|