torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Parameter.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_PARAMETER_HPP
17 #define TORC_GENERIC_PARAMETER_HPP
18 
19 //BOOST
20 #ifdef GENOM_SERIALIZATION
21 #include <boost/serialization/access.hpp>
22 #endif //GENOM_SERIALIZATION
25 #include "torc/generic/Value.hpp"
26 #include "torc/generic/Unit.hpp"
29 
30 namespace torc {
31 namespace generic {
32 
33 /**
34  * @brief Represents a parameter object in EDIF.
35  *
36  * In EDIF, the Cell and Instance objects can have associated parameters. The parameters defined in a cell can be overridden during instanciation.
37  */
38 class Parameter : public virtual Composite<Parameter>, public Nameable, public Renamable,
39  public Visitable {
40 #ifdef GENOM_SERIALIZATION
41  friend class boost::serialization::access;
42 #endif //GENOM_SERIALIZATION
43 private:
46 
47 protected:
48  Parameter();
49 
50 public:
51  virtual ~Parameter() throw ();
52 
53 private:
54 #ifdef GENOM_SERIALIZATION
55  template <class Archive> void serialize(Archive& ar, unsigned int);
56 #endif //GENOM_SERIALIZATION
57  Parameter(const Parameter& source);
58  Parameter& operator=(const Parameter& source);
59 
60 public:
61  inline const Value getValue() const;
62 
63  void setValue(const Value& inSource);
64 
65  virtual const Unit getUnit() const;
66 
67  virtual void setUnit(const Unit& inSource);
68 
69 };
70 
71 inline const Value Parameter::getValue() const {
72  return mValue;
73 }
74 
75 } // namespace generic
76 } // namespace torc
77 
78 #endif // TORC_GENERIC_PARAMETER_HPP
const Value getValue() const
Definition: Parameter.hpp:71
void setValue(const Value &inSource)
Definition: Parameter.cpp:40
Interface for objects that can be composed within each other.
Definition: Composite.hpp:45
virtual void setUnit(const Unit &inSource)
Definition: Parameter.cpp:48
Represents a parameter object in EDIF.
Definition: Parameter.hpp:38
virtual const Unit getUnit() const
Definition: Parameter.cpp:44
Parameter & operator=(const Parameter &source)
An object that has a name.
Definition: Nameable.hpp:34
Represents objects that can be renamed.
An object that receives an inoutVisitor.
Definition: Visitable.hpp:38