/* * NetList.h * openChams * * Created by damien dupuis on 12/01/10. * Copyright 2010 UPMC / LIP6. All rights reserved. * */ #ifndef __OPENCHAMS_NETLIST_H__ #define __OPENCHAMS_NETLIST_H__ #include using namespace std; #include "Name.h" #include "Instance.h" #include "Net.h" namespace OpenChams { class Circuit; class Netlist { public: Netlist(Circuit*); void addInstance(Instance*); void addNet(Net*); Instance* getInstance(Name); Net* getNet(Name); //pour parcourir les vector inline bool hasNoInstances(); inline bool hasNoNets(); inline vector::iterator getFirstInstanceIt(); inline vector::iterator getLastInstanceIt(); inline vector::iterator getFirstNetIt(); inline vector::iterator getLastNetIt(); private: Circuit* _circuit; vector _instances; vector _nets; }; inline bool Netlist::hasNoInstances() { return (_instances.size() == 0)? true : false; } inline bool Netlist::hasNoNets() { return (_nets.size() == 0)? true : false; } inline vector::iterator Netlist::getFirstInstanceIt() { return _instances.begin(); } inline vector::iterator Netlist::getLastInstanceIt() { return _instances.end(); } inline vector::iterator Netlist::getFirstNetIt() { return _nets.begin(); } inline vector::iterator Netlist::getLastNetIt() { return _nets.end(); } } // namespace #endif