2010-01-19 03:50:19 -06:00
|
|
|
/*
|
|
|
|
* 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 <map>
|
|
|
|
|
|
|
|
#include "Name.h"
|
|
|
|
#include "Parameters.h"
|
|
|
|
|
|
|
|
namespace OpenChams {
|
|
|
|
class Netlist;
|
|
|
|
class Net;
|
|
|
|
class Instance {
|
|
|
|
public:
|
2010-01-29 03:10:44 -06:00
|
|
|
Instance(Name name, Name model, Name mosType, bool, Netlist*);
|
2010-01-19 03:50:19 -06:00
|
|
|
|
|
|
|
void addConnector(Name);
|
|
|
|
void connect(Name connectorName, Name netName);
|
|
|
|
|
|
|
|
Instance* getInstance(Name);
|
|
|
|
|
|
|
|
inline void addParameter(Name, double);
|
|
|
|
inline Name getName();
|
|
|
|
inline Name getModel();
|
|
|
|
inline Name getMosType();
|
2010-01-29 03:10:44 -06:00
|
|
|
inline bool isSourceBulkConnected();
|
2010-01-19 03:50:19 -06:00
|
|
|
inline Parameters getParameters();
|
|
|
|
// pour parcourir les connecteurs
|
|
|
|
inline bool hasNoConnectors();
|
2010-01-29 03:10:44 -06:00
|
|
|
//inline map<Name, Net*>::iterator getFirstConnectorIt();
|
|
|
|
//inline map<Name, Net*>::iterator getLastConnectorIt();
|
|
|
|
inline const std::map<Name, Net*>& getConnectors();
|
2010-01-19 03:50:19 -06:00
|
|
|
|
2010-01-29 03:10:44 -06:00
|
|
|
private:
|
2010-01-19 03:50:19 -06:00
|
|
|
Name _name;
|
|
|
|
Name _model;
|
|
|
|
Name _mosType;
|
2010-01-29 03:10:44 -06:00
|
|
|
bool _sourceBulkConnected;
|
2010-01-19 03:50:19 -06:00
|
|
|
Netlist* _netlist;
|
|
|
|
Parameters _params;
|
2010-01-29 03:10:44 -06:00
|
|
|
std::map<Name, Net*> _netMap; //map associant nom de connecteur a un net
|
2010-01-19 03:50:19 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
inline void Instance::addParameter(Name name, double value) { _params.addParameter(name, value); };
|
|
|
|
inline Name Instance::getName() { return _name; };
|
|
|
|
inline Name Instance::getModel() { return _model; };
|
|
|
|
inline Name Instance::getMosType() { return _mosType; };
|
2010-01-29 03:10:44 -06:00
|
|
|
inline bool Instance::isSourceBulkConnected() { return _sourceBulkConnected; };
|
2010-01-19 03:50:19 -06:00
|
|
|
inline Parameters Instance::getParameters() { return _params; };
|
|
|
|
inline bool Instance::hasNoConnectors() { return (_netMap.size() == 0)? true : false; };
|
2010-01-29 03:10:44 -06:00
|
|
|
//inline map<Name, Net*>::iterator Instance::getFirstConnectorIt() { return _netMap.begin(); };
|
|
|
|
//inline map<Name, Net*>::iterator Instance::getLastConnectorIt() { return _netMap.end(); };
|
|
|
|
inline const std::map<Name, Net*>& Instance::getConnectors() { return _netMap; };
|
2010-01-19 03:50:19 -06:00
|
|
|
|
|
|
|
} // namespace
|
2010-01-26 09:05:20 -06:00
|
|
|
#endif
|
|
|
|
|