source: observatorio/simulacion/SimEscenariosEconomicos/good.C

simulacion
Last change on this file was 7941763, checked in by Alejandro <amujica@…>, 10 years ago

eliminacion de un filtro redundante

  • Property mode set to 100644
File size: 5.6 KB
Line 
1/*
2  Copyright (C) 2012
3  Alejandro Mujica (amujica@cenditel.gob.ve)
4  Erwin Paredes (eparedes@cenditel.gob.ve)
5  José Ruiz (jruiz@cenditel.gob.ve)
6  Rodolfo Rangel (rrangel@cenditel.gob.ve)
7  Julie Vera (jvera@cenditel.gob.ve)
8 
9  CENDITEL Fundación Centro Nacional de Desarrollo e Investigación en
10  Tecnologías Libres
11 
12  Este programa es software libre; Usted puede usarlo bajo los términos de la
13  licencia de software GPL versión 2.0 de la Free Software Foundation.
14 
15  Este programa se distribuye con la esperanza de que sea útil, pero SIN
16  NINGUNA GARANTÍA; tampoco las implícitas garantías de MERCANTILIDAD o
17  ADECUACIÓN A UN PROPÓSITO PARTICULAR.
18  Consulte la licencia GPL para más detalles. Usted debe recibir una copia
19  de la GPL junto con este programa; si no, escriba a la Free Software
20  Foundation Inc. 51 Franklin Street,5 Piso, Boston, MA 02110-1301, USA.
21*/
22
23/*
24  Autor:             Alejandro J. Mujica
25  Fecha de creación: 10/09/2013
26  Este archivo contiene la implementación de la clase Good.
27*/
28
29# include <good.H>
30
31Good::Good()
32    : id(-1), name("NULL"), technicalSpecifications("NULL"), tariffCode("NULL"),
33      measurementUnit("NULL"), trademark("NULL"), usedCapacity(0.0),
34      quantity(0.0), totalQuantity(0.0), unitarianPrice(0.0) {
35
36  // Empty
37}
38
39Good::Good(const Good & good)
40    : id(good.id), name(good.name),
41      technicalSpecifications(good.technicalSpecifications),
42      tariffCode(good.tariffCode), measurementUnit(good.measurementUnit),
43      trademark(good.trademark), usedCapacity(good.usedCapacity),
44      quantity(good.quantity), totalQuantity(good.totalQuantity),
45      unitarianPrice(good.unitarianPrice) {
46
47      // Empty
48}
49
50Good::Good(Good && good)
51    : id(-1), name("NULL"), technicalSpecifications("NULL"), tariffCode("NULL"),
52      measurementUnit("NULL"), trademark("NULL"), usedCapacity(0.0),
53      quantity(0.0), totalQuantity(0.0), unitarianPrice(0.0) {
54
55    std::swap(id, good.id);
56    std::swap(name, good.name);
57    std::swap(technicalSpecifications, good.technicalSpecifications);
58    std::swap(tariffCode, good.tariffCode);
59    std::swap(measurementUnit, good.measurementUnit);
60    std::swap(trademark, good.trademark);
61    std::swap(usedCapacity, good.usedCapacity);
62    std::swap(quantity, good.quantity);
63    std::swap(totalQuantity, good.totalQuantity);
64    std::swap(unitarianPrice, good.unitarianPrice);
65}
66
67Good::~Good() {
68  // Empty
69}
70
71const long & Good::getId() const {
72    return id;
73}
74
75void Good::setId(const long & id) {
76    this->id = id;
77}
78
79const std::string & Good::getName() const {
80    return name;
81}
82
83void Good::setName(const std::string & name) {
84    this->name = name;
85}
86
87void Good::setName(std::string && name) {
88    this->name = std::move(name);
89}
90
91const std::string & Good::getTechnicalSpecifications() const {
92    return technicalSpecifications;
93}
94
95void Good::setTechnicalSpecifications(
96    const std::string & technicalSpecifications) {
97    this->technicalSpecifications = technicalSpecifications;
98}
99
100void Good::setTechnicalSpecifications(std::string && technicalSpecifications) {
101    this->technicalSpecifications = std::move(technicalSpecifications);
102}
103
104const std::string & Good::getTariffCode() const {
105    return tariffCode;
106}
107
108void Good::setTariffCode(const std::string & tariffCode) {
109    this->tariffCode = tariffCode;
110}
111
112void Good::setTariffCode(std::string && tariffCode) {
113    this->tariffCode = std::move(tariffCode);
114}
115
116const std::string & Good::getMeasurementUnit() const {
117    return measurementUnit;
118}
119
120void Good::setMeasurementUnit(const std::string & measurementUnit) {
121    this->measurementUnit = measurementUnit;
122}
123
124void Good::setMeasurementUnit(std::string && measurementUnit) {
125    this->measurementUnit = std::move(measurementUnit);
126}
127
128const std::string & Good::getTrademark() const {
129    return trademark;
130}
131
132void Good::setTrademark(const std::string & trademark) {
133    this->trademark = trademark;
134}
135
136void Good::setTrademark(std::string && trademark) {
137    this->trademark = std::move(trademark);
138}
139
140const real & Good::getUsedCapacity() const {
141    return usedCapacity;
142}
143
144void Good::setUsedCapacity(const real & usedCapacity) {
145    this->usedCapacity = usedCapacity;
146}
147
148const real & Good::getQuantity() const {
149    return quantity;
150}
151
152void Good::setQuantity(const real & quantity) {
153    this->quantity = quantity;
154}
155
156const real & Good::getTotalQuantity() const {
157    return totalQuantity;
158}
159
160void Good::setTotalQuantity(const real & totalQuantity) {
161    this->totalQuantity = totalQuantity;
162}
163
164const real & Good::getUnitarianPrice() const {
165    return unitarianPrice;
166}
167
168void Good::setUnitarianPrice(const real & unitarianPrice) {
169    this->unitarianPrice = unitarianPrice;
170}
171
172Good & Good::operator = (const Good & good) {
173
174    if (&good == this)
175        return *this;
176
177    id = good.id;
178    name = good.name;
179    technicalSpecifications = good.technicalSpecifications;
180    tariffCode = good.tariffCode;
181    measurementUnit = good.measurementUnit;
182    trademark = good.trademark;
183    usedCapacity = good.usedCapacity;
184    quantity = good.quantity;
185    totalQuantity = good.totalQuantity;
186    unitarianPrice = good.unitarianPrice;
187
188    return *this;
189}
190
191Good & Good::operator = (Good && good) {
192
193    std::swap(id, good.id);
194    std::swap(name, good.name);
195    std::swap(technicalSpecifications, good.technicalSpecifications);
196    std::swap(tariffCode, good.tariffCode);
197    std::swap(measurementUnit, good.measurementUnit);
198    std::swap(trademark, good.trademark);
199    std::swap(usedCapacity, good.usedCapacity);
200    std::swap(quantity, good.quantity);
201    std::swap(totalQuantity, good.totalQuantity);
202    std::swap(unitarianPrice, good.unitarianPrice);
203
204    return *this;
205}
206
Note: See TracBrowser for help on using the repository browser.