22 #include <boost/bind.hpp>
23 #include <boost/mem_fn.hpp>
24 #ifdef GENOM_SERIALIZATION
25 #include <boost/archive/binary_iarchive.hpp>
26 #include <boost/archive/binary_oarchive.hpp>
27 #include <boost/serialization/base_object.hpp>
28 #include <boost/serialization/export.hpp>
29 #endif //GENOM_SERIALIZATION
36 #ifdef GENOM_SERIALIZATION
38 #endif //GENOM_SERIALIZATION
59 std::vector < size_t > limits;
60 limits.push_back(inSize);
61 return newVectorPortPtr(inName, inDirection, inViewPtr, limits, inParentCollection,
62 inFactory, inOriginalName);
87 create(newVectorPort);
88 newVectorPort->setName(inName);
89 newVectorPort->setDirection(inDirection);
90 newVectorPort->constructChildren(inFactory,
92 newVectorPort->setOriginalName(inOriginalName);
93 if(inParentCollection) {
94 inParentCollection->addChild(newVectorPort);
96 inViewPtr->addPort(newVectorPort);
117 std::for_each(children.begin(), children.end(),
137 if(inNet->getSize() != getSize()) {
152 return newConnection;
184 bool inSkipChildConnections)
const throw (
Error) {
186 if(!inSkipChildConnections) {
188 getCreatedChildren(children);
190 BaseVectorType::List::iterator port = children.begin();
191 BaseVectorType::List::iterator pEnd = children.end();
192 for(; port != pEnd; ++port) {
193 (*port)->getConnectedNets(outNets,
true);
200 const boost::shared_ptr<BaseVectorType::ChildType>& inCreatedChild)
const throw (
Error) {
201 inCreatedChild->setName(getName());
211 #ifdef GENOM_SERIALIZATION
212 template <
class Archive>
void VectorPort::serialize(Archive& ar,
unsigned int) {
213 ar & boost::serialization::base_object<Port>(*this);
214 ar & boost::serialization::base_object<BaseVectorType>(*this);
218 template void VectorPort::serialize<boost::archive::binary_iarchive>(
219 boost::archive::binary_iarchive& ar,
const unsigned int);
221 template void VectorPort::serialize<boost::archive::binary_oarchive>(
222 boost::archive::binary_oarchive& ar,
const unsigned int);
224 #endif //GENOM_SERIALIZATION
virtual void getCreatedChildren(List &outChildren) const
virtual Connection connect(const NetSharedPtr &inNet)=0
void log(const char *fmt,...)
void disconnectPortFromNet(const PortSharedPtr &inPort)
boost::shared_ptr< PortBundle > PortBundleSharedPtr
std::list< NetSharedPtr >::iterator Connection
void runVisitor(_Tp &inoutVisited, BaseVisitor &inoutVisitor)
boost::shared_ptr< VectorPort > VectorPortSharedPtr
virtual void disconnect()
void connectPortToNet(const PortSharedPtr &inPort)
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
virtual VectorPortSharedPtr newVectorPortPtr(const std::string &inName, const EPortDirection &inDirection, const ViewSharedPtr &inViewPtr, const size_t &inSize, const PortBundleSharedPtr &inParentCollection=PortBundleSharedPtr(), const ChildFactorySharedPtr &inFactory=BaseVectorType::ChildFactorySharedPtr(new BaseVectorType::ChildFactory()), const std::string &inOriginalName=std::string())
A base class for Visitor.
const boost::shared_ptr< View > getParent() const
void saveContextData(const std::string &inName, const boost::any &inSource)
virtual void onChildCreate(const boost::shared_ptr< BaseVectorType::ChildType > &inCreatedChild) const
virtual void getConnectedNets(std::vector< NetSharedPtr > &outNets, bool inSkipChildConnections=false) const
boost::shared_ptr< VectorPortBit::Factory > ChildFactorySharedPtr
Interface for an EDIF port object.
boost::shared_ptr< View > ViewSharedPtr
virtual void setParent(const ViewSharedPtr &inParent)
virtual void setParent(const boost::shared_ptr< _ParentType > &inSource)
virtual void accept(BaseVisitor &inoutVisitor)
virtual Connectable::Connection connect(const NetSharedPtr &inNet)
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)