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
45 portBit.bindToMasterPort(childPort);
54 mMasterVector(inMasterVector) {
57 ~PortBinder() throw () {
83 std::vector < size_t > limits;
84 limits.push_back(inSize);
85 return newVectorPortReferencePtr(inInstancePtr, inPortPtr, limits, inParentCollection,
109 create(newVectorPortReference);
110 newVectorPortReference->constructChildren(inFactory, inLimits);
111 newVectorPortReference->bindToMasterPort(inPortPtr);
112 if(inParentCollection) {
113 inParentCollection->addChild(newVectorPortReference);
115 inInstancePtr->addPortReference(newVectorPortReference);
117 return newVectorPortReference;
137 std::for_each(children.begin(), children.end(),
160 if(inNet->getSize() != getSize()) {
175 return newConnection;
197 getCreatedChildren(children);
198 for_each(children.begin(), children.end(),
201 handler.disconnectPortRefFromNet(getSharedThis());
211 bool inSkipChildConnections)
const throw (
Error) {
213 if(!inSkipChildConnections) {
215 getCreatedChildren(children);
217 BaseType::List::iterator pRef = children.begin();
218 BaseType::List::iterator nEnd = children.end();
219 for(; pRef != nEnd; ++pRef) {
220 (*pRef)->getConnectedNets(outNets,
true);
240 PortBinder binder(masterPort);
245 inCreatedChild->accept(binder);
257 #ifdef GENOM_SERIALIZATION
258 template <
class Archive>
void
259 VectorPortReference::serialize(Archive& ar,
unsigned int) {
260 ar & boost::serialization::base_object< PortReference >(*this);
261 ar & boost::serialization::base_object< BaseType >(*this);
266 VectorPortReference::serialize<boost::archive::binary_iarchive>(
267 boost::archive::binary_iarchive& ar,
const unsigned int);
270 VectorPortReference::serialize<boost::archive::binary_oarchive>(
271 boost::archive::binary_oarchive& ar,
const unsigned int);
273 #endif //GENOM_SERIALIZATION
virtual void getCreatedChildren(List &outChildren) const
virtual Connection connect(const NetSharedPtr &inNet)=0
virtual void setParent(const InstanceSharedPtr &inParent)
An acyclic inoutVisitor implementation.
virtual Connectable::Connection connect(const NetSharedPtr &inNet)
boost::shared_ptr< Instance > InstanceSharedPtr
Represents a reference to a port array.
Represents the usable instance of a port of a cell in another cell.
boost::shared_ptr< VectorPortBitReference > VectorPortBitReferenceSharedPtr
virtual VectorPortReferenceSharedPtr newVectorPortReferencePtr(const InstanceSharedPtr &inInstancePtr, const PortSharedPtr &inPortPtr, const size_t &inSize, const PortBundleReferenceSharedPtr &inParentCollection=PortBundleReferenceSharedPtr(), const ChildFactorySharedPtr &inFactory=BaseType::ChildFactorySharedPtr(new BaseType::ChildFactory()))
std::list< NetSharedPtr >::iterator Connection
void connectPortRefToNet(const PortReferenceSharedPtr &inPort)
void runVisitor(_Tp &inoutVisited, BaseVisitor &inoutVisitor)
virtual void disconnect()
The Error object thrown by different methods of EdifOM.
virtual void getConnectedNets(std::vector< NetSharedPtr > &outNets, bool inSkipChildConnections=false) const
boost::shared_ptr< Net > NetSharedPtr
A base class for Visitor.
virtual void bindToMasterPort(const PortSharedPtr &inMaster)
const boost::shared_ptr< Instance > getParent() const
void saveContextData(const std::string &inName, const boost::any &inSource)
virtual void accept(BaseVisitor &inoutVisitor)
virtual void getConnectedNets(std::vector< NetSharedPtr > &outNets, bool inSkipChildConnections=false) const
Represents a reference to a bit of a port.
boost::shared_ptr< VectorPortBitReference::Factory > ChildFactorySharedPtr
boost::shared_ptr< Port > PortSharedPtr
virtual void setParent(const boost::shared_ptr< _ParentType > &inSource)
virtual void bindToMasterPort(const PortSharedPtr &inMaster)
boost::shared_ptr< VectorPortReference > VectorPortReferenceSharedPtr
virtual void onChildCreate(const VectorPortBitReferenceSharedPtr &inCreatedChild) const
boost::shared_ptr< PortBundleReference > PortBundleReferenceSharedPtr
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)