torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ScaleFactor.hpp
Go to the documentation of this file.
1 // Torc - Copyright 2011-2013 University of Southern California. All Rights Reserved.
2 // $HeadURL$
3 // $Id$
4 
5 // This program is free software: you can redistribute it and/or modify it under the terms of the
6 // GNU General Public License as published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
11 // the GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License along with this program. If
14 // not, see <http://www.gnu.org/licenses/>.
15 
16 #ifndef TORC_GENERIC_SCALEFACTOR_HPP
17 #define TORC_GENERIC_SCALEFACTOR_HPP
18 
19 //BOOST
20 #ifdef GENOM_SERIALIZATION
21 #include <boost/serialization/access.hpp>
22 #endif //GENOM_SERIALIZATION
23 #include "torc/generic/Value.hpp"
24 
25 namespace torc {
26 namespace generic {
27 
28 /**
29  * Represents the technology dependent scale factor. This is used by clients to perform
30  * calculations using the units involved.
31  */
32 class ScaleFactor {
33 #ifdef GENOM_SERIALIZATION
34  friend class boost::serialization::access;
35 #endif //GENOM_SERIALIZATION
36 public:
37  /**
38  * Get the EDIF scale.
39  *
40  * @return EDIF scale.
41  */
42  inline const Value::Number getEdifValue() const;
43 
44  /**
45  * Set the EDIF scale.
46  *
47  * @param[in] inSource EDIF scale.
48  */
49  void setEdifValue(const Value::Number& inSource);
50 
51  /**
52  * Get the SI untis scale.
53  *
54  * @return SI scale.
55  */
56  inline const Value::Number getSiValue() const;
57 
58  /**
59  * Set the SI scale.
60  *
61  */
62  void setSiValue(const Value::Number& inSource);
63 
64  ScaleFactor();
65 
66  ScaleFactor(const ScaleFactor& inSource);
67 
68  ~ScaleFactor();
69 
70  ScaleFactor& operator =(const ScaleFactor& inSource);
71 
72 private:
73 #ifdef GENOM_SERIALIZATION
74  template <class Archive> void serialize(Archive& ar, unsigned int);
75 #endif //GENOM_SERIALIZATION
78 };
79 
80 /**
81  * Get the EDIF scale.
82  *
83  * @return EDIF scale.
84  */
86  return mEdifValue;
87 }
88 
89 /**
90  * Get the SI untis scale.
91  *
92  * @return SI scale.
93  */
94 inline const Value::Number ScaleFactor::getSiValue() const {
95  return mSiValue;
96 }
97 
98 } // namespace generic
99 } // namespace torc
100 
101 #endif // TORC_GENERIC_SCALEFACTOR_HPP
const Value::Number getSiValue() const
Definition: ScaleFactor.hpp:94
const Value::Number getEdifValue() const
Definition: ScaleFactor.hpp:85
ScaleFactor & operator=(const ScaleFactor &inSource)
Definition: ScaleFactor.cpp:54
void setSiValue(const Value::Number &inSource)
Definition: ScaleFactor.cpp:43
void setEdifValue(const Value::Number &inSource)
Definition: ScaleFactor.cpp:35