21 #include <boost/bind.hpp>
22 #include <boost/mem_fn.hpp>
23 #ifdef GENOM_SERIALIZATION
24 #include <boost/archive/binary_iarchive.hpp>
25 #include <boost/archive/binary_oarchive.hpp>
26 #include <boost/serialization/base_object.hpp>
27 #include <boost/serialization/export.hpp>
28 #endif //GENOM_SERIALIZATION
35 #ifdef GENOM_SERIALIZATION
37 #endif //GENOM_SERIALIZATION
51 inPortPtr->getParent()->applyOnAllPorts(
54 newPortBundleReference->bindToMasterPort(inPortPtr);
55 return newPortBundleReference;
78 if(getSize() != getMaster()->getSize()) {
84 if(inNet->getSize() != getSize()) {
94 flattener.getChildren(children);
101 for(; childPortRef != childEnd; ++childPortRef, ++net) {
103 (*childPortRef)->connect(*net);
118 return newConnection;
132 flattener.getChildren(children);
144 for(; childPortRef != childEnd; ++childPortRef, ++net) {
146 (*childPortRef)->disconnect(*net);
170 if(inMaster->getSize() != getSize()) {
177 #if 0 //Bind during reference creation
178 std::vector< PortReferenceSharedPtr > children;
179 getChildren(children);
180 std::vector< PortSharedPtr > childrenPort;
181 inMaster->getChildren(childrenPort);
182 std::vector< PortReferenceSharedPtr >::iterator pRef = children.begin();
183 std::vector< PortReferenceSharedPtr >::iterator pRefEnd = children.end();
184 std::vector< PortSharedPtr >::iterator pIt = childrenPort.begin();
185 for(; pRef != pRefEnd; ++pRef, ++pIt ) {
189 childRef->bindToMasterPort(childPort);
202 #ifdef GENOM_SERIALIZATION
203 template <
class Archive>
void PortBundleReference::serialize(Archive& ar,
unsigned int) {
204 ar & boost::serialization::base_object<PortReference >(*this);
205 ar & boost::serialization::base_object<Bundle<PortReference> >(*this);
209 template void PortBundleReference::serialize<boost::archive::binary_iarchive>(
210 boost::archive::binary_iarchive& ar,
const unsigned int);
212 template void PortBundleReference::serialize<boost::archive::binary_oarchive>(
213 boost::archive::binary_oarchive& ar,
const unsigned int);
215 #endif //GENOM_SERIALIZATION
virtual Connection connect(const NetSharedPtr &inNet)=0
boost::shared_ptr< Instance > InstanceSharedPtr
Represents areference to a standalone port.
Represents a reference to a port array.
_ReturnType getReturnValue() const
Represents the usable instance of a port of a cell in another cell.
virtual Connection connect(const NetSharedPtr &inNet)
std::list< NetSharedPtr >::iterator Connection
boost::shared_ptr< ObjectFactory > ObjectFactorySharedPtr
void connectPortRefToNet(const PortReferenceSharedPtr &inPort)
void runVisitor(_Tp &inoutVisited, BaseVisitor &inoutVisitor)
virtual void disconnect()
The Error object thrown by different methods of EdifOM.
boost::shared_ptr< Net > NetSharedPtr
A base class for Visitor.
virtual void bindToMasterPort(const PortSharedPtr &inMaster)
boost::shared_ptr< PortReference > PortReferenceSharedPtr
const boost::shared_ptr< Instance > getParent() const
void saveContextData(const std::string &inName, const boost::any &inSource)
void applyOnAllChildren(const _Action &action)
void disconnectPortRefFromNet(const PortReferenceSharedPtr &inPort)
virtual void accept(BaseVisitor &inoutVisitor)
virtual ~PortBundleReference()
Represents a reference to a bit of a port.
virtual void getChildren(List &outChildren) const
virtual void bindToMasterPort(const PortSharedPtr &inMaster)
boost::shared_ptr< Port > PortSharedPtr
virtual void setParent(const boost::shared_ptr< _ParentType > &inSource)
virtual void setParent(const InstanceSharedPtr &inParent)
Represents a reference to a bundle of ports.
Represents a "bundle" in the EDIF sense.
virtual PortBundleReferenceSharedPtr newPortBundleReferencePtr(const InstanceSharedPtr &inInstancePtr, const PortSharedPtr &inPortPtr, const ObjectFactorySharedPtr &inFactory, const PortBundleReferenceSharedPtr &inParentCollection=PortBundleReferenceSharedPtr())
boost::shared_ptr< PortBundleReference > PortBundleReferenceSharedPtr
Flatten a bundle to bits.
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)