/* * Instance.h * openChams * * Created by damien dupuis on 12/01/10. * Copyright 2010 UPMC / LIP6. All rights reserved. * */ #ifndef __OPENCHAMS_INSTANCE_H__ #define __OPENCHAMS_INSTANCE_H__ #include #include "Name.h" #include "Parameters.h" namespace OpenChams { class Netlist; class Net; class Instance { public: Instance(Name name, Name model, Name mosType, bool, Netlist*); void addConnector(Name); void connect(Name connectorName, Name netName); Instance* getInstance(Name); inline void addParameter(Name, double); inline void addParameter(Name, std::string); inline Name getName(); inline Name getModel(); inline Name getMosType(); inline bool isSourceBulkConnected(); inline Parameters getParameters(); // pour parcourir les connecteurs inline bool hasNoConnectors(); //inline map::iterator getFirstConnectorIt(); //inline map::iterator getLastConnectorIt(); inline const std::map& getConnectors(); private: Name _name; Name _model; Name _mosType; bool _sourceBulkConnected; Netlist* _netlist; Parameters _params; std::map _netMap; //map associant nom de connecteur a un net }; inline void Instance::addParameter(Name name, double value) { _params.addParameter(name, value); }; inline void Instance::addParameter(Name name, std::string eqStr) { _params.addParameter(name, eqStr); }; inline Name Instance::getName() { return _name; }; inline Name Instance::getModel() { return _model; }; inline Name Instance::getMosType() { return _mosType; }; inline bool Instance::isSourceBulkConnected() { return _sourceBulkConnected; }; inline Parameters Instance::getParameters() { return _params; }; inline bool Instance::hasNoConnectors() { return (_netMap.size() == 0)? true : false; }; //inline map::iterator Instance::getFirstConnectorIt() { return _netMap.begin(); }; //inline map::iterator Instance::getLastConnectorIt() { return _netMap.end(); }; inline const std::map& Instance::getConnectors() { return _netMap; }; } // namespace #endif