torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PortDelay.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 #include <boost/serialization/string.hpp>
24 #endif //GENOM_SERIALIZATION
26 
27 namespace torc {
28 namespace generic {
29 
30 void PortDelay::setDerivation(const Derivation& inSource) {
31  mDerivation = inSource;
32 }
33 
34 void PortDelay::setType(Type inSource) {
35  mType = inSource;
36 }
37 
38 void PortDelay::setDelay(const Value::MiNoMax& inSource) {
39  mDelay = inSource;
40 }
41 
42 void PortDelay::setAcLoad(const Value::MiNoMax& inSource) {
43  mAcLoad = inSource;
44 }
45 
47  mTransition = inSource;
48 }
49 
50 PortDelay::PortDelay() : mDerivation(eDerivationUndefined), mType(eTypeDelay), mDelay(), mAcLoad(),
51  mTransition() {}
52 
53 PortDelay::~PortDelay() throw () {}
54 
55 PortDelay::PortDelay(const PortDelay& source) : mDerivation(source.mDerivation),
56  mType(source.mType), mDelay(source.mDelay), mAcLoad(source.mAcLoad),
57  mTransition(source.mTransition) {}
58 
60  if(this != &source) {
61  mDerivation = source.mDerivation;
62  mType = source.mType;
63  mDelay = source.mDelay;
64  mAcLoad = source.mAcLoad;
65  mTransition = source.mTransition;
66  }
67  return *this;
68 }
69 
70 #ifdef GENOM_SERIALIZATION
71 template <class Archive> void PortDelay::serialize(Archive& ar, unsigned int) {
72  ar & mDerivation;
73  ar & mType;
74  ar & mDelay;
75  ar & mAcLoad;
76  ar & mTransition;
77 }
78 
79 //TO SATISFY THE LINKER
80 template void PortDelay::serialize<boost::archive::binary_iarchive>(
81  boost::archive::binary_iarchive& ar, const unsigned int);
82 
83 template void PortDelay::serialize<boost::archive::binary_oarchive>(
84  boost::archive::binary_oarchive& ar, const unsigned int);
85 
86 #endif //GENOM_SERIALIZATION
87 
88 } // namespace generic
89 } // namespace torc
LogicElementSharedPtr mTransition
Definition: PortDelay.hpp:137
Value::MiNoMax mDelay
Definition: PortDelay.hpp:135
boost::shared_ptr< LogicElement > LogicElementSharedPtr
Represents the portDelay attribute on Port or PortReference.
Definition: PortDelay.hpp:36
void setAcLoad(const Value::MiNoMax &inSource)
Definition: PortDelay.cpp:42
PortDelay & operator=(const PortDelay &source)
Definition: PortDelay.cpp:59
void setDelay(const Value::MiNoMax &inSource)
Definition: PortDelay.cpp:38
void setType(Type inSource)
Definition: PortDelay.cpp:34
void setDerivation(const Derivation &inSource)
Definition: PortDelay.cpp:30
Value::MiNoMax mAcLoad
Definition: PortDelay.hpp:136
void setTransition(const LogicElementSharedPtr &inSource)
Definition: PortDelay.cpp:46