23 #include <boost/bind.hpp>
24 #include <boost/mem_fn.hpp>
26 #ifdef GENOM_SERIALIZATION
27 #include <boost/archive/binary_iarchive.hpp>
28 #include <boost/archive/binary_oarchive.hpp>
29 #include <boost/serialization/list.hpp>
30 #include <boost/serialization/shared_ptr.hpp>
31 #endif //GENOM_SERIALIZATION
47 outNets.insert(outNets.end(), mConnectedNets.begin(), mConnectedNets.end());
61 Connection connection = mConnectedNets.insert(mConnectedNets.end(), inNet);
68 signalNetConnected()(inNet);
84 if(inConnection == mConnectedNets.end()) {
89 mConnectedNets.erase(inConnection);
96 signalNetDisconnected()(net);
112 disconnect(std::find_if(mConnectedNets.begin(), mConnectedNets.end(),
113 boost::bind<bool>(std::equal_to<std::string>(),
114 boost::bind(boost::mem_fn(&
Net::getName), _1), inName)));
129 disconnect(std::find(mConnectedNets.begin(), mConnectedNets.end(), inNet));
133 log(
"Disconnecting all\n");
134 std::vector<NetSharedPtr> nets;
136 for(std::vector<NetSharedPtr>::iterator it = nets.begin(); it != nets.end(); ++it) {
157 #ifdef GENOM_SERIALIZATION
158 template <
class Archive>
void Connectable::serialize(Archive& ar,
unsigned int) {
163 template void Connectable::serialize<boost::archive::binary_iarchive>(
164 boost::archive::binary_iarchive& ar,
const unsigned int);
166 template void Connectable::serialize<boost::archive::binary_oarchive>(
167 boost::archive::binary_oarchive& ar,
const unsigned int);
169 #endif //GENOM_SERIALIZATION
virtual Connection connect(const NetSharedPtr &inNet)=0
void log(const char *fmt,...)
std::list< NetSharedPtr >::iterator Connection
std::list< NetSharedPtr > mConnectedNets
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
virtual const std::string getName() const
virtual void onDisconnect()
void setCurrentLocation(const std::string &inFunction, const std::string &inFile, uint32_t inLine)