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
31 #ifdef GENOM_SERIALIZATION
33 #endif //GENOM_SERIALIZATION
55 std::vector < size_t > limits;
56 limits.push_back(inSize);
57 return newInstanceArrayPtr(inName, inViewPtr, inMaster, limits, inFactory, inOriginalName);
83 create(newInstanceArray);
84 newInstanceArray->setName(inName);
86 newInstanceArray->constructChildren(inFactory, inLimits);
87 newInstanceArray->bindToMasterView(inMaster);
88 newInstanceArray->setOriginalName(inOriginalName);
89 inViewPtr->addInstance(newInstanceArray);
90 return newInstanceArray;
109 std::for_each(children.begin(), children.end(),
115 typedef std::vector<InstanceSharedPtr> Children;
117 getChildren(children);
118 Children::iterator child = children.begin();
119 Children::iterator cEnd = children.end();
120 for(; child != cEnd; ++child) {
122 (*child)->bindToMasterView(inMaster);
154 inCreatedChild)
const throw (
Error) {
155 inCreatedChild->setName(getName());
163 #ifdef GENOM_SERIALIZATION
164 template <
class Archive>
void InstanceArray::serialize(Archive& ar,
unsigned int) {
165 ar & boost::serialization::base_object<Instance>(*this);
166 ar & boost::serialization::base_object< BaseVectorType >(*this);
170 template void InstanceArray::serialize<boost::archive::binary_iarchive>(
171 boost::archive::binary_iarchive& ar,
const unsigned int);
173 template void InstanceArray::serialize<boost::archive::binary_oarchive>(
174 boost::archive::binary_oarchive& ar,
const unsigned int);
176 #endif //GENOM_SERIALIZATION
virtual void getCreatedChildren(List &outChildren) const
virtual void setPortReferences(const std::vector< PortReferenceSharedPtr > &inSource)
Represents an instantiation of a cell view in the view of another cell.
virtual InstanceArraySharedPtr newInstanceArrayPtr(const std::string &inName, const ViewSharedPtr &inViewPtr, const ViewSharedPtr &inMaster, const size_t &inSize, const ChildFactorySharedPtr &inFactory=BaseVectorType::ChildFactorySharedPtr(new BaseVectorType::ChildFactory()), const std::string &inOriginalName=std::string())
virtual void bindToMasterView(const ViewSharedPtr &inMaster, bool inMapPortReferences=true)
Represents a member of an instance array.
boost::shared_ptr< InstanceArray > InstanceArraySharedPtr
void runVisitor(_Tp &inoutVisited, BaseVisitor &inoutVisitor)
The Error object thrown by different methods of EdifOM.
virtual void addPortReference(const PortReferenceSharedPtr &inPortRef)
A base class for Visitor.
virtual void accept(BaseVisitor &inoutVisitor)
boost::shared_ptr< PortReference > PortReferenceSharedPtr
Represents an array of instances.
const boost::shared_ptr< View > getParent() const
virtual void onChildCreate(const boost::shared_ptr< BaseVectorType::ChildType > &inCreatedChild) const
virtual void getPortReferences(std::vector< PortReferenceSharedPtr > &) const
virtual void removePortReference(const std::string &inName)
boost::shared_ptr< InstanceArrayMember::Factory > ChildFactorySharedPtr
boost::shared_ptr< View > ViewSharedPtr
virtual PortReferenceSharedPtr findPortReference(const std::string &inPortRef)
virtual void setParent(const boost::shared_ptr< _ParentType > &inSource)
virtual void setParent(const ViewSharedPtr &inParent)
virtual void bindToMasterView(const ViewSharedPtr &inMaster, bool inMapPortReferences=true)
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)