coriolis/chamsin/src/technology/ATechnology.h

73 lines
2.6 KiB
C
Raw Normal View History

#ifndef ATECHNOLOGY_H_
#define ATECHNOLOGY_H_
2008-05-22 06:45:09 -05:00
#include "hurricane/Property.h"
using namespace Hurricane;
namespace Hurricane {
class Technology;
2008-05-19 14:32:21 -05:00
class Layer;
}
class ATechnology : public PrivateProperty {
2008-05-06 08:34:26 -05:00
public:
typedef PrivateProperty Inherit;
2008-05-06 08:34:26 -05:00
class PhysicalRule {
public:
2008-05-19 14:32:21 -05:00
PhysicalRule(const Name& name,
2008-05-06 08:34:26 -05:00
double value,
const string& reference):
2008-05-19 06:34:13 -05:00
_name(name),
_value(value),
_reference(reference) {}
2008-05-06 08:34:26 -05:00
PhysicalRule(const PhysicalRule& physicalRule):
2008-05-19 06:34:13 -05:00
_name(physicalRule._name),
_value(physicalRule._value),
_reference(physicalRule._reference) {}
2008-05-19 14:32:21 -05:00
const Name _name;
2008-05-19 06:34:13 -05:00
const double _value;
const string _reference;
double getValue() const { return _value; }
2008-05-06 08:34:26 -05:00
};
struct PhysicalRuleNameCompare:
public std::binary_function<const PhysicalRule*, const PhysicalRule*, bool> {
bool operator()(const PhysicalRule* pr1, const PhysicalRule* pr2) const {
return pr1->_name < pr2->_name;
}
};
typedef set<ATechnology::PhysicalRule*, PhysicalRuleNameCompare> PhysicalRules;
2008-05-19 14:32:21 -05:00
typedef map<Layer*, PhysicalRules> OneLayerPhysicalRules;
typedef pair<Layer*, Layer*> LayerPair;
typedef map<LayerPair, PhysicalRules> TwoLayersPhysicalRules;
static ATechnology* create(Hurricane::Technology* technology);
static ATechnology* getATechnology(Hurricane::Technology* technology);
2008-05-19 14:32:21 -05:00
const PhysicalRule* getPhysicalRule(const Name& name);
void addPhysicalRule(const Name& name, double value, const string& reference);
void addPhysicalRule(const Name& name, const Name& layerName, double value, const string& reference);
void addPhysicalRule(const Name& name, const Name& layer1Name,
const Name& layer2Name, double value, const string& reference);
Layer* getLayer(const Name& layerName);
void print();
2008-05-19 06:34:13 -05:00
virtual Name getName() const;
2008-05-19 06:34:13 -05:00
virtual string _getTypeName() const;
ATechnology():
Inherit(),
2008-05-19 14:32:21 -05:00
_noLayerPhysicalRules(),
_oneLayerPhysicalRules(),
_twoLayersPhysicalRules() {}
private:
2008-05-19 14:32:21 -05:00
PhysicalRules _noLayerPhysicalRules;
OneLayerPhysicalRules _oneLayerPhysicalRules;
TwoLayersPhysicalRules _twoLayersPhysicalRules;
};
2008-05-06 08:34:26 -05:00
#endif /* ATECHNOLOGY_H_*/