21 #include <boost/bind.hpp>
22 #ifdef GENOM_SERIALIZATION
23 #include <boost/archive/binary_iarchive.hpp>
24 #include <boost/archive/binary_oarchive.hpp>
25 #include <boost/serialization/is_abstract.hpp>
26 #include <boost/serialization/base_object.hpp>
27 #include <boost/serialization/shared_ptr.hpp>
28 #include <boost/serialization/list.hpp>
29 #endif //GENOM_SERIALIZATION
37 #ifdef GENOM_SERIALIZATION
39 #endif //GENOM_SERIALIZATION
45 View>(),
UserDataContainer(), mSubnets(), mConnectedPorts(), mConnectedPortLists(), mConnectedPortRefs(), mParentNet(), mAttributes() {}
51 log(
"Cannot propagate received error\n");
70 if(
false == mSubnets.set(name, inSubnet)) {
75 inSubnet->setParentNet(getSharedThis());
87 mSubnets.get(inName, subnet);
105 if(
false == mSubnets.remove(inName)) {
127 std::vector<NetSharedPtr>::const_iterator subnet = inSource.begin();
128 std::vector<NetSharedPtr>::const_iterator subEnd = inSource.end();
129 for(; subnet != subEnd; ++subnet) {
157 mConnectedPorts.push_back(inPort);
168 std::list<PortSharedPtr>::iterator it = find_if(
169 mConnectedPorts.begin(),
170 mConnectedPorts.end(),
171 boost::bind<bool>(std::equal_to<std::string>(),
173 if(it != mConnectedPorts.end()) {
180 bool inSkipChildConnections)
const {
186 std::list<PortSharedPtr>::iterator it = find(mConnectedPorts.begin(), mConnectedPorts.end(),
188 if(it != mConnectedPorts.end()) {
189 mConnectedPorts.erase(it);
200 std::vector<PortSharedPtr>::const_iterator port = inSource.begin();
201 std::vector<PortSharedPtr>::const_iterator portEnd = inSource.end();
202 for(; port != portEnd; ++port) {
204 addConnectedPort(*port);
222 mConnectedPortLists.push_back(inPortList);
227 std::list<PortListSharedPtr>::iterator it = find(mConnectedPortLists.begin(),
228 mConnectedPortLists.end(), inPortList);
229 if(it != mConnectedPortLists.end()) {
230 mConnectedPortLists.erase(it);
257 mConnectedPortRefs.push_back(inPortRef);
268 std::list<PortReferenceSharedPtr>::iterator it = find_if(
269 mConnectedPortRefs.begin(),
270 mConnectedPortRefs.end(),
271 boost::bind<bool>(std::equal_to<std::string>(),
273 if(it != mConnectedPortRefs.end()) {
280 bool inSkipChildConnections)
const {
286 std::list<PortReferenceSharedPtr>::iterator it = find(mConnectedPortRefs.begin(),
287 mConnectedPortRefs.end(), inPortRef);
288 if(it != mConnectedPortRefs.end()) {
289 mConnectedPortRefs.erase(it);
299 std::vector<PortReferenceSharedPtr>::const_iterator portRef = inSource.begin();
300 std::vector<PortReferenceSharedPtr>::const_iterator portRefEnd = inSource.end();
301 for(; portRef != portRefEnd; ++portRef) {
303 addConnectedPortReference(*portRef);
319 std::vector<PortSharedPtr> ports;
323 std::for_each(ports.begin(), ports.end(), boost::bind(fp, _1,
getSharedThis()));
324 std::vector<PortReferenceSharedPtr> portRefs;
326 std::for_each(portRefs.begin(), portRefs.end(), boost::bind(fp, _1,
getSharedThis()));
327 std::vector<PortListSharedPtr> portLists;
329 std::for_each(portLists.begin(), portLists.end(), boost::bind(fp, _1,
getSharedThis()));
333 #ifdef GENOM_SERIALIZATION
334 template <
class Archive>
void Net::serialize(Archive& ar,
unsigned int) {
335 ar & boost::serialization::base_object < Commentable > (*this);
336 ar & boost::serialization::base_object < Connectable > (*this);
337 ar & boost::serialization::base_object < Nameable > (*this);
338 ar & boost::serialization::base_object < PropertyContainer > (*this);
339 ar & boost::serialization::base_object < Renamable > (*this);
340 ar & boost::serialization::base_object < Visitable > (*this);
341 ar & boost::serialization::base_object < Composite<Net> > (*this);
348 template void Net::serialize<boost::archive::binary_iarchive>(boost::archive::binary_iarchive& ar,
351 template void Net::serialize<boost::archive::binary_oarchive>(boost::archive::binary_oarchive& ar,
354 #endif //GENOM_SERIALIZATION
void log(const char *fmt,...)
void removeConnectedPort(const PortSharedPtr &inPort)
An object that has a parent.
std::list< PortReferenceSharedPtr > mConnectedPortRefs
boost::shared_ptr< NetAttributes > NetAttributesSharedPtr
Represents objects that have properties.
void setParentNet(const NetSharedPtr &inParent)
Represents and EDIF View.
void setConnectedPorts(const std::vector< PortSharedPtr > &inSource)
Interface for objects that can be composed within each other.
void removeSubnet(const std::string &inName)
void removeConnectedPortReference(const PortReferenceSharedPtr &inPortRef)
An object that is connectable to a Net.
PortSharedPtr findConnectedPort(const std::string &inName)
PortReferenceSharedPtr findConnectedPortReference(const std::string &inName)
std::list< PortSharedPtr > mConnectedPorts
Represents class that can hold userData.
virtual void getConnectedPorts(std::vector< PortSharedPtr > &outPort, bool inSkipChildConnections=false) const
virtual void getConnectedPortRefs(std::vector< PortReferenceSharedPtr > &outPortRefs, bool inSkipChildConnections=false) const
void addSubnet(const NetSharedPtr &inSubnet)
virtual void disconnect()
The Error object thrown by different methods of EdifOM.
boost::shared_ptr< Net > NetSharedPtr
boost::shared_ptr< PortReference > PortReferenceSharedPtr
boost::shared_ptr< PortList > PortListSharedPtr
void saveContextData(const std::string &inName, const boost::any &inSource)
void addConnectedPort(const PortSharedPtr &inPort)
void addConnectedPortList(const PortListSharedPtr &inPort)
virtual void getConnectedPortLists(std::vector< PortListSharedPtr > &outPortList) const
virtual void disconnect()
NetAttributesSharedPtr mAttributes
NetSharedPtr findSubnet(const std::string &inName)
void removeConnectedPortList(const PortListSharedPtr &inList)
virtual const std::string getName() const
An object that has a name.
void setAttributes(const NetAttributesSharedPtr &inSource)
Pointer getSharedThis() const
boost::shared_ptr< Port > PortSharedPtr
Represents objects that can be renamed.
void setConnectedPortRefs(const std::vector< PortReferenceSharedPtr > &inSource)
SymTab< std::string, NetSharedPtr, true > mSubnets
void addConnectedPortReference(const PortReferenceSharedPtr &portRef)
std::list< PortListSharedPtr > mConnectedPortLists
void setSubnets(const std::vector< NetSharedPtr > &inSource)
An object that receives an inoutVisitor.
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)