torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PortReference.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/base_object.hpp>
24 #include <boost/type_traits/is_abstract.hpp>
25 #endif //GENOM_SERIALIZATION
26 #include "torc/generic/Port.hpp"
28 
29 #ifdef GENOM_SERIALIZATION
31 #endif //GENOM_SERIALIZATION
32 namespace torc {
33 namespace generic {
34 
37 
39 
40 /**
41  * Set master port.
42  *
43  * @param[in] inSource Set the master port.
44  */
45 void PortReference::bindToMasterPort(const PortSharedPtr& inMaster) throw (Error) {
46  mMaster = inMaster;
47 }
48 
50  mAttributes = inSource;
51 }
53  return (mMaster) ? mMaster->getName() : std::string();
54 }
55 
56 #ifdef GENOM_SERIALIZATION
57 template <class Archive> void PortReference::serialize(Archive& ar, unsigned int) {
58  ar & boost::serialization::base_object<Connectable>(*this);
59  ar & boost::serialization::base_object<PropertyContainer>(*this);
60  ar & boost::serialization::base_object<Visitable>(*this);
61  ar & boost::serialization::base_object<Composite<PortReference> >(*this);
62  //Master and parent are reset during restore by parent
63 }
64 
65 //TO SATISFY THE LINKER
66 template void PortReference::serialize<boost::archive::binary_iarchive>(
67  boost::archive::binary_iarchive& ar, const unsigned int);
68 
69 template void PortReference::serialize<boost::archive::binary_oarchive>(
70  boost::archive::binary_oarchive& ar, const unsigned int);
71 
72 #endif //GENOM_SERIALIZATION
73 
74 } // namespace generic
75 } // namespace torc
Represents an instantiation of a cell view in the view of another cell.
An object that has a parent.
Represents the usable instance of a port of a cell in another cell.
Represents objects that have properties.
Interface for objects that can be composed within each other.
Definition: Composite.hpp:45
An object that is connectable to a Net.
Definition: Connectable.hpp:44
std::string string
boost::shared_ptr< PortAttributes > PortAttributesSharedPtr
The Error object thrown by different methods of EdifOM.
Definition: Error.hpp:41
virtual void bindToMasterPort(const PortSharedPtr &inMaster)
PortAttributesSharedPtr mAttributes
boost::shared_ptr< Port > PortSharedPtr
void setAttributes(const PortAttributesSharedPtr &inSource)
An object that receives an inoutVisitor.
Definition: Visitable.hpp:38