torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PortAttributes.cpp
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 HAVE_CONFIG_H
17 #include "torc/generic/config.h"
18 #endif
19 
20 #ifdef GENOM_SERIALIZATION
21 #include <boost/archive/binary_iarchive.hpp>
22 #include <boost/archive/binary_oarchive.hpp>
23 #endif //GENOM_SERIALIZATION
25 
26 namespace torc {
27 namespace generic {
28 
29 void PortAttributes::setUnused(const Value& inSource) {
30  mUnused = inSource;
31 }
32 
33 void PortAttributes::setDesignator(const Value& inSource) {
34  mDesignator = inSource;
35 }
36 
37 void PortAttributes::setAcLoad(const Value& inSource) {
38  mAcLoad = inSource;
39 }
40 
41 void PortAttributes::setPortDelay(const PortDelay& inSource) {
42  mPortDelay = inSource;
43  mPortDelaySet = true;
44 }
45 
46 void PortAttributes::setDcFaninLoad(const Value& inSource) {
47  mDcFaninLoad = inSource;
48 }
49 
50 void PortAttributes::setDcFanoutLoad(const Value& inSource) {
51  mDcFanoutLoad = inSource;
52 }
53 
54 void PortAttributes::setDcMaxFanin(const Value& inSource) {
55  mDcMaxFanin = inSource;
56 }
57 
58 void PortAttributes::setDcMaxFanout(const Value& inSource) {
59  mDcMaxFanout = inSource;
60 }
61 
62 PortAttributes::PortAttributes() : mDcFaninLoad(), mDcFanoutLoad(), mDcMaxFanin(), mDcMaxFanout(),
63  mAcLoad(), mPortDelay(), mPortDelaySet(false) {}
64 
66 
68  : mDcFaninLoad(inSource.mDcFaninLoad), mDcFanoutLoad(inSource.mDcFanoutLoad),
69  mDcMaxFanin(inSource.mDcMaxFanin), mDcMaxFanout(inSource.mDcMaxFanout),
70  mAcLoad(inSource.mAcLoad), mPortDelay(inSource.mPortDelay),
71  mPortDelaySet(inSource.mPortDelaySet) {}
72 
74  if(this != &inSource) {
75  mDcFaninLoad = inSource.mDcFaninLoad;
76  mDcFanoutLoad = inSource.mDcFanoutLoad;
77  mDcMaxFanin = inSource.mDcMaxFanin;
78  mDcMaxFanout = inSource.mDcMaxFanout;
79  mAcLoad = inSource.mAcLoad;
80  mPortDelay = inSource.mPortDelay;
81  mPortDelaySet = inSource.mPortDelaySet;
82  }
83  return *this;
84 }
85 
86 #ifdef GENOM_SERIALIZATION
87 template <class Archive> void PortAttributes::serialize(Archive& ar, unsigned int) {
88  ar & mDcFaninLoad;
89  ar & mDcFanoutLoad;
90  ar & mDcMaxFanin;
91  ar & mDcMaxFanout;
92  ar & mAcLoad;
93  ar & mPortDelay;
94  ar & mPortDelaySet;
95 }
96 
97 //TO SATISFY THE LINKER
98 template void PortAttributes::serialize<boost::archive::binary_iarchive>(
99  boost::archive::binary_iarchive& ar, const unsigned int);
100 
101 template void PortAttributes::serialize<boost::archive::binary_oarchive>(
102  boost::archive::binary_oarchive& ar, const unsigned int);
103 
104 #endif //GENOM_SERIALIZATION
105 
106 } // namespace generic
107 } // namespace torc
Represents attributes of a Port or PortReference object.
PortAttributes & operator=(const PortAttributes &inSource)
Represents the portDelay attribute on Port or PortReference.
Definition: PortDelay.hpp:36
void setUnused(const Value &inSource)
void setDcFaninLoad(const Value &inSource)
void setAcLoad(const Value &inSource)
void setDesignator(const Value &inSource)
void setDcMaxFanout(const Value &inSource)
void setPortDelay(const PortDelay &inSource)
void setDcFanoutLoad(const Value &inSource)
void setDcMaxFanin(const Value &inSource)