cleaning in progress in Hurricane

This commit is contained in:
Christophe Alexandre 2008-03-17 13:54:33 +00:00
parent 001c6323f5
commit af0c4a4609
206 changed files with 10167 additions and 10784 deletions

View File

@ -69,7 +69,7 @@ void CellEditor::zoomOut() {
void CellEditor::fitToWindow() {
if (cell) {
Box area(cell->GetBoundingBox());
Box area(cell->getBoundingBox());
QRectF rect;
boxToRectangle(area, rect);
view->fitInView(rect);

View File

@ -12,19 +12,19 @@ using namespace H;
#include "CellGraphicsItem.h"
CellGraphicsItem::CellGraphicsItem(Cell* c):
QGraphicsItem(),
cell(c) {
//QTransform transform;
//transform.setMatrix(1.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 1.0);
//setTransform(transform);
//for_each_instance(instance, cell->GetInstances()) {
// new InstanceGraphicsItem(this, instance);
// end_for;
//}
QGraphicsItem(),
cell(c) {
//QTransform transform;
//transform.setMatrix(1.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 1.0);
//setTransform(transform);
//for_each_instance(instance, cell->getInstances()) {
// new InstanceGraphicsItem(this, instance);
// end_for;
//}
unsigned zValue = 10;
for_each_slice(slice, cell->GetSlices()) {
for_each_go(go, slice->GetGos()) {
for_each_slice(slice, cell->getSlices()) {
for_each_go(go, slice->getGos()) {
Segment* segment = dynamic_cast<Segment*>(go);
if (segment) {
SegmentGraphicsItem* segmentItem = new SegmentGraphicsItem(this, segment);
@ -38,43 +38,43 @@ CellGraphicsItem::CellGraphicsItem(Cell* c):
}
CellGraphicsItem::CellGraphicsItem(InstanceGraphicsItem* master, Cell* c) : QGraphicsItem(master), cell(c) {
//for_each_instance(instance, cell->GetInstances()) {
// new InstanceGraphicsItem(this, instance);
// end_for;
//}
//for_each_slice(slice, cell->GetSlices()) {
// new SliceFigure(this, slice);
// end_for;
//}
//for_each_instance(instance, cell->getInstances()) {
// new InstanceGraphicsItem(this, instance);
// end_for;
//}
//for_each_slice(slice, cell->getSlices()) {
// new SliceFigure(this, slice);
// end_for;
//}
}
QRectF CellGraphicsItem::boundingRect() const {
Box box = cell->GetBoundingBox();
QRectF rect;
boxToRectangle(box, rect);
//rect = transform().mapRect(rect);
return rect;
Box box = cell->getBoundingBox();
QRectF rect;
boxToRectangle(box, rect);
//rect = transform().mapRect(rect);
return rect;
}
void CellGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem* option, QWidget *) {
painter->setClipRect(option->exposedRect);
drawBoundary(painter);
//drawPhantom(painter);
painter->setClipRect(option->exposedRect);
drawBoundary(painter);
//drawPhantom(painter);
}
void CellGraphicsItem::drawBoundary(QPainter* painter) {
QPen pen(Qt::black);
painter->setPen(pen);
Box box = cell->GetAbutmentBox();
QRectF rect;
boxToRectangle(box, rect);
painter->drawRect(rect);
QPen pen(Qt::black);
painter->setPen(pen);
Box box = cell->getAbutmentBox();
QRectF rect;
boxToRectangle(box, rect);
painter->drawRect(rect);
}
void CellGraphicsItem::drawPhantom(QPainter* painter) {
painter->setBrush(Qt::red);
Box box = cell->GetAbutmentBox();
QRectF rect;
boxToRectangle(box, rect);
painter->drawRect(rect);
painter->setBrush(Qt::red);
Box box = cell->getAbutmentBox();
QRectF rect;
boxToRectangle(box, rect);
painter->drawRect(rect);
}

View File

@ -13,9 +13,9 @@ using namespace H;
//InstanceGraphicsItem::InstanceGraphicsItem(Instance* inst)
// : instance(inst),
// cell(instance->GetMasterCell())
// cell(instance->getMasterCell())
//{
// Transformation transformation = instance->GetTransformation();
// Transformation transformation = instance->getTransformation();
// QTransform transform;
// QPoint pos;
// HurricanePositionToQtPosition(transformation, transform, pos);
@ -34,9 +34,9 @@ InstanceGraphicsItem::InstanceGraphicsItem(Cell* c)
//InstanceGraphicsItem::InstanceGraphicsItem(InstanceGraphicsItem* parent, Instance* inst)
// : QGraphicsItem(parent),
// instance(inst),
// cell(instance->GetMasterCell())
// cell(instance->getMasterCell())
//{
// Transformation transformation = instance->GetTransformation();
// Transformation transformation = instance->getTransformation();
// QTransform transform;
// QPoint pos;
// HurricanePositionToQtPosition(transformation, transform, pos);
@ -46,14 +46,14 @@ InstanceGraphicsItem::InstanceGraphicsItem(Cell* c)
//}
void InstanceGraphicsItem::constructSubInstances() {
for_each_instance(instance, cell->GetInstances()) {
for_each_instance(instance, cell->getInstances()) {
//new InstanceGraphicsItem(this, instance);
end_for;
}
}
QRectF InstanceGraphicsItem::boundingRect() const {
Box box = cell->GetAbutmentBox();
Box box = cell->getAbutmentBox();
QRectF rect;
boxToRectangle(box, rect);
return rect;
@ -62,29 +62,29 @@ QRectF InstanceGraphicsItem::boundingRect() const {
void InstanceGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
painter->setClipRect(option->exposedRect.adjusted(-1.0, -1.0, 1.0, 1.0));
if (option->levelOfDetail > 1.0) {
drawBoundary(painter);
drawElements(painter);
drawBoundary(painter);
drawElements(painter);
} else {
drawPhantom(painter);
drawPhantom(painter);
}
}
void InstanceGraphicsItem::drawElements(QPainter* painter) {
for_each_slice(slice, cell->GetSlices()) {
for_each_slice(slice, cell->getSlices()) {
painter->save();
BasicLayer* layer = dynamic_cast<BasicLayer*>(slice->GetLayer());
BasicLayer* layer = dynamic_cast<BasicLayer*>(slice->getLayer());
if (layer) {
painter->setBrush(QColor(layer->getRedValue(), layer->getGreenValue(), layer->getBlueValue()));
} else {
painter->setBrush(Qt::blue);
}
for_each_go(go, slice->GetGos()) {
for_each_go(go, slice->getGos()) {
Segment* segment = dynamic_cast<Segment*>(go);
if (segment) {
Box box = segment->GetBoundingBox();
QRectF rect;
boxToRectangle(box, rect);
painter->drawRect(rect);
Box box = segment->getBoundingBox();
QRectF rect;
boxToRectangle(box, rect);
painter->drawRect(rect);
}
end_for;
@ -97,7 +97,7 @@ void InstanceGraphicsItem::drawElements(QPainter* painter) {
void InstanceGraphicsItem::drawBoundary(QPainter* painter) {
QPen pen(Qt::black);
painter->setPen(pen);
Box box = cell->GetAbutmentBox();
Box box = cell->getAbutmentBox();
QRectF rect;
boxToRectangle(box, rect);
painter->drawRect(rect);
@ -105,7 +105,7 @@ void InstanceGraphicsItem::drawBoundary(QPainter* painter) {
void InstanceGraphicsItem::drawPhantom(QPainter* painter) {
painter->setBrush(Qt::red);
Box box = cell->GetAbutmentBox();
Box box = cell->getAbutmentBox();
QRectF rect;
boxToRectangle(box, rect);
painter->drawRect(rect);

View File

@ -66,7 +66,7 @@ SegmentGraphicsItem::SegmentGraphicsItem(CellGraphicsItem* master, Segment* s):
}
QRectF SegmentGraphicsItem::boundingRect() const {
Box box = segment->GetBoundingBox();
Box box = segment->getBoundingBox();
QRectF rect;
boxToRectangle(box, rect);
return rect;
@ -75,10 +75,10 @@ QRectF SegmentGraphicsItem::boundingRect() const {
void SegmentGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
//if (option->levelOfDetail > 1.0) {
painter->setClipRect(option->exposedRect);
Box box = segment->GetBoundingBox();
Box box = segment->getBoundingBox();
QRectF rect;
boxToRectangle(box, rect);
BasicLayer* blayer = dynamic_cast<BasicLayer*>(segment->GetLayer());
BasicLayer* blayer = dynamic_cast<BasicLayer*>(segment->getLayer());
if (blayer) {
QColor layerColor(blayer->getRedValue(),
blayer->getGreenValue(),
@ -86,14 +86,14 @@ void SegmentGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsIte
QBrush brush(layerColor);
brush.setStyle(Qt::Dense1Pattern);
painter->setBrush(brush);
//painter->setBrush(getBrush(blayer->GetFillPattern(),
// blayer->GetRedValue(),
// blayer->GetGreenValue(),
// blayer->GetBlueValue()));
//painter->setBrush(getBrush(blayer->getFillPattern(),
// blayer->getRedValue(),
// blayer->getGreenValue(),
// blayer->getBlueValue()));
painter->setPen(layerColor);
painter->drawRect(rect);
} else {
CompositeLayer* clayer = dynamic_cast<CompositeLayer*>(segment->GetLayer());
CompositeLayer* clayer = dynamic_cast<CompositeLayer*>(segment->getLayer());
if (clayer) {
for_each_basic_layer(basiclayer, clayer->getBasicLayers()) {
QColor layerColor(basiclayer->getRedValue(),
@ -102,10 +102,10 @@ void SegmentGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsIte
QBrush brush(layerColor);
brush.setStyle(Qt::Dense1Pattern);
painter->setBrush(brush);
//painter->setBrush(getBrush(basiclayer->GetFillPattern(),
// basiclayer->GetRedValue(),
// basiclayer->GetGreenValue(),
// basiclayer->GetBlueValue()));
//painter->setBrush(getBrush(basiclayer->getFillPattern(),
// basiclayer->getRedValue(),
// basiclayer->getGreenValue(),
// basiclayer->getBlueValue()));
painter->setPen(layerColor);
painter->drawRect(rect);
end_for;

View File

@ -8,16 +8,16 @@
using namespace H;
inline void boxToRectangle(const Box& box, QRectF& rec) {
double xmin = GetValue(box.getXMin());
double xmax = GetValue(box.getXMax());
double ymin = GetValue(box.getYMin());
double ymax = GetValue(box.getYMax());
double xmin = getValue(box.getXMin());
double xmax = getValue(box.getXMax());
double ymin = getValue(box.getYMin());
double ymax = getValue(box.getYMax());
rec.setCoords(xmin, ymin, xmax, ymax);
}
inline void hurricanePositionToQtPosition(const Transformation& transformation, QTransform& transform, QPoint& position) {
double tx = GetValue(transformation.getTx());
double ty = GetValue(transformation.getTy());
double tx = getValue(transformation.getTx());
double ty = getValue(transformation.getTy());
position.setX((int)tx);
position.setY((int)ty);

View File

@ -37,14 +37,14 @@ class BasicLayer_BasicLayers : public Collection<BasicLayer*> {
public: Locator& operator=(const Locator& locator);
public: virtual BasicLayer* GetElement() const;
public: virtual Hurricane::Locator<BasicLayer*>* GetClone() const;
public: virtual BasicLayer* getElement() const;
public: virtual Hurricane::Locator<BasicLayer*>* getClone() const;
public: virtual bool IsValid() const;
public: virtual void Progress();
public: virtual string _GetString() const;
public: virtual string _getString() const;
};
@ -67,13 +67,13 @@ class BasicLayer_BasicLayers : public Collection<BasicLayer*> {
// Accessors
// *********
public: virtual Collection<BasicLayer*>* GetClone() const;
public: virtual Hurricane::Locator<BasicLayer*>* GetLocator() const;
public: virtual Collection<BasicLayer*>* getClone() const;
public: virtual Hurricane::Locator<BasicLayer*>* getLocator() const;
// Others
// ******
public: virtual string _GetString() const;
public: virtual string _getString() const;
};
@ -102,7 +102,7 @@ BasicLayer* BasicLayer::create(Technology* technology, const Name& name, const T
BasicLayer* basicLayer =
new BasicLayer(technology, name, type, extractNumber, minimalSize, minimalSpacing);
basicLayer->_PostCreate();
basicLayer->_postCreate();
return basicLayer;
}
@ -139,11 +139,11 @@ void BasicLayer::setFillPattern(const string& fillPattern)
}
}
void BasicLayer::_PostCreate()
void BasicLayer::_postCreate()
// ***************************
{
Mask basicLayersMask = 0;
for_each_basic_layer(basicLayer, getTechnology()->GetBasicLayers()) {
for_each_basic_layer(basicLayer, getTechnology()->getBasicLayers()) {
basicLayersMask |= basicLayer->getMask();
end_for;
}
@ -165,40 +165,40 @@ void BasicLayer::_PostCreate()
_setExtractMask(extractMask);
}
Inherit::_PostCreate();
Inherit::_postCreate();
}
void BasicLayer::_PreDelete()
void BasicLayer::_preDestroy()
// **************************
{
Inherit::_PreDelete();
Inherit::_preDestroy();
CompositeLayers compositeLayers = getTechnology()->GetCompositeLayers();
CompositeLayers compositeLayers = getTechnology()->getCompositeLayers();
for_each_composite_layer(compositeLayer, compositeLayers) {
if (compositeLayer->contains(this)) compositeLayer->remove(this);
end_for;
}
}
string BasicLayer::_GetString() const
string BasicLayer::_getString() const
// **********************************
{
string s = Inherit::_GetString();
// s.insert(s.length() - 1, " " + GetString(_type));
string s = Inherit::_getString();
// s.insert(s.length() - 1, " " + getString(_type));
return s;
}
Record* BasicLayer::_GetRecord() const
Record* BasicLayer::_getRecord() const
// *****************************
{
Record* record = Inherit::_GetRecord();
Record* record = Inherit::_getRecord();
if (record) {
record->Add(GetSlot("Type", &_type));
record->Add(GetSlot("RedValue", &_redValue));
record->Add(GetSlot("GreenValue", &_greenValue));
record->Add(GetSlot("BlueValue", &_blueValue));
record->Add(GetSlot("FillPattern", &_fillPattern));
record->Add(GetSlot("DisplayThreshold", &_displayThreshold));
record->Add(getSlot("Type", &_type));
record->Add(getSlot("RedValue", &_redValue));
record->Add(getSlot("GreenValue", &_greenValue));
record->Add(getSlot("BlueValue", &_blueValue));
record->Add(getSlot("FillPattern", &_fillPattern));
record->Add(getSlot("DisplayThreshold", &_displayThreshold));
}
return record;
}
@ -228,23 +228,23 @@ BasicLayer_BasicLayers& BasicLayer_BasicLayers::operator=(const BasicLayer_Basic
return *this;
}
Collection<BasicLayer*>* BasicLayer_BasicLayers::GetClone() const
Collection<BasicLayer*>* BasicLayer_BasicLayers::getClone() const
// **************************************************************
{
return new BasicLayer_BasicLayers(*this);
}
Locator<BasicLayer*>* BasicLayer_BasicLayers::GetLocator() const
Locator<BasicLayer*>* BasicLayer_BasicLayers::getLocator() const
// *************************************************************
{
return new Locator(_basicLayer);
}
string BasicLayer_BasicLayers::_GetString() const
string BasicLayer_BasicLayers::_getString() const
// **********************************************
{
string s = "<" + _TName("BasicLayer::BasicLayers");
if (_basicLayer) s += " " + GetString(_basicLayer);
if (_basicLayer) s += " " + getString(_basicLayer);
s += ">";
return s;
}
@ -276,13 +276,13 @@ BasicLayer_BasicLayers::Locator& BasicLayer_BasicLayers::Locator::operator=(cons
return *this;
}
BasicLayer* BasicLayer_BasicLayers::Locator::GetElement() const
BasicLayer* BasicLayer_BasicLayers::Locator::getElement() const
// ************************************************************
{
return (BasicLayer*)_basicLayer;
}
Locator<BasicLayer*>* BasicLayer_BasicLayers::Locator::GetClone() const
Locator<BasicLayer*>* BasicLayer_BasicLayers::Locator::getClone() const
// ********************************************************************
{
return new Locator(*this);
@ -300,11 +300,11 @@ void BasicLayer_BasicLayers::Locator::Progress()
_basicLayer = NULL;
}
string BasicLayer_BasicLayers::Locator::_GetString() const
string BasicLayer_BasicLayers::Locator::_getString() const
// *******************************************************
{
string s = "<" + _TName("BasicLayer::BasicLayers::Locator");
if (_basicLayer) s += " " + GetString(_basicLayer);
if (_basicLayer) s += " " + getString(_basicLayer);
s += ">";
return s;
}
@ -334,17 +334,17 @@ BasicLayer::Type& BasicLayer::Type::operator=(const Type& type)
return *this;
}
string BasicLayer::Type::_GetString() const
string BasicLayer::Type::_getString() const
// ****************************************
{
return GetString(_code);
return getString(_code);
}
Record* BasicLayer::Type::_GetRecord() const
Record* BasicLayer::Type::_getRecord() const
// ***********************************
{
Record* record = new Record(GetString(this));
record->Add(GetSlot("Code", &_code));
Record* record = new Record(getString(this));
record->Add(getSlot("Code", &_code));
return record;
}

View File

@ -45,9 +45,9 @@ class BasicLayer : public Layer {
public: const Code& getCode() const {return _code;};
public: string _GetTypeName() const { return _TName("BasicLayer::Type"); };
public: string _GetString() const;
public: Record* _GetRecord() const;
public: string _getTypeName() const { return _TName("BasicLayer::Type"); };
public: string _getString() const;
public: Record* _getRecord() const;
};
@ -91,13 +91,13 @@ class BasicLayer : public Layer {
// Others
// ******
protected: virtual void _PostCreate();
protected: virtual void _postCreate();
protected: virtual void _PreDelete();
protected: virtual void _preDestroy();
public: virtual string _GetTypeName() const {return _TName("BasicLayer");};
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: virtual string _getTypeName() const {return _TName("BasicLayer");};
public: virtual string _getString() const;
public: virtual Record* _getRecord() const;
public: virtual BasicLayer* _getSymbolicBasicLayer() {return this;};
public: void _fill(View* view, const Box& box) const;
@ -128,8 +128,8 @@ template<>
template<>
inline Record* ProxyRecord<BasicLayer::Type::Code> ( const BasicLayer::Type::Code* object )
{
Record* record = new Record(GetString(object));
record->Add(GetSlot("Code", (unsigned int*)object));
Record* record = new Record(getString(object));
record->Add(getSlot("Code", (unsigned int*)object));
return record;
}

View File

@ -46,10 +46,10 @@ typedef GenericFilter<BasicLayer*> BasicLayerFilter;
#define for_each_basic_layer(basicLayer, basicLayers)\
/****************************************************/\
{\
BasicLayerLocator _locator = basicLayers.GetLocator();\
while (_locator.IsValid()) {\
BasicLayer* basicLayer = _locator.GetElement();\
_locator.Progress();
BasicLayerLocator _locator = basicLayers.getLocator();\
while (_locator.IsValid()) {\
BasicLayer* basicLayer = _locator.getElement();\
_locator.Progress();

View File

@ -255,8 +255,8 @@ Box& Box::shrinkByFactor(double factor)
// **************************************
{
assert((0 <= factor) && (factor <= 1));
Unit dx=GetUnit(0.5*(1- factor) * (GetValue(_xMax) - GetValue(_xMin)));
Unit dy=GetUnit(0.5*(1- factor) * (GetValue(_yMax) - GetValue(_yMin)));
Unit dx=getUnit(0.5*(1- factor) * (getValue(_xMax) - getValue(_xMin)));
Unit dy=getUnit(0.5*(1- factor) * (getValue(_yMax) - getValue(_yMin)));
return inflate(-dx, -dy);
}
@ -314,28 +314,28 @@ Box& Box::translate(const Unit& dx, const Unit& dy)
return *this;
}
string Box::_GetString() const
string Box::_getString() const
// ***************************
{
if (isEmpty())
return "<" + _TName("Box") + " empty>";
else
return "<" + _TName("Box") + " " +
GetValueString(_xMin) + " " + GetValueString(_yMin) + " " +
GetValueString(_xMax) + " " + GetValueString(_yMax) +
getValueString(_xMin) + " " + getValueString(_yMin) + " " +
getValueString(_xMax) + " " + getValueString(_yMax) +
">";
}
Record* Box::_GetRecord() const
Record* Box::_getRecord() const
// **********************
{
if (isEmpty()) return NULL;
Record* record = new Record(GetString(this));
record->Add(GetSlot("XMin", &_xMin));
record->Add(GetSlot("YMin", &_yMin));
record->Add(GetSlot("XMax", &_xMax));
record->Add(GetSlot("YMax", &_yMax));
Record* record = new Record(getString(this));
record->Add(getSlot("XMin", &_xMin));
record->Add(getSlot("YMin", &_yMin));
record->Add(getSlot("XMax", &_xMax));
record->Add(getSlot("YMax", &_yMax));
return record;
}

View File

@ -3,7 +3,6 @@
// Authors: R. Escassut
// Copyright (c) BULL S.A. 2000-2004, All Rights Reserved
// ****************************************************************************************************
// 21-10-2003 added ManhattanDistance & ShrinkByFactor
#ifndef HURRICANE_BOX
#define HURRICANE_BOX
@ -110,9 +109,9 @@ class Box {
// ******
public: string _GetTypeName() const { return _TName("Box"); };
public: string _GetString() const;
public: Record* _GetRecord() const;
public: string _getTypeName() const { return _TName("Box"); };
public: string _getString() const;
public: Record* _getRecord() const;
};

View File

@ -45,10 +45,10 @@ typedef GenericFilter<Box> BoxFilter;
#define for_each_box(box, boxes)\
/*******************************/\
{\
BoxLocator _locator = boxes.GetLocator();\
while (_locator.IsValid()) {\
Box box = _locator.GetElement();\
_locator.Progress();
BoxLocator _locator = boxes.getLocator();\
while (_locator.IsValid()) {\
Box box = _locator.getElement();\
_locator.Progress();

View File

@ -51,8 +51,8 @@ Cell::Cell(Library* library, const Name& name)
if (name.IsEmpty())
throw Error("Can't create " + _TName("Cell") + " : empty name");
if (_library->GetCell(_name))
throw Error("Can't create " + _TName("Cell") + " " + GetString(_name) + " : already exists");
if (_library->getCell(_name))
throw Error("Can't create " + _TName("Cell") + " " + getString(_name) + " : already exists");
}
Cell* Cell::Create(Library* library, const Name& name)
@ -60,20 +60,20 @@ Cell* Cell::Create(Library* library, const Name& name)
{
Cell* cell = new Cell(library, name);
cell->_PostCreate();
cell->_postCreate();
return cell;
}
Box Cell::GetBoundingBox() const
Box Cell::getBoundingBox() const
// *****************************
{
if (_boundingBox.isEmpty()) {
Box& boundingBox = (Box&)_boundingBox;
boundingBox = _abutmentBox;
boundingBox.merge(_quadTree.GetBoundingBox());
for_each_slice(slice, GetSlices()) {
boundingBox.merge(slice->GetBoundingBox());
boundingBox.merge(_quadTree.getBoundingBox());
for_each_slice(slice, getSlices()) {
boundingBox.merge(slice->getBoundingBox());
end_for;
}
}
@ -90,8 +90,8 @@ bool Cell::IsLeaf() const
bool Cell::IsCalledBy(Cell* cell) const
// ************************************
{
for_each_instance(instance, cell->GetInstances()) {
Cell* masterCell = instance->GetMasterCell();
for_each_instance(instance, cell->getInstances()) {
Cell* masterCell = instance->getMasterCell();
if (masterCell == this) return true;
if (IsCalledBy(masterCell)) return true;
end_for;
@ -106,12 +106,12 @@ void Cell::SetName(const Name& name)
if (name.IsEmpty())
throw Error("Can't change " + _TName("Cell") + " name : empty name");
if (_library->GetCell(name))
if (_library->getCell(name))
throw Error("Can't change " + _TName("Cell") + " name : already exists");
_library->_GetCellMap()._Remove(this);
_library->_getCellMap()._Remove(this);
_name = name;
_library->_GetCellMap()._Insert(this);
_library->_getCellMap()._Insert(this);
}
}
@ -132,40 +132,40 @@ void Cell::FlattenNets(bool buildRings)
{
OpenUpdateSession ();
for_each_occurrence ( occurrence, GetHyperNetRootNetOccurrences() ) {
for_each_occurrence ( occurrence, getHyperNetRootNetOccurrences() ) {
HyperNet hyperNet ( occurrence );
if ( !occurrence.GetPath().IsEmpty() ) {
if ( !occurrence.getPath().IsEmpty() ) {
DeepNet* deepNet = DeepNet::Create ( hyperNet );
if (deepNet) deepNet->_CreateRoutingPads ( buildRings );
} else {
RoutingPad* previousRP = NULL;
RoutingPad* currentRP = NULL;
Net* net = static_cast<Net*>(occurrence.GetEntity());
Net* net = static_cast<Net*>(occurrence.getEntity());
for_each_component ( component, net->GetComponents() ) {
for_each_component ( component, net->getComponents() ) {
Plug* primaryPlug = dynamic_cast<Plug*>( component );
if ( primaryPlug ) {
if ( !primaryPlug->GetBodyHook()->GetSlaveHooks().IsEmpty() ) {
if ( !primaryPlug->getBodyHook()->getSlaveHooks().IsEmpty() ) {
cerr << "[ERROR] " << primaryPlug << "\n"
<< " has attached components, not managed yet." << endl;
} else {
primaryPlug->GetBodyHook()->Detach ();
primaryPlug->getBodyHook()->Detach ();
}
}
end_for
}
for_each_occurrence ( plugOccurrence, hyperNet.GetLeafPlugOccurrences() ) {
for_each_occurrence ( plugOccurrence, hyperNet.getLeafPlugOccurrences() ) {
currentRP = CreateRoutingPad ( net, plugOccurrence );
currentRP->Materialize ();
if ( buildRings ) {
if ( previousRP ) {
currentRP->GetBodyHook()->Attach ( previousRP->GetBodyHook() );
currentRP->getBodyHook()->Attach ( previousRP->getBodyHook() );
}
Plug* plug = static_cast<Plug*>( plugOccurrence.GetEntity() );
if ( plugOccurrence.GetPath().IsEmpty() ) {
plug->GetBodyHook()->Attach ( currentRP->GetBodyHook() );
plug->GetBodyHook()->Detach ();
Plug* plug = static_cast<Plug*>( plugOccurrence.getEntity() );
if ( plugOccurrence.getPath().IsEmpty() ) {
plug->getBodyHook()->Attach ( currentRP->getBodyHook() );
plug->getBodyHook()->Detach ();
}
previousRP = currentRP;
}
@ -173,16 +173,16 @@ void Cell::FlattenNets(bool buildRings)
end_for
}
for_each_component ( component, net->GetComponents() ) {
for_each_component ( component, net->getComponents() ) {
Pin* pin = dynamic_cast<Pin*>( component );
if ( pin ) {
currentRP = CreateRoutingPad ( pin );
if ( buildRings ) {
if ( previousRP ) {
currentRP->GetBodyHook()->Attach ( previousRP->GetBodyHook() );
currentRP->getBodyHook()->Attach ( previousRP->getBodyHook() );
}
pin->GetBodyHook()->Attach ( currentRP->GetBodyHook() );
pin->GetBodyHook()->Detach ();
pin->getBodyHook()->Attach ( currentRP->getBodyHook() );
pin->getBodyHook()->Detach ();
}
previousRP = currentRP;
}
@ -199,74 +199,72 @@ void Cell::FlattenNets(bool buildRings)
void Cell::Materialize()
// *********************
{
for_each_instance(instance, GetInstances()) instance->Materialize(); end_for;
for_each_net(net, GetNets()) net->Materialize(); end_for;
for_each_marker(marker, GetMarkers()) marker->Materialize(); end_for;
for_each_instance(instance, getInstances()) instance->Materialize(); end_for;
for_each_net(net, getNets()) net->Materialize(); end_for;
for_each_marker(marker, getMarkers()) marker->Materialize(); end_for;
}
void Cell::Unmaterialize()
// ***********************
{
for_each_instance(instance, GetInstances()) instance->Unmaterialize(); end_for;
for_each_net(net, GetNets()) net->Unmaterialize(); end_for;
for_each_marker(marker, GetMarkers()) marker->Unmaterialize(); end_for;
for_each_instance(instance, getInstances()) instance->Unmaterialize(); end_for;
for_each_net(net, getNets()) net->Unmaterialize(); end_for;
for_each_marker(marker, getMarkers()) marker->Unmaterialize(); end_for;
}
void Cell::_PostCreate()
void Cell::_postCreate()
// *********************
{
_library->_GetCellMap()._Insert(this);
_library->_getCellMap()._Insert(this);
Inherit::_PostCreate();
Inherit::_postCreate();
}
void Cell::_PreDelete()
void Cell::_preDestroy()
// ********************
{
Inherit::_PreDelete();
Inherit::_preDestroy();
while(_slaveEntityMap.size()) {
_slaveEntityMap.begin()->second->Delete();
_slaveEntityMap.begin()->second->destroy();
}
//for_each_view(view, GetViews()) view->SetCell(NULL); end_for;
for_each_marker(marker, GetMarkers()) marker->Delete(); end_for;
for_each_instance(slaveInstance, GetSlaveInstances()) slaveInstance->Delete(); end_for;
for_each_instance(instance, GetInstances()) instance->Delete(); end_for;
for_each_net(net, GetNets()) net->Delete(); end_for;
for_each_slice(slice, GetSlices()) slice->_Delete(); end_for;
//for_each_view(view, getViews()) view->SetCell(NULL); end_for;
for_each_marker(marker, getMarkers()) marker->destroy(); end_for;
for_each_instance(slaveInstance, getSlaveInstances()) slaveInstance->destroy(); end_for;
for_each_instance(instance, getInstances()) instance->destroy(); end_for;
for_each_net(net, getNets()) net->destroy(); end_for;
for_each_slice(slice, getSlices()) slice->_destroy(); end_for;
_library->_GetCellMap()._Remove(this);
_library->_getCellMap()._Remove(this);
}
string Cell::_GetString() const
string Cell::_getString() const
// ****************************
{
string s = Inherit::_GetString();
s.insert(s.length() - 1, " " + GetString(_name));
string s = Inherit::_getString();
s.insert(s.length() - 1, " " + getString(_name));
return s;
}
Record* Cell::_GetRecord() const
Record* Cell::_getRecord() const
// ***********************
{
Record* record = Inherit::_GetRecord();
Record* record = Inherit::_getRecord();
if (record) {
record->Add(GetSlot("Library", _library));
record->Add(GetSlot("Name", &_name));
record->Add(GetSlot("Instances", &_instanceMap));
record->Add(GetSlot("QuadTree", &_quadTree));
record->Add(GetSlot("SlaveInstances", &_slaveInstanceSet));
record->Add(GetSlot("Nets", &_netMap));
record->Add(GetSlot("Pins", &_pinMap));
record->Add(GetSlot("Slices", &_sliceMap));
record->Add(GetSlot("Markers", &_markerSet));
//record->Add(GetSlot("Views", &_viewSet));
record->Add(GetSlot("AbutmentBox", &_abutmentBox));
record->Add(GetSlot("BoundingBox", &_boundingBox));
record->Add(GetSlot("IsTerminal", &_isTerminal));
record->Add(GetSlot("IsFlattenLeaf", &_isFlattenLeaf));
//record->Add(GetSlot("Symbol", _symbol));
record->Add(getSlot("Library", _library));
record->Add(getSlot("Name", &_name));
record->Add(getSlot("Instances", &_instanceMap));
record->Add(getSlot("QuadTree", &_quadTree));
record->Add(getSlot("SlaveInstances", &_slaveInstanceSet));
record->Add(getSlot("Nets", &_netMap));
record->Add(getSlot("Pins", &_pinMap));
record->Add(getSlot("Slices", &_sliceMap));
record->Add(getSlot("Markers", &_markerSet));
record->Add(getSlot("AbutmentBox", &_abutmentBox));
record->Add(getSlot("BoundingBox", &_boundingBox));
record->Add(getSlot("IsTerminal", &_isTerminal));
record->Add(getSlot("IsFlattenLeaf", &_isFlattenLeaf));
}
return record;
}
@ -278,8 +276,8 @@ void Cell::_Fit(const Box& box)
if (_boundingBox.isEmpty()) return;
if (_boundingBox.contains(box)) return;
_boundingBox.merge(box);
for_each_instance(instance, GetSlaveInstances()) {
instance->GetCell()->_Fit(instance->GetTransformation().getBox(box));
for_each_instance(instance, getSlaveInstances()) {
instance->getCell()->_Fit(instance->getTransformation().getBox(box));
end_for;
}
}
@ -291,8 +289,8 @@ void Cell::_Unfit(const Box& box)
if (_boundingBox.isEmpty()) return;
if (!_boundingBox.isConstrainedBy(box)) return;
_boundingBox.makeEmpty();
for_each_instance(instance, GetSlaveInstances()) {
instance->GetCell()->_Unfit(instance->GetTransformation().getBox(box));
for_each_instance(instance, getSlaveInstances()) {
instance->getCell()->_Unfit(instance->getTransformation().getBox(box));
end_for;
}
}
@ -300,7 +298,7 @@ void Cell::_Unfit(const Box& box)
void Cell::_AddSlaveEntity(Entity* entity, Entity* slaveEntity)
// ************************************************************************
{
assert(entity->GetCell() == this);
assert(entity->getCell() == this);
_slaveEntityMap.insert(pair<Entity*,Entity*>(entity,slaveEntity));
}
@ -308,7 +306,7 @@ void Cell::_AddSlaveEntity(Entity* entity, Entity* slaveEntity)
void Cell::_RemoveSlaveEntity(Entity* entity, Entity* slaveEntity)
// ***************************************************************************
{
assert(entity->GetCell() == this);
assert(entity->getCell() == this);
pair<SlaveEntityMap::iterator,SlaveEntityMap::iterator>
bounds = _slaveEntityMap.equal_range(entity);
@ -321,147 +319,20 @@ void Cell::_RemoveSlaveEntity(Entity* entity, Entity* slaveEntity)
}
}
void Cell::_GetSlaveEntities(SlaveEntityMap::iterator& begin, SlaveEntityMap::iterator& end)
void Cell::_getSlaveEntities(SlaveEntityMap::iterator& begin, SlaveEntityMap::iterator& end)
// *********************************************************************************************************
{
begin = _slaveEntityMap.begin();
end = _slaveEntityMap.end();
}
void Cell::_GetSlaveEntities(Entity* entity, SlaveEntityMap::iterator& begin, SlaveEntityMap::iterator& end)
void Cell::_getSlaveEntities(Entity* entity, SlaveEntityMap::iterator& begin, SlaveEntityMap::iterator& end)
// *********************************************************************************************************
{
begin = _slaveEntityMap.lower_bound(entity);
end = _slaveEntityMap.upper_bound(entity);
}
//bool Cell::_IsDrawable(View* view) const
//// *************************************
//{
// return true;
// //if (view->GetCell() == this) return true;
//
// //if (is_a<MapView*>(view)) return true;
//
// //return (1 < (double)view->GetScreenSize(_boundingBox.GetHeight()));
//// return (100 < ((double)view->GetScreenSize(_boundingBox.GetWidth()) *
//// (double)view->GetScreenSize(_boundingBox.GetHeight())));
//}
//
//bool Cell::_ContentIsDrawable(View* view) const
//// ********************************************
//{
// if (IsTerminal()) return false;
//
// return true;
//
// //if (view->GetCell() == this) return true;
//
// //if (is_a<MapView*>(view)) return false;
//
// //return (40 < (double)view->GetScreenSize(_boundingBox.GetHeight()));
//// return (400 < ((double)view->GetScreenSize(_boundingBox.GetWidth()) *
//// (double)view->GetScreenSize(_boundingBox.GetHeight())));
//}
//
//void Cell::_DrawPhantoms(View* view, const Box& updateArea, const Transformation& transformation)
//// **********************************************************************************************
//{
//// if (_IsDrawable(view)) { // To avoid irregular display of instances phantoms
//// if (!_ContentIsDrawable(view))
//// view->FillRectangle(transformation.GetBox(GetAbutmentBox()));
//// else {
//// for_each_instance(instance, GetInstancesUnder(updateArea)) {
//// instance->_DrawPhantoms(view, updateArea, transformation);
//// end_for;
//// }
//// }
//// }
//}
//
//void Cell::_DrawBoundaries(View* view, const Box& updateArea, const Transformation& transformation)
//// ************************************************************************************************
//{
// // if (_IsDrawable(view)) { // To avoid irregular display of instances phantoms
// // view->DrawRectangle(transformation.GetBox(GetAbutmentBox()));
// // if (_ContentIsDrawable(view)) {
// // for_each_instance(instance, GetInstancesUnder(updateArea)) {
// // instance->_DrawBoundaries(view, updateArea, transformation);
// // end_for;
// // }
// // }
// // }
//}
//
//void Cell::_DrawContent(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation)
//// ****************************************************************************************************
//{
//// if (_IsDrawable(view)) {
//// if (_ContentIsDrawable(view)) {
//// view->CheckForDisplayInterruption();
//// for_each_instance(instance, GetInstancesUnder(updateArea)) {
//// instance->_Draw(view, basicLayer, updateArea, transformation);
//// end_for;
//// }
//// for_each_slice(slice, GetSlices()) {
//// slice->_Draw(view, basicLayer, updateArea, transformation);
//// end_for;
//// }
//// }
//// }
//}
//
//void Cell::_DrawRubbers(View* view, const Box& updateArea, const Transformation& transformation)
//// *********************************************************************************************
//{
//// if (_IsDrawable(view)) {
//// if (_ContentIsDrawable(view)) {
//// for_each_instance(instance, GetInstancesUnder(updateArea)) {
//// instance->_DrawRubbers(view, updateArea, transformation);
//// end_for;
//// }
//// for_each_rubber(rubber, GetRubbersUnder(updateArea)) {
//// rubber->_Draw(view, NULL, updateArea, transformation);
//// end_for;
//// }
//// }
//// }
//}
//
//void Cell::_DrawMarkers(View* view, const Box& updateArea, const Transformation& transformation)
//// *********************************************************************************************
//{
//// if (_IsDrawable(view)) {
//// if (_ContentIsDrawable(view)) {
//// for_each_instance(instance, GetInstancesUnder(updateArea)) {
//// instance->_DrawMarkers(view, updateArea, transformation);
//// end_for;
//// }
//// for_each_marker(marker, GetMarkersUnder(updateArea)) {
//// marker->_Draw(view, NULL, updateArea, transformation);
//// end_for;
//// }
//// }
//// }
//}
//
//void Cell::_DrawDisplaySlots(View* view, const Box& area, const Box& updateArea, const Transformation& transformation)
//// ********************************************************************************************************************
//{
//// if (_IsDrawable(view)) {
//// if (_ContentIsDrawable(view)) {
//// for_each_instance(instance, GetInstancesUnder(updateArea)) {
//// instance->_DrawDisplaySlots(view, area, updateArea, transformation);
//// end_for;
//// }
//// for_each_display_slot(displaySlot, GetDisplaySlots(this)) {
//// view->_DrawDisplaySlot(displaySlot, area, updateArea, transformation);
//// end_for;
//// }
//// }
//// }
//}
//
// ****************************************************************************************************
// Cell::InstanceMap implementation
// ****************************************************************************************************
@ -472,22 +343,22 @@ Cell::InstanceMap::InstanceMap()
{
}
Name Cell::InstanceMap::_GetKey(Instance* instance) const
Name Cell::InstanceMap::_getKey(Instance* instance) const
// ******************************************************
{
return instance->GetName();
return instance->getName();
}
unsigned Cell::InstanceMap::_GetHashValue(Name name) const
unsigned Cell::InstanceMap::_getHashValue(Name name) const
// *******************************************************
{
return ( (unsigned int)( (unsigned long)name._GetSharedName() ) ) / 8;
return ( (unsigned int)( (unsigned long)name._getSharedName() ) ) / 8;
}
Instance* Cell::InstanceMap::_GetNextElement(Instance* instance) const
Instance* Cell::InstanceMap::_getNextElement(Instance* instance) const
// *******************************************************************
{
return instance->_GetNextOfCellInstanceMap();
return instance->_getNextOfCellInstanceMap();
}
void Cell::InstanceMap::_SetNextElement(Instance* instance, Instance* nextInstance) const
@ -508,16 +379,16 @@ Cell::SlaveInstanceSet::SlaveInstanceSet()
{
}
unsigned Cell::SlaveInstanceSet::_GetHashValue(Instance* slaveInstance) const
unsigned Cell::SlaveInstanceSet::_getHashValue(Instance* slaveInstance) const
// **************************************************************************
{
return ( (unsigned int)( (unsigned long)slaveInstance ) ) / 8;
}
Instance* Cell::SlaveInstanceSet::_GetNextElement(Instance* slaveInstance) const
Instance* Cell::SlaveInstanceSet::_getNextElement(Instance* slaveInstance) const
// *****************************************************************************
{
return slaveInstance->_GetNextOfCellSlaveInstanceSet();
return slaveInstance->_getNextOfCellSlaveInstanceSet();
}
void Cell::SlaveInstanceSet::_SetNextElement(Instance* slaveInstance, Instance* nextSlaveInstance) const
@ -538,22 +409,22 @@ Cell::NetMap::NetMap()
{
}
Name Cell::NetMap::_GetKey(Net* net) const
Name Cell::NetMap::_getKey(Net* net) const
// ***************************************
{
return net->GetName();
return net->getName();
}
unsigned Cell::NetMap::_GetHashValue(Name name) const
unsigned Cell::NetMap::_getHashValue(Name name) const
// **************************************************
{
return ( (unsigned int)( (unsigned long)name._GetSharedName() ) ) / 8;
return ( (unsigned int)( (unsigned long)name._getSharedName() ) ) / 8;
}
Net* Cell::NetMap::_GetNextElement(Net* net) const
Net* Cell::NetMap::_getNextElement(Net* net) const
// ***********************************************
{
return net->_GetNextOfCellNetMap();
return net->_getNextOfCellNetMap();
}
void Cell::NetMap::_SetNextElement(Net* net, Net* nextNet) const
@ -573,22 +444,22 @@ Cell::PinMap::PinMap()
{
}
Name Cell::PinMap::_GetKey(Pin* pin) const
Name Cell::PinMap::_getKey(Pin* pin) const
// ***************************************
{
return pin->GetName();
return pin->getName();
}
unsigned Cell::PinMap::_GetHashValue(Name name) const
unsigned Cell::PinMap::_getHashValue(Name name) const
// **************************************************
{
return ( (unsigned int)( (unsigned long)name._GetSharedName() ) ) / 8;
return ( (unsigned int)( (unsigned long)name._getSharedName() ) ) / 8;
}
Pin* Cell::PinMap::_GetNextElement(Pin* pin) const
Pin* Cell::PinMap::_getNextElement(Pin* pin) const
// ***********************************************
{
return pin->_GetNextOfCellPinMap();
return pin->_getNextOfCellPinMap();
}
void Cell::PinMap::_SetNextElement(Pin* pin, Pin* nextPin) const
@ -608,22 +479,22 @@ Cell::SliceMap::SliceMap()
{
}
const Layer* Cell::SliceMap::_GetKey(Slice* slice) const
const Layer* Cell::SliceMap::_getKey(Slice* slice) const
// *****************************************************
{
return slice->GetLayer();
return slice->getLayer();
}
unsigned Cell::SliceMap::_GetHashValue(const Layer* layer) const
unsigned Cell::SliceMap::_getHashValue(const Layer* layer) const
// *************************************************************
{
return ( (unsigned int)( (unsigned long)layer ) ) / 8;
}
Slice* Cell::SliceMap::_GetNextElement(Slice* slice) const
Slice* Cell::SliceMap::_getNextElement(Slice* slice) const
// *******************************************************
{
return slice->_GetNextOfCellSliceMap();
return slice->_getNextOfCellSliceMap();
}
void Cell::SliceMap::_SetNextElement(Slice* slice, Slice* nextSlice) const
@ -644,16 +515,16 @@ Cell::MarkerSet::MarkerSet()
{
}
unsigned Cell::MarkerSet::_GetHashValue(Marker* marker) const
unsigned Cell::MarkerSet::_getHashValue(Marker* marker) const
// **********************************************************
{
return ( (unsigned int)( (unsigned long)marker ) ) / 8;
}
Marker* Cell::MarkerSet::_GetNextElement(Marker* marker) const
Marker* Cell::MarkerSet::_getNextElement(Marker* marker) const
// ***********************************************************
{
return marker->_GetNextOfCellMarkerSet();
return marker->_getNextOfCellMarkerSet();
}
void Cell::MarkerSet::_SetNextElement(Marker* marker, Marker* nextMarker) const
@ -662,38 +533,6 @@ void Cell::MarkerSet::_SetNextElement(Marker* marker, Marker* nextMarker) const
marker->_SetNextOfCellMarkerSet(nextMarker);
}
//// ****************************************************************************************************
//// Cell::ViewSet implementation
//// ****************************************************************************************************
//
//Cell::ViewSet::ViewSet()
//// *********************
//: Inherit()
//{
//}
//
//unsigned Cell::ViewSet::_GetHashValue(View* view) const
//// ****************************************************
//{
// return ( (unsigned int)( (unsigned long)view ) ) / 8;
//}
//
//View* Cell::ViewSet::_GetNextElement(View* view) const
//// ***************************************************
//{
// return view->_GetNextOfCellViewSet();
//}
//
//void Cell::ViewSet::_SetNextElement(View* view, View* nextView) const
//// ******************************************************************
//{
// view->_SetNextOfCellViewSet(nextView);
//}
//
//
} // End of Hurricane namespace.
// ****************************************************************************************************

View File

@ -59,9 +59,9 @@ class Cell : public Entity {
public: InstanceMap();
public: virtual Name _GetKey(Instance* instance) const;
public: virtual unsigned _GetHashValue(Name name) const;
public: virtual Instance* _GetNextElement(Instance* instance) const;
public: virtual Name _getKey(Instance* instance) const;
public: virtual unsigned _getHashValue(Name name) const;
public: virtual Instance* _getNextElement(Instance* instance) const;
public: virtual void _SetNextElement(Instance* instance, Instance* nextInstance) const;
};
@ -73,8 +73,8 @@ class Cell : public Entity {
public: SlaveInstanceSet();
public: virtual unsigned _GetHashValue(Instance* slaveInstance) const;
public: virtual Instance* _GetNextElement(Instance* slaveInstance) const;
public: virtual unsigned _getHashValue(Instance* slaveInstance) const;
public: virtual Instance* _getNextElement(Instance* slaveInstance) const;
public: virtual void _SetNextElement(Instance* slaveInstance, Instance* nextSlaveInstance) const;
};
@ -86,9 +86,9 @@ class Cell : public Entity {
public: NetMap();
public: virtual Name _GetKey(Net* net) const;
public: virtual unsigned _GetHashValue(Name name) const;
public: virtual Net* _GetNextElement(Net* net) const;
public: virtual Name _getKey(Net* net) const;
public: virtual unsigned _getHashValue(Name name) const;
public: virtual Net* _getNextElement(Net* net) const;
public: virtual void _SetNextElement(Net* net, Net* nextNet) const;
};
@ -100,9 +100,9 @@ class Cell : public Entity {
public: PinMap();
public: virtual Name _GetKey(Pin* pin) const;
public: virtual unsigned _GetHashValue(Name name) const;
public: virtual Pin* _GetNextElement(Pin* pin) const;
public: virtual Name _getKey(Pin* pin) const;
public: virtual unsigned _getHashValue(Name name) const;
public: virtual Pin* _getNextElement(Pin* pin) const;
public: virtual void _SetNextElement(Pin* pin, Pin* nextPin) const;
};
@ -114,9 +114,9 @@ class Cell : public Entity {
public: SliceMap();
public: virtual const Layer* _GetKey(Slice* slice) const;
public: virtual unsigned _GetHashValue(const Layer* layer) const;
public: virtual Slice* _GetNextElement(Slice* slice) const;
public: virtual const Layer* _getKey(Slice* slice) const;
public: virtual unsigned _getHashValue(const Layer* layer) const;
public: virtual Slice* _getNextElement(Slice* slice) const;
public: virtual void _SetNextElement(Slice* slice, Slice* nextSlice) const;
};
@ -128,25 +128,12 @@ class Cell : public Entity {
public: MarkerSet();
public: virtual unsigned _GetHashValue(Marker* marker) const;
public: virtual Marker* _GetNextElement(Marker* marker) const;
public: virtual unsigned _getHashValue(Marker* marker) const;
public: virtual Marker* _getNextElement(Marker* marker) const;
public: virtual void _SetNextElement(Marker* marker, Marker* nextMarker) const;
};
//public: class ViewSet : public IntrusiveSet<View> {
//// **********************************************
// public: typedef IntrusiveSet<View> Inherit;
//
// public: ViewSet();
// public: virtual unsigned _GetHashValue(View* view) const;
// public: virtual View* _GetNextElement(View* view) const;
// public: virtual void _SetNextElement(View* view, View* nextView) const;
//};
// Attributes
// **********
@ -159,7 +146,6 @@ class Cell : public Entity {
private: PinMap _pinMap;
private: SliceMap _sliceMap;
private: MarkerSet _markerSet;
//private: ViewSet _viewSet;
private: Box _abutmentBox;
private: Box _boundingBox;
private: bool _isTerminal;
@ -177,24 +163,24 @@ class Cell : public Entity {
// Others
// ******
protected: virtual void _PostCreate();
protected: virtual void _postCreate();
protected: virtual void _PreDelete();
protected: virtual void _preDestroy();
public: virtual string _GetTypeName() const {return _TName("Cell");};
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: virtual string _getTypeName() const {return _TName("Cell");};
public: virtual string _getString() const;
public: virtual Record* _getRecord() const;
public: InstanceMap& _GetInstanceMap() {return _instanceMap;};
public: QuadTree* _GetQuadTree() {return &_quadTree;};
public: SlaveInstanceSet& _GetSlaveInstanceSet() {return _slaveInstanceSet;};
public: NetMap& _GetNetMap() {return _netMap;};
public: PinMap& _GetPinMap() {return _pinMap;};
public: SliceMap& _GetSliceMap() {return _sliceMap;};
public: MarkerSet& _GetMarkerSet() {return _markerSet;};
//public: ViewSet& _GetViewSet() {return _viewSet;};
public: Cell* _GetNextOfLibraryCellMap() const {return _nextOfLibraryCellMap;};
public: Cell* _GetNextOfSymbolCellSet() const {return _nextOfSymbolCellSet;};
public: InstanceMap& _getInstanceMap() {return _instanceMap;};
public: QuadTree* _getQuadTree() {return &_quadTree;};
public: SlaveInstanceSet& _getSlaveInstanceSet() {return _slaveInstanceSet;};
public: NetMap& _getNetMap() {return _netMap;};
public: PinMap& _getPinMap() {return _pinMap;};
public: SliceMap& _getSliceMap() {return _sliceMap;};
public: MarkerSet& _getMarkerSet() {return _markerSet;};
//public: ViewSet& _getViewSet() {return _viewSet;};
public: Cell* _getNextOfLibraryCellMap() const {return _nextOfLibraryCellMap;};
public: Cell* _getNextOfSymbolCellSet() const {return _nextOfSymbolCellSet;};
public: void _SetNextOfLibraryCellMap(Cell* cell) {_nextOfLibraryCellMap = cell;};
public: void _SetNextOfSymbolCellSet(Cell* cell) {_nextOfSymbolCellSet = cell;};
@ -204,8 +190,8 @@ class Cell : public Entity {
public: void _AddSlaveEntity(Entity* entity, Entity* slaveEntity);
public: void _RemoveSlaveEntity(Entity* entity, Entity* slaveEntity);
public: void _GetSlaveEntities(SlaveEntityMap::iterator& begin, SlaveEntityMap::iterator& end);
public: void _GetSlaveEntities(Entity* entity, SlaveEntityMap::iterator& begin, SlaveEntityMap::iterator& end);
public: void _getSlaveEntities(SlaveEntityMap::iterator& begin, SlaveEntityMap::iterator& end);
public: void _getSlaveEntities(Entity* entity, SlaveEntityMap::iterator& begin, SlaveEntityMap::iterator& end);
//public: bool _IsDrawable(View* view) const;
//public: bool _ContentIsDrawable(View* view) const;
@ -226,65 +212,65 @@ class Cell : public Entity {
// Accessors
// *********
public: virtual Cell* GetCell() const {return (Cell*)this;};
public: virtual Box GetBoundingBox() const;
public: Library* GetLibrary() const {return _library;};
public: const Name& GetName() const {return _name;};
public: Instance* GetInstance(const Name& name) const {return _instanceMap.GetElement(name);};
public: Instances GetInstances() const {return _instanceMap.GetElements();};
public: Instances GetPlacedInstances() const;
public: Instances GetFixedInstances() const;
public: Instances GetUnplacedInstances() const;
public: Instances GetNotUnplacedInstances() const;
public: Instances GetInstancesUnder(const Box& area) const;
public: Instances GetPlacedInstancesUnder(const Box& area) const;
public: Instances GetFixedInstancesUnder(const Box& area) const;
public: Instances GetUnplacedInstancesUnder(const Box& area) const;
public: Instances GetNotUnplacedInstancesUnder(const Box& area) const;
public: Instances GetSlaveInstances() const; // {return _slaveInstanceSet.GetElements();}; NOON!!
public: Instances GetTerminalInstances() const;
public: Instances GetTerminalInstancesUnder(const Box& area) const;
public: Instances GetNonTerminalInstances() const;
public: Instances GetNonTerminalInstancesUnder(const Box& area) const;
public: Instances GetLeafInstances() const;
public: Instances GetLeafInstancesUnder(const Box& area) const;
public: Instances GetNonLeafInstances() const;
public: Instances GetNonLeafInstancesUnder(const Box& area) const;
public: Net* GetNet(const Name& name) const {return _netMap.GetElement(name);};
public: Nets GetNets() const {return _netMap.GetElements();};
public: Nets GetGlobalNets() const;
public: Nets GetExternalNets() const;
public: Nets GetInternalNets() const;
public: Nets GetClockNets() const;
public: Nets GetSupplyNets() const;
public: Nets GetPowerNets() const;
public: Nets GetGroundNets() const;
public: Pin* GetPin(const Name& name) const {return _pinMap.GetElement(name);};
public: Pins GetPins() const {return _pinMap.GetElements();};
public: Slice* GetSlice(const Layer* layer) const {return _sliceMap.GetElement(layer);};
public: Slices GetSlices(const Layer::Mask& mask = ~0) const;
// public: Views GetViews() const {return _viewSet.GetElements();};
// public: MainViews GetMainViews() const;
// public: MainViews GetImpactedMainViews() const;
public: Rubbers GetRubbers() const;
public: Rubbers GetRubbersUnder(const Box& area) const;
public: Markers GetMarkers() const {return _markerSet.GetElements();};
public: Markers GetMarkersUnder(const Box& area) const;
public: References GetReferences() const;
public: Components GetComponents(const Layer::Mask& mask = ~0) const;
public: Components GetComponentsUnder(const Box& area, const Layer::Mask& mask = ~0) const;
public: Occurrences GetOccurrences(unsigned searchDepth = (unsigned)-1) const;
public: Occurrences GetOccurrencesUnder(const Box& area, unsigned searchDepth = (unsigned)-1) const;
public: Occurrences GetTerminalInstanceOccurrences() const;
public: Occurrences GetTerminalInstanceOccurrencesUnder(const Box& area) const;
public: Occurrences GetLeafInstanceOccurrences() const;
public: Occurrences GetLeafInstanceOccurrencesUnder(const Box& area) const;
public: Occurrences GetComponentOccurrences(const Layer::Mask& mask = ~0) const;
public: Occurrences GetComponentOccurrencesUnder(const Box& area, const Layer::Mask& mask = ~0) const;
public: Occurrences GetHyperNetRootNetOccurrences() const;
public: Cells GetSubCells() const;
public: Pathes GetRecursiveSlavePathes() const;
public: const Box& GetAbutmentBox() const {return _abutmentBox;};
public: virtual Cell* getCell() const {return (Cell*)this;};
public: virtual Box getBoundingBox() const;
public: Library* getLibrary() const {return _library;};
public: const Name& getName() const {return _name;};
public: Instance* getInstance(const Name& name) const {return _instanceMap.getElement(name);};
public: Instances getInstances() const {return _instanceMap.getElements();};
public: Instances getPlacedInstances() const;
public: Instances getFixedInstances() const;
public: Instances getUnplacedInstances() const;
public: Instances getNotUnplacedInstances() const;
public: Instances getInstancesUnder(const Box& area) const;
public: Instances getPlacedInstancesUnder(const Box& area) const;
public: Instances getFixedInstancesUnder(const Box& area) const;
public: Instances getUnplacedInstancesUnder(const Box& area) const;
public: Instances getNotUnplacedInstancesUnder(const Box& area) const;
public: Instances getSlaveInstances() const; // {return _slaveInstanceSet.getElements();}; NOON!!
public: Instances getTerminalInstances() const;
public: Instances getTerminalInstancesUnder(const Box& area) const;
public: Instances getNonTerminalInstances() const;
public: Instances getNonTerminalInstancesUnder(const Box& area) const;
public: Instances getLeafInstances() const;
public: Instances getLeafInstancesUnder(const Box& area) const;
public: Instances getNonLeafInstances() const;
public: Instances getNonLeafInstancesUnder(const Box& area) const;
public: Net* getNet(const Name& name) const {return _netMap.getElement(name);};
public: Nets getNets() const {return _netMap.getElements();};
public: Nets getGlobalNets() const;
public: Nets getExternalNets() const;
public: Nets getInternalNets() const;
public: Nets getClockNets() const;
public: Nets getSupplyNets() const;
public: Nets getPowerNets() const;
public: Nets getGroundNets() const;
public: Pin* getPin(const Name& name) const {return _pinMap.getElement(name);};
public: Pins getPins() const {return _pinMap.getElements();};
public: Slice* getSlice(const Layer* layer) const {return _sliceMap.getElement(layer);};
public: Slices getSlices(const Layer::Mask& mask = ~0) const;
// public: Views getViews() const {return _viewSet.getElements();};
// public: MainViews getMainViews() const;
// public: MainViews getImpactedMainViews() const;
public: Rubbers getRubbers() const;
public: Rubbers getRubbersUnder(const Box& area) const;
public: Markers getMarkers() const {return _markerSet.getElements();};
public: Markers getMarkersUnder(const Box& area) const;
public: References getReferences() const;
public: Components getComponents(const Layer::Mask& mask = ~0) const;
public: Components getComponentsUnder(const Box& area, const Layer::Mask& mask = ~0) const;
public: Occurrences getOccurrences(unsigned searchDepth = (unsigned)-1) const;
public: Occurrences getOccurrencesUnder(const Box& area, unsigned searchDepth = (unsigned)-1) const;
public: Occurrences getTerminalInstanceOccurrences() const;
public: Occurrences getTerminalInstanceOccurrencesUnder(const Box& area) const;
public: Occurrences getLeafInstanceOccurrences() const;
public: Occurrences getLeafInstanceOccurrencesUnder(const Box& area) const;
public: Occurrences getComponentOccurrences(const Layer::Mask& mask = ~0) const;
public: Occurrences getComponentOccurrencesUnder(const Box& area, const Layer::Mask& mask = ~0) const;
public: Occurrences getHyperNetRootNetOccurrences() const;
public: Cells getSubCells() const;
public: Pathes getRecursiveSlavePathes() const;
public: const Box& getAbutmentBox() const {return _abutmentBox;};
// Predicates
// **********

File diff suppressed because it is too large Load Diff

View File

@ -46,10 +46,10 @@ typedef GenericFilter<Cell*> CellFilter;
#define for_each_cell(cell, cells)\
/*********************************/\
{\
CellLocator _locator = cells.GetLocator();\
while (_locator.IsValid()) {\
Cell* cell = _locator.GetElement();\
_locator.Progress();
CellLocator _locator = cells.getLocator();\
while (_locator.IsValid()) {\
Cell* cell = _locator.getElement();\
_locator.Progress();

File diff suppressed because it is too large Load Diff

View File

@ -130,7 +130,7 @@ using namespace std;
// x-----------------------------------------------------------------x
// | GetString() Overloads for POD/STL types |
// | getString() Overloads for POD/STL types |
// x-----------------------------------------------------------------x
// Note: we are outside the Hurricane namespace.

File diff suppressed because it is too large Load Diff

View File

@ -31,91 +31,88 @@ class Component : public Go {
// Types
// *****
public: typedef Go Inherit;
public: typedef Go Inherit;
public: class BodyHook : public Hook {
// *********************************
public: class BodyHook : public Hook {
// *********************************
friend class Component;
friend class Component;
public: typedef Hook Inherit;
public: typedef Hook Inherit;
private: BodyHook(Component* component);
private: BodyHook(Component* component);
public: virtual Component* GetComponent() const;
public: virtual Component* getComponent() const;
public: virtual bool IsMaster() const {return true;};
public: virtual bool IsMaster() const {return true;};
public: virtual string _GetTypeName() const { return _TName("Component::BodyHook"); };
public: virtual string _GetString() const;
public: virtual string _getTypeName() const { return _TName("Component::BodyHook"); };
public: virtual string _getString() const;
};
};
// Attributes
// **********
private: Net* _net;
private: Rubber* _rubber;
private: BodyHook _bodyHook;
private: Component* _nextOfNetComponentSet;
private: Net* _net;
private: Rubber* _rubber;
private: BodyHook _bodyHook;
private: Component* _nextOfNetComponentSet;
// Constructors
// ************
protected: Component(Net* net, bool inPlugCreate = false);
protected: Component(Net* net, bool inPlugCreate = false);
// Accessors
// *********
public: virtual Cell* GetCell() const;
public: Net* GetNet() const {return _net;};
public: Rubber* GetRubber() const {return _rubber;};
public: Hook* GetBodyHook() {return &_bodyHook;};
public: virtual Hooks GetHooks() const;
public: virtual Unit GetX() const = 0;
public: virtual Unit GetY() const = 0;
public: virtual Point GetPosition() const {return Point(GetX(), GetY());};
public: virtual Point GetCenter() const {return GetPosition();};
public: virtual Layer* GetLayer() const = 0;
public: virtual Box GetBoundingBox() const = 0;
public: virtual Box GetBoundingBox(const BasicLayer* basicLayer) const = 0;
public: Components GetConnexComponents() const;
public: Components GetSlaveComponents() const;
public: virtual Cell* getCell() const;
public: Net* getNet() const {return _net;};
public: Rubber* getRubber() const {return _rubber;};
public: Hook* getBodyHook() {return &_bodyHook;};
public: virtual Hooks getHooks() const;
public: virtual Unit getX() const = 0;
public: virtual Unit getY() const = 0;
public: virtual Point getPosition() const {return Point(getX(), getY());};
public: virtual Point getCenter() const {return getPosition();};
public: virtual Layer* getLayer() const = 0;
public: virtual Box getBoundingBox() const = 0;
public: virtual Box getBoundingBox(const BasicLayer* basicLayer) const = 0;
public: Components getConnexComponents() const;
public: Components getSlaveComponents() const;
// Updators
// ********
public: virtual void Materialize();
public: virtual void Unmaterialize();
public: virtual void Invalidate(bool propagateFlag = true);
public: virtual void Materialize();
public: virtual void Unmaterialize();
public: virtual void Invalidate(bool propagateFlag = true);
// Filters
// *******
public: static ComponentFilter GetIsUnderFilter(const Box& area);
public: static ComponentFilter getIsUnderFilter(const Box& area);
// Others
// ******
protected: virtual void _PostCreate();
protected: virtual void _postCreate();
protected: virtual void _PreDelete();
protected: virtual void _preDestroy();
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: Component* _GetNextOfNetComponentSet() const {return _nextOfNetComponentSet;};
public: virtual string _getString() const;
public: virtual Record* _getRecord() const;
public: Component* _getNextOfNetComponentSet() const {return _nextOfNetComponentSet;};
public: void _SetNet(Net* net);
public: void _SetRubber(Rubber* rubber);
public: void _SetNextOfNetComponentSet(Component* component) {_nextOfNetComponentSet = component;};
//public: virtual bool _IsInterceptedBy(View* view, const Point& point, const Unit& aperture) const;
//public: virtual void _Highlight(View* view, const Box& updateArea, const Transformation& transformation);
public: void _SetNet(Net* net);
public: void _SetRubber(Rubber* rubber);
public: void _SetNextOfNetComponentSet(Component* component) {_nextOfNetComponentSet = component;};
};
double GetArea ( Component* component );
double getArea ( Component* component );

View File

@ -46,10 +46,10 @@ typedef GenericFilter<Component*> ComponentFilter;
#define for_each_component(component, components)\
/************************************************/\
{\
ComponentLocator _locator = components.GetLocator();\
while (_locator.IsValid()) {\
Component* component = _locator.GetElement();\
_locator.Progress();
ComponentLocator _locator = components.getLocator();\
while (_locator.IsValid()) {\
Component* component = _locator.getElement();\
_locator.Progress();

View File

@ -40,7 +40,7 @@ CompositeLayer* CompositeLayer::create(Technology* technology, const Name& name,
CompositeLayer* compositeLayer =
new CompositeLayer(technology, name, type, minimalSize, minimalSpacing);
compositeLayer->_PostCreate();
compositeLayer->_postCreate();
return compositeLayer;
}
@ -48,7 +48,7 @@ CompositeLayer* CompositeLayer::create(Technology* technology, const Name& name,
BasicLayers CompositeLayer::getBasicLayers() const
// ***********************************************
{
return GetCollection(_basicLayerList);
return getCollection(_basicLayerList);
}
Unit CompositeLayer::getContactSize(const BasicLayer* basicLayer) const
@ -142,16 +142,16 @@ void CompositeLayer::remove(BasicLayer* basicLayer)
_setExtractMask(extractMask);
}
string CompositeLayer::_GetString() const
string CompositeLayer::_getString() const
// **************************************
{
string s = Inherit::_GetString();
string s = Inherit::_getString();
/*
s.insert(s.length() - 1, " " + GetString(_type));
s.insert(s.length() - 1, " " + getString(_type));
s.insert(s.length() - 1, " {");
string separator = "";
for_each_basic_layer(basicLayer, GetBasicLayers()) {
s.insert(s.length() - 1, separator + GetString(basicLayer->GetName()));
for_each_basic_layer(basicLayer, getBasicLayers()) {
s.insert(s.length() - 1, separator + getString(basicLayer->getName()));
separator = "|";
end_for;
}
@ -160,21 +160,21 @@ string CompositeLayer::_GetString() const
return s;
}
Record* CompositeLayer::_GetRecord() const
Record* CompositeLayer::_getRecord() const
// ***************************************
{
Record* record = Inherit::_GetRecord();
Record* record = Inherit::_getRecord();
if (record) {
record->Add(GetSlot("Type", &_type));
record->Add(GetSlot("BasicLayers", &_basicLayerList));
record->Add(GetSlot("ContactSizes", &_contactSizeMap));
record->Add(GetSlot("SegmentSizes", &_segmentSizeMap));
record->Add(GetSlot("SegmentExtentions", &_segmentExtentionMap));
record->Add(GetSlot("PadSizes", &_padSizeMap));
record->Add(GetSlot("MaximalContactSize", &_maximalContactSize));
record->Add(GetSlot("MaximalSegmentSize", &_maximalSegmentSize));
record->Add(GetSlot("MaximalSegmentExtention", &_maximalSegmentExtention));
record->Add(GetSlot("MaximalPadSize", &_maximalPadSize));
record->Add(getSlot("Type", &_type));
record->Add(getSlot("BasicLayers", &_basicLayerList));
record->Add(getSlot("ContactSizes", &_contactSizeMap));
record->Add(getSlot("SegmentSizes", &_segmentSizeMap));
record->Add(getSlot("SegmentExtentions", &_segmentExtentionMap));
record->Add(getSlot("PadSizes", &_padSizeMap));
record->Add(getSlot("MaximalContactSize", &_maximalContactSize));
record->Add(getSlot("MaximalSegmentSize", &_maximalSegmentSize));
record->Add(getSlot("MaximalSegmentExtention", &_maximalSegmentExtention));
record->Add(getSlot("MaximalPadSize", &_maximalPadSize));
}
return record;
}
@ -218,7 +218,7 @@ CompositeLayer::Type& CompositeLayer::Type::operator=(const Type& type)
return *this;
}
string CompositeLayer::Type::_GetString() const
string CompositeLayer::Type::_getString() const
// ********************************************
{
switch (_code) {
@ -229,11 +229,11 @@ string CompositeLayer::Type::_GetString() const
return "ABNORMAL";
}
Record* CompositeLayer::Type::_GetRecord() const
Record* CompositeLayer::Type::_getRecord() const
// *********************************************
{
Record* record = new Record(GetString(this));
record->Add(GetSlot("Code", (int)_code));
Record* record = new Record(getString(this));
record->Add(getSlot("Code", (int)_code));
return record;
}

View File

@ -42,9 +42,9 @@ class CompositeLayer : public Layer {
public: const Code& getCode() const {return _code;};
public: string _GetTypeName() const { return _TName("CompositeLayer::Type"); };
public: string _GetString() const;
public: Record* _GetRecord() const;
public: string _getTypeName() const { return _TName("CompositeLayer::Type"); };
public: string _getString() const;
public: Record* _getRecord() const;
};
@ -97,9 +97,9 @@ class CompositeLayer : public Layer {
// Others
// ******
public: virtual string _GetTypeName() const {return _TName("CompositeLayer");};
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: virtual string _getTypeName() const {return _TName("CompositeLayer");};
public: virtual string _getString() const;
public: virtual Record* _getRecord() const;
public: virtual BasicLayer* _getSymbolicBasicLayer() {return _symbolicBasicLayer;};
public: BasicLayerList& _getBasicLayerList() {return _basicLayerList;};

View File

@ -46,10 +46,10 @@ typedef GenericFilter<CompositeLayer*> CompositeLayerFilter;
#define for_each_composite_layer(compositeLayer, compositeLayers)\
/****************************************************************/\
{\
CompositeLayerLocator _locator = compositeLayers.GetLocator();\
while (_locator.IsValid()) {\
CompositeLayer* compositeLayer = _locator.GetElement();\
_locator.Progress();
CompositeLayerLocator _locator = compositeLayers.getLocator();\
while (_locator.IsValid()) {\
CompositeLayer* compositeLayer = _locator.getElement();\
_locator.Progress();

View File

@ -25,58 +25,58 @@ class Contact_Hooks : public Collection<Hook*> {
// Types
// *****
public: typedef Collection<Hook*> Inherit;
public: typedef Collection<Hook*> Inherit;
public: class Locator : public Hurricane::Locator<Hook*> {
// *****************************************************
public: class Locator : public Hurricane::Locator<Hook*> {
// *****************************************************
public: typedef Hurricane::Locator<Hook*> Inherit;
public: typedef Hurricane::Locator<Hook*> Inherit;
private: const Contact* _contact;
private: Hook* _hook;
private: const Contact* _contact;
private: Hook* _hook;
public: Locator(const Contact* contact = NULL);
public: Locator(const Locator& locator);
public: Locator(const Contact* contact = NULL);
public: Locator(const Locator& locator);
public: Locator& operator=(const Locator& locator);
public: Locator& operator=(const Locator& locator);
public: virtual Hook* GetElement() const;
public: virtual Hurricane::Locator<Hook*>* GetClone() const;
public: virtual Hook* getElement() const;
public: virtual Hurricane::Locator<Hook*>* getClone() const;
public: virtual bool IsValid() const;
public: virtual bool IsValid() const;
public: virtual void Progress();
public: virtual void Progress();
public: virtual string _GetString() const;
public: virtual string _getString() const;
};
};
// Attributes
// **********
private: const Contact* _contact;
private: const Contact* _contact;
// Constructors
// ************
public: Contact_Hooks(const Contact* contact = NULL);
public: Contact_Hooks(const Contact_Hooks& hooks);
public: Contact_Hooks(const Contact* contact = NULL);
public: Contact_Hooks(const Contact_Hooks& hooks);
// Operators
// *********
public: Contact_Hooks& operator=(const Contact_Hooks& hooks);
public: Contact_Hooks& operator=(const Contact_Hooks& hooks);
// Accessors
// ********^
public: virtual Collection<Hook*>* GetClone() const;
public: virtual Hurricane::Locator<Hook*>* GetLocator() const;
public: virtual Collection<Hook*>* getClone() const;
public: virtual Hurricane::Locator<Hook*>* getLocator() const;
// Others
// ******
public: virtual string _GetString() const;
public: virtual string _getString() const;
};
@ -89,284 +89,284 @@ class Contact_Hooks : public Collection<Hook*> {
Contact::Contact(Net* net, Layer* layer, const Unit& x, const Unit& y, const Unit& width, const Unit& height)
// ****************************************************************************************************
: Inherit(net),
_anchorHook(this),
_layer(layer),
_dx(x),
_dy(y),
_width(width),
_height(height)
_anchorHook(this),
_layer(layer),
_dx(x),
_dy(y),
_width(width),
_height(height)
{
if (!_layer)
throw Error("Can't create " + _TName("Contact") + " : null layer");
if (!_layer)
throw Error("Can't create " + _TName("Contact") + " : null layer");
}
Contact::Contact(Net* net, Component* anchor, Layer* layer, const Unit& dx, const Unit& dy, const Unit& width, const Unit& height)
// ****************************************************************************************************
: Inherit(net),
_anchorHook(this),
_layer(layer),
_dx(dx),
_dy(dy),
_width(width),
_height(height)
_anchorHook(this),
_layer(layer),
_dx(dx),
_dy(dy),
_width(width),
_height(height)
{
if (!anchor)
throw Error("Can't create " + _TName("Contact") + " : null anchor");
if (!anchor)
throw Error("Can't create " + _TName("Contact") + " : null anchor");
if (!anchor->GetNet())
throw Error("Can't create " + _TName("Contact") + " : unconnected anchor");
if (!anchor->getNet())
throw Error("Can't create " + _TName("Contact") + " : unconnected anchor");
if (anchor->GetNet() != GetNet())
throw Error("Can't create " + _TName("Contact") + " : incompatible anchor");
if (anchor->getNet() != getNet())
throw Error("Can't create " + _TName("Contact") + " : incompatible anchor");
if (!_layer)
throw Error("Can't create " + _TName("Contact") + " : null layer");
if (!_layer)
throw Error("Can't create " + _TName("Contact") + " : null layer");
_anchorHook.Attach(anchor->GetBodyHook());
_anchorHook.Attach(anchor->getBodyHook());
}
Contact* Contact::Create(Net* net, Layer* layer, const Unit& x, const Unit& y, const Unit& width, const Unit& height)
// ****************************************************************************************************
{
Contact* contact = new Contact(net, layer, x, y, width, height);
Contact* contact = new Contact(net, layer, x, y, width, height);
contact->_PostCreate();
contact->_postCreate();
return contact;
return contact;
}
Contact* Contact::Create(Component* anchor, Layer* layer, const Unit& dx, const Unit& dy, const Unit& width, const Unit& height)
// ****************************************************************************************************
{
if (!anchor)
throw Error("Can't create " + _TName("Contact") + " : null anchor");
if (!anchor)
throw Error("Can't create " + _TName("Contact") + " : null anchor");
Contact* contact = new Contact(anchor->GetNet(), anchor, layer, dx, dy, width, height);
Contact* contact = new Contact(anchor->getNet(), anchor, layer, dx, dy, width, height);
contact->_PostCreate();
contact->_postCreate();
return contact;
return contact;
}
Hooks Contact::GetHooks() const
Hooks Contact::getHooks() const
// ****************************
{
return Contact_Hooks(this);
return Contact_Hooks(this);
}
Unit Contact::GetX() const
Unit Contact::getX() const
// ***********************
{
Component* anchor = GetAnchor();
return (!anchor) ? _dx : anchor->GetX() + _dx;
Component* anchor = getAnchor();
return (!anchor) ? _dx : anchor->getX() + _dx;
}
Unit Contact::GetY() const
Unit Contact::getY() const
// ***********************
{
Component* anchor = GetAnchor();
return (!anchor) ? _dy : anchor->GetY() + _dy;
Component* anchor = getAnchor();
return (!anchor) ? _dy : anchor->getY() + _dy;
}
Point Contact::GetPosition() const
Point Contact::getPosition() const
// *******************************
{
Component* anchor = GetAnchor();
return (!anchor) ? Point(_dx, _dy) : anchor->GetPosition().translate(_dx, _dy);
Component* anchor = getAnchor();
return (!anchor) ? Point(_dx, _dy) : anchor->getPosition().translate(_dx, _dy);
}
Box Contact::GetBoundingBox() const
Box Contact::getBoundingBox() const
// ********************************
{
Unit size = _GetSize();
Unit size = _getSize();
return Box(GetPosition()).inflate(GetHalfWidth() + size, GetHalfHeight() + size);
return Box(getPosition()).inflate(getHalfWidth() + size, getHalfHeight() + size);
}
Box Contact::GetBoundingBox(const BasicLayer* basicLayer) const
Box Contact::getBoundingBox(const BasicLayer* basicLayer) const
// ******************************************************
{
if (!_layer->contains(basicLayer)) return Box();
if (!_layer->contains(basicLayer)) return Box();
Unit size = _GetSize(basicLayer);
Unit size = _getSize(basicLayer);
return Box(GetPosition()).inflate(GetHalfWidth() + size, GetHalfHeight() + size);
return Box(getPosition()).inflate(getHalfWidth() + size, getHalfHeight() + size);
}
Component* Contact::GetAnchor() const
Component* Contact::getAnchor() const
// **********************************
{
Hook* masterHook = _anchorHook.GetMasterHook();
return (masterHook) ? masterHook->GetComponent() : NULL;
Hook* masterHook = _anchorHook.getMasterHook();
return (masterHook) ? masterHook->getComponent() : NULL;
}
void Contact::Translate(const Unit& dx, const Unit& dy)
// ****************************************************
{
if ((dx != 0) || (dy != 0)) {
Invalidate(true);
_dx += dx;
_dy += dy;
}
if ((dx != 0) || (dy != 0)) {
Invalidate(true);
_dx += dx;
_dy += dy;
}
}
void Contact::SetLayer(Layer* layer)
// *********************************
{
if (!layer)
throw Error("Can't set layer : null layer");
if (!layer)
throw Error("Can't set layer : null layer");
if (layer != _layer) {
Invalidate(false);
_layer = layer;
}
if (layer != _layer) {
Invalidate(false);
_layer = layer;
}
}
void Contact::SetWidth(const Unit& width)
// **************************************
{
if (width != _width) {
Invalidate(false);
_width = width;
}
if (width != _width) {
Invalidate(false);
_width = width;
}
}
void Contact::SetHeight(const Unit& height)
// ****************************************
{
if (height != _height) {
Invalidate(false);
_height = height;
}
if (height != _height) {
Invalidate(false);
_height = height;
}
}
void Contact::SetSizes(const Unit& width, const Unit& height)
// **********************************************************
{
if ((width != _width) || (height != _height)) {
Invalidate(false);
_width = width;
_height = height;
}
if ((width != _width) || (height != _height)) {
Invalidate(false);
_width = width;
_height = height;
}
}
void Contact::SetX(const Unit& x)
// ******************************
{
SetPosition(x, GetY());
SetPosition(x, getY());
}
void Contact::SetY(const Unit& y)
// ******************************
{
SetPosition(GetX(), y);
SetPosition(getX(), y);
}
void Contact::SetPosition(const Unit& x, const Unit& y)
// ****************************************************
{
Component* anchor = GetAnchor();
if (!anchor)
SetOffset(x, y);
else
SetOffset(x - anchor->GetX(), y - anchor->GetY());
Component* anchor = getAnchor();
if (!anchor)
SetOffset(x, y);
else
SetOffset(x - anchor->getX(), y - anchor->getY());
}
void Contact::SetPosition(const Point& position)
// *********************************************
{
SetPosition(position.getX(), position.getY());
SetPosition(position.getX(), position.getY());
}
void Contact::SetDx(const Unit& dx)
// ********************************
{
SetOffset(dx, _dy);
SetOffset(dx, _dy);
}
void Contact::SetDy(const Unit& dy)
// ********************************
{
SetOffset(_dx, dy);
SetOffset(_dx, dy);
}
void Contact::SetOffset(const Unit& dx, const Unit& dy)
// ****************************************************
{
if ((dx != _dx) || (dy != _dy)) {
Invalidate(true);
_dx = dx;
_dy = dy;
}
if ((dx != _dx) || (dy != _dy)) {
Invalidate(true);
_dx = dx;
_dy = dy;
}
}
void Contact::_PreDelete()
void Contact::_preDestroy()
// ***********************
{
// trace << "entering Contact::PreDelete: " << this << endl;
// trace << "entering Contact::PreDestroy " << this << endl;
// trace_in();
Inherit::_PreDelete();
Inherit::_preDestroy();
_anchorHook.Detach();
_anchorHook.Detach();
// trace << "exiting Contact::PreDelete:" << endl;
// trace << "exiting Contact::PreDestroy" << endl;
// trace_out();
}
string Contact::_GetString() const
string Contact::_getString() const
// *******************************
{
string s = Inherit::_GetString();
s.insert(s.length() - 1, " " + GetString(_layer->getName()));
s.insert(s.length() - 1, " [" + GetValueString(GetX()));
s.insert(s.length() - 1, " " + GetValueString(GetY()));
s.insert(s.length() - 1, "] " + GetValueString(_width));
s.insert(s.length() - 1, "x" + GetValueString(_height));
return s;
string s = Inherit::_getString();
s.insert(s.length() - 1, " " + getString(_layer->getName()));
s.insert(s.length() - 1, " [" + getValueString(getX()));
s.insert(s.length() - 1, " " + getValueString(getY()));
s.insert(s.length() - 1, "] " + getValueString(_width));
s.insert(s.length() - 1, "x" + getValueString(_height));
return s;
}
Record* Contact::_GetRecord() const
Record* Contact::_getRecord() const
// **************************
{
Record* record = Inherit::_GetRecord();
if (record) {
record->Add(GetSlot("AnchorHook", &_anchorHook));
record->Add(GetSlot("Anchor", GetAnchor()));
record->Add(GetSlot("Layer", _layer));
record->Add(GetSlot("Dx", &_dx));
record->Add(GetSlot("Dy", &_dy));
record->Add(GetSlot("Width", &_width));
record->Add(GetSlot("Height", &_height));
}
return record;
Record* record = Inherit::_getRecord();
if (record) {
record->Add(getSlot("AnchorHook", &_anchorHook));
record->Add(getSlot("Anchor", getAnchor()));
record->Add(getSlot("Layer", _layer));
record->Add(getSlot("Dx", &_dx));
record->Add(getSlot("Dy", &_dy));
record->Add(getSlot("Width", &_width));
record->Add(getSlot("Height", &_height));
}
return record;
}
Unit Contact::_GetSize() const
Unit Contact::_getSize() const
// ***************************
{
Unit size = 0;
Unit size = 0;
Layer* layer = GetLayer();
if (is_a<CompositeLayer*>(layer))
size = ((CompositeLayer*)layer)->getMaximalContactSize();
Layer* layer = getLayer();
if (is_a<CompositeLayer*>(layer))
size = ((CompositeLayer*)layer)->getMaximalContactSize();
return size;
return size;
}
Unit Contact::_GetSize(const BasicLayer* basicLayer) const
Unit Contact::_getSize(const BasicLayer* basicLayer) const
// *******************************************************
{
Layer* layer = GetLayer();
Layer* layer = getLayer();
if (!layer->contains(basicLayer)) return 0;
if (!layer->contains(basicLayer)) return 0;
Unit size = 0;
Unit size = 0;
if (is_a<CompositeLayer*>(layer))
size = ((CompositeLayer*)layer)->getContactSize(basicLayer);
if (is_a<CompositeLayer*>(layer))
size = ((CompositeLayer*)layer)->getContactSize(basicLayer);
return size;
return size;
}
// ****************************************************************************************************
@ -377,25 +377,25 @@ static int ANCHOR_HOOK_OFFSET = -1;
Contact::AnchorHook::AnchorHook(Contact* contact)
// **********************************************
: Inherit()
: Inherit()
{
if (!contact)
throw Error("Can't create " + _TName("Contact::AnchorHook") + " : null contact");
if (!contact)
throw Error("Can't create " + _TName("Contact::AnchorHook") + " : null contact");
if (ANCHOR_HOOK_OFFSET == -1)
ANCHOR_HOOK_OFFSET = (unsigned long)this - (unsigned long)contact;
if (ANCHOR_HOOK_OFFSET == -1)
ANCHOR_HOOK_OFFSET = (unsigned long)this - (unsigned long)contact;
}
Component* Contact::AnchorHook::GetComponent() const
Component* Contact::AnchorHook::getComponent() const
// *************************************************
{
return (Component*)((unsigned long)this - ANCHOR_HOOK_OFFSET);
return (Component*)((unsigned long)this - ANCHOR_HOOK_OFFSET);
}
string Contact::AnchorHook::_GetString() const
string Contact::AnchorHook::_getString() const
// *******************************************
{
return "<" + _TName("Contact::AnchorHook") + " " + GetString(GetComponent()) + ">";
return "<" + _TName("Contact::AnchorHook") + " " + getString(getComponent()) + ">";
}
@ -406,44 +406,44 @@ string Contact::AnchorHook::_GetString() const
Contact_Hooks::Contact_Hooks(const Contact* contact)
// *************************************************
: Inherit(),
_contact(contact)
: Inherit(),
_contact(contact)
{
}
Contact_Hooks::Contact_Hooks(const Contact_Hooks& hooks)
// *****************************************************
: Inherit(),
_contact(hooks._contact)
: Inherit(),
_contact(hooks._contact)
{
}
Contact_Hooks& Contact_Hooks::operator=(const Contact_Hooks& hooks)
// ****************************************************************
{
_contact = hooks._contact;
return *this;
_contact = hooks._contact;
return *this;
}
Collection<Hook*>* Contact_Hooks::GetClone() const
Collection<Hook*>* Contact_Hooks::getClone() const
// ***********************************************
{
return new Contact_Hooks(*this);
return new Contact_Hooks(*this);
}
Locator<Hook*>* Contact_Hooks::GetLocator() const
Locator<Hook*>* Contact_Hooks::getLocator() const
// **********************************************
{
return new Locator(_contact);
return new Locator(_contact);
}
string Contact_Hooks::_GetString() const
string Contact_Hooks::_getString() const
// *************************************
{
string s = "<" + _TName("Contact::Hooks");
if (_contact) s += " " + GetString(_contact);
s += ">";
return s;
string s = "<" + _TName("Contact::Hooks");
if (_contact) s += " " + getString(_contact);
s += ">";
return s;
}
@ -454,65 +454,65 @@ string Contact_Hooks::_GetString() const
Contact_Hooks::Locator::Locator(const Contact* contact)
// ****************************************************
: Inherit(),
_contact(contact),
_hook(NULL)
: Inherit(),
_contact(contact),
_hook(NULL)
{
if (_contact) _hook = ((Contact*)_contact)->GetBodyHook();
if (_contact) _hook = ((Contact*)_contact)->getBodyHook();
}
Contact_Hooks::Locator::Locator(const Locator& locator)
// ****************************************************
: Inherit(),
_contact(locator._contact),
_hook(locator._hook)
: Inherit(),
_contact(locator._contact),
_hook(locator._hook)
{
}
Contact_Hooks::Locator& Contact_Hooks::Locator::operator=(const Locator& locator)
// ******************************************************************************
{
_contact = locator._contact;
_hook = locator._hook;
return *this;
_contact = locator._contact;
_hook = locator._hook;
return *this;
}
Hook* Contact_Hooks::Locator::GetElement() const
Hook* Contact_Hooks::Locator::getElement() const
// *********************************************
{
return _hook;
return _hook;
}
Locator<Hook*>* Contact_Hooks::Locator::GetClone() const
Locator<Hook*>* Contact_Hooks::Locator::getClone() const
// *****************************************************
{
return new Locator(*this);
return new Locator(*this);
}
bool Contact_Hooks::Locator::IsValid() const
// *****************************************
{
return (_hook != NULL);
return (_hook != NULL);
}
void Contact_Hooks::Locator::Progress()
// ************************************
{
if (_hook) {
if (_hook == ((Contact*)_contact)->GetBodyHook())
_hook = ((Contact*)_contact)->GetAnchorHook();
else
_hook = NULL;
}
if (_hook) {
if (_hook == ((Contact*)_contact)->getBodyHook())
_hook = ((Contact*)_contact)->getAnchorHook();
else
_hook = NULL;
}
}
string Contact_Hooks::Locator::_GetString() const
string Contact_Hooks::Locator::_getString() const
// **********************************************
{
string s = "<" + _TName("Contact::Hooks::Locator");
if (_contact) s += " " + GetString(_contact);
s += ">";
return s;
string s = "<" + _TName("Contact::Hooks::Locator");
if (_contact) s += " " + getString(_contact);
s += ">";
return s;
}
} // End of Hurricane namespace.

View File

@ -24,94 +24,91 @@ class Contact : public Component {
// Types
// *****
public: typedef Component Inherit;
public: typedef Component Inherit;
public: class AnchorHook : public Hook {
// ***********************************
public: class AnchorHook : public Hook {
// ***********************************
friend class Contact;
friend class Contact;
public: typedef Hook Inherit;
public: typedef Hook Inherit;
private: AnchorHook(Contact* contact);
private: AnchorHook(Contact* contact);
public: virtual Component* GetComponent() const;
public: virtual Component* getComponent() const;
public: virtual bool IsMaster() const {return false;};
public: virtual bool IsMaster() const {return false;};
public: virtual string _GetTypeName() const { return _TName("Contact::AnchorHook"); };
public: virtual string _GetString() const;
};
public: virtual string _getTypeName() const { return _TName("Contact::AnchorHook"); };
public: virtual string _getString() const;
};
// Attributes
// **********
private: AnchorHook _anchorHook;
private: Layer* _layer;
private: Unit _dx;
private: Unit _dy;
protected: Unit _width;
protected: Unit _height;
private: AnchorHook _anchorHook;
private: Layer* _layer;
private: Unit _dx;
private: Unit _dy;
protected: Unit _width;
protected: Unit _height;
// Constructors
// ************
protected: Contact(Net* net, Layer* layer, const Unit& x, const Unit& y, const Unit& width = 0, const Unit& height = 0);
protected: Contact(Net* net, Component* anchor, Layer* layer, const Unit& dx, const Unit& dy, const Unit& width = 0, const Unit& height = 0);
protected: Contact(Net* net, Layer* layer, const Unit& x, const Unit& y, const Unit& width = 0, const Unit& height = 0);
protected: Contact(Net* net, Component* anchor, Layer* layer, const Unit& dx, const Unit& dy, const Unit& width = 0, const Unit& height = 0);
public: static Contact* Create(Net* net, Layer* layer, const Unit& x, const Unit& y, const Unit& width = 0, const Unit& height = 0);
public: static Contact* Create(Component* anchor, Layer* layer, const Unit& dx, const Unit& dy, const Unit& width = 0, const Unit& height = 0);
public: static Contact* Create(Net* net, Layer* layer, const Unit& x, const Unit& y, const Unit& width = 0, const Unit& height = 0);
public: static Contact* Create(Component* anchor, Layer* layer, const Unit& dx, const Unit& dy, const Unit& width = 0, const Unit& height = 0);
// Accessors
// *********
public: virtual Hooks GetHooks() const;
public: virtual Unit GetX() const;
public: virtual Unit GetY() const;
public: virtual Point GetPosition() const;
public: virtual Box GetBoundingBox() const;
public: virtual Layer* GetLayer() const {return _layer;};
public: virtual Box GetBoundingBox(const BasicLayer* basicLayer) const;
public: Hook* GetAnchorHook() {return &_anchorHook;};
public: Component* GetAnchor() const;
public: const Unit& GetDx() const {return _dx;};
public: const Unit& GetDy() const {return _dy;};
public: const Unit& GetWidth() const {return _width;};
public: Unit GetHalfWidth() const {return (_width / 2);};
public: const Unit& GetHeight() const {return _height;};
public: Unit GetHalfHeight() const {return (_height / 2);};
public: virtual Hooks getHooks() const;
public: virtual Unit getX() const;
public: virtual Unit getY() const;
public: virtual Point getPosition() const;
public: virtual Box getBoundingBox() const;
public: virtual Layer* getLayer() const {return _layer;};
public: virtual Box getBoundingBox(const BasicLayer* basicLayer) const;
public: Hook* getAnchorHook() {return &_anchorHook;};
public: Component* getAnchor() const;
public: const Unit& getDx() const {return _dx;};
public: const Unit& getDy() const {return _dy;};
public: const Unit& getWidth() const {return _width;};
public: Unit getHalfWidth() const {return (_width / 2);};
public: const Unit& getHeight() const {return _height;};
public: Unit getHalfHeight() const {return (_height / 2);};
// Updators
// ********
public: virtual void Translate(const Unit& dx, const Unit& dy);
public: virtual void Translate(const Unit& dx, const Unit& dy);
public: void SetLayer(Layer* layer);
public: void SetWidth(const Unit& width);
public: void SetHeight(const Unit& height);
public: void SetSizes(const Unit& width, const Unit& height);
public: void SetX(const Unit& x);
public: void SetY(const Unit& y);
public: void SetPosition(const Unit& x, const Unit& y);
public: void SetPosition(const Point& position);
public: void SetDx(const Unit& dx);
public: void SetDy(const Unit& dy);
public: void SetOffset(const Unit& dx, const Unit& dy);
public: void SetLayer(Layer* layer);
public: void SetWidth(const Unit& width);
public: void SetHeight(const Unit& height);
public: void SetSizes(const Unit& width, const Unit& height);
public: void SetX(const Unit& x);
public: void SetY(const Unit& y);
public: void SetPosition(const Unit& x, const Unit& y);
public: void SetPosition(const Point& position);
public: void SetDx(const Unit& dx);
public: void SetDy(const Unit& dy);
public: void SetOffset(const Unit& dx, const Unit& dy);
// Others
// ******
protected: virtual void _PreDelete();
protected: virtual void _preDestroy();
public: virtual string _GetTypeName() const {return _TName("Contact");};
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: virtual string _getTypeName() const {return _TName("Contact");};
public: virtual string _getString() const;
public: virtual Record* _getRecord() const;
public: Unit _GetSize() const;
public: Unit _GetSize(const BasicLayer* basicLayer) const;
//public: virtual void _Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation);
//public: virtual void _Highlight(View* view, const Box& updateArea, const Transformation& transformation);
public: Unit _getSize() const;
public: Unit _getSize(const BasicLayer* basicLayer) const;
};

View File

@ -46,9 +46,9 @@ typedef GenericFilter<Contact*> ContactFilter;
#define for_each_contact(contact, contacts)\
/******************************************/\
{\
ContactLocator _locator = contacts.GetLocator();\
ContactLocator _locator = contacts.getLocator();\
while (_locator.IsValid()) {\
Contact* contact = _locator.GetElement();\
Contact* contact = _locator.getElement();\
_locator.Progress();

View File

@ -19,7 +19,7 @@ namespace Hurricane {
DBo::DBo()
// *******
: _propertySet()
: _propertySet()
{
}
@ -28,131 +28,131 @@ DBo::~DBo()
{
}
void DBo::Delete()
void DBo::destroy()
// ***************
{
// trace << "entering DBo::Delete: " << this << endl;
// trace << "entering DBo::destroy: " << this << endl;
// trace_in();
_PreDelete();
_preDestroy();
delete this;
delete this;
// trace << "exiting DBo::Delete:" << endl;
// trace << "exiting DBo::destroy:" << endl;
// trace_out();
}
Property* DBo::GetProperty(const Name& name) const
Property* DBo::getProperty(const Name& name) const
// ***********************************************
{
PropertySet::const_iterator iterator = _propertySet.begin();
while (iterator != _propertySet.end()) {
Property* property = *iterator;
if (property->GetName() == name) return property;
++iterator;
}
return NULL;
PropertySet::const_iterator iterator = _propertySet.begin();
while (iterator != _propertySet.end()) {
Property* property = *iterator;
if (property->getName() == name) return property;
++iterator;
}
return NULL;
}
void DBo::Put(Property* property)
void DBo::put(Property* property)
// ******************************
{
if (!property)
throw Error("Can't put property : null property");
if (!property)
throw Error("Can't put property : null property");
Property* oldProperty = GetProperty(property->GetName());
if (property != oldProperty) {
if (oldProperty) {
_propertySet.erase(oldProperty);
oldProperty->OnReleasedBy(this);
}
_propertySet.insert(property);
property->OnCapturedBy(this);
}
Property* oldProperty = getProperty(property->getName());
if (property != oldProperty) {
if (oldProperty) {
_propertySet.erase(oldProperty);
oldProperty->onReleasedBy(this);
}
_propertySet.insert(property);
property->onCapturedBy(this);
}
}
void DBo::Remove(Property* property)
void DBo::remove(Property* property)
// *********************************
{
if (!property)
throw Error("Can't remove property : null property");
if (!property)
throw Error("Can't remove property : null property");
if (_propertySet.find(property) != _propertySet.end()) {
_propertySet.erase(property);
property->OnReleasedBy(this);
if (is_a<Quark*>(this) && _propertySet.empty()) Delete();
}
if (_propertySet.find(property) != _propertySet.end()) {
_propertySet.erase(property);
property->onReleasedBy(this);
if (is_a<Quark*>(this) && _propertySet.empty()) destroy();
}
}
void DBo::RemoveProperty(const Name& name)
void DBo::removeProperty(const Name& name)
// ***************************************
{
Property* property = GetProperty(name);
if (property) {
_propertySet.erase(property);
property->OnReleasedBy(this);
if (is_a<Quark*>(this) && _propertySet.empty()) Delete();
}
Property* property = getProperty(name);
if (property) {
_propertySet.erase(property);
property->onReleasedBy(this);
if (is_a<Quark*>(this) && _propertySet.empty()) destroy();
}
}
void DBo::ClearProperties()
void DBo::clearProperties()
// ************************
{
// trace << "entering DBo::ClearProperties: " << this << endl;
// trace_in();
while (!_propertySet.empty()) {
Property* property = *_propertySet.begin();
while (!_propertySet.empty()) {
Property* property = *_propertySet.begin();
// trace << property << endl;
_propertySet.erase(property);
property->OnReleasedBy(this);
}
_propertySet.erase(property);
property->onReleasedBy(this);
}
// trace << "exiting DBo::ClearProperties:" << endl;
// trace_out();
}
void DBo::_PostCreate()
void DBo::_postCreate()
// ********************
{
}
void DBo::_PreDelete()
void DBo::_preDestroy()
// *******************
{
// trace << "entering DBo::_PreDelete: " << this << endl;
// trace << "entering DBo::_Predestroy: " << this << endl;
// trace_in();
ClearProperties();
clearProperties();
// trace << "exiting DBo::_PreDelete:" << endl;
// trace << "exiting DBo::_Predestroy:" << endl;
// trace_out();
}
string DBo::_GetString() const
string DBo::_getString() const
// ***************************
{
return "<" + _GetTypeName() + ">";
return "<" + _getTypeName() + ">";
}
Record* DBo::_GetRecord() const
Record* DBo::_getRecord() const
// **********************
{
Record* record = new Record(GetString(this));
if (record) {
record->Add(GetSlot("Properties", &_propertySet));
}
return record;
Record* record = new Record(getString(this));
if (record) {
record->Add(getSlot("Properties", &_propertySet));
}
return record;
}
void DBo::_OnDeleted(Property* property)
void DBo::_onDeleted(Property* property)
// *************************************
{
if (property && (_propertySet.find(property) != _propertySet.end())) {
_propertySet.erase(property);
if (is_a<Quark*>(this) && _propertySet.empty()) Delete();
}
if (property && (_propertySet.find(property) != _propertySet.end())) {
_propertySet.erase(property);
if (is_a<Quark*>(this) && _propertySet.empty()) destroy();
}
}
} // End of Hurricane namespace.

View File

@ -22,7 +22,7 @@ namespace Hurricane {
class DBo : public NestedSlotAdapter {
// *********************************
# if !defined(__DOXYGEN_PROCESSOR__)
#if !defined(__DOXYGEN_PROCESSOR__)
// Types
// *****
@ -54,42 +54,42 @@ class DBo : public NestedSlotAdapter {
// Others
// ******
protected: virtual void _PostCreate();
protected: virtual void _postCreate();
protected: virtual void _PreDelete();
protected: virtual void _preDestroy();
public: virtual string _GetTypeName() const = 0;
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: PropertySet& _GetPropertySet() {return _propertySet;};
public: virtual string _getTypeName() const = 0;
public: virtual string _getString() const;
public: virtual Record* _getRecord() const;
public: PropertySet& _getPropertySet() {return _propertySet;};
public: void _OnDeleted(Property* property);
public: void _onDeleted(Property* property);
# endif
#endif
// Destructors
// ***********
public: virtual void Delete();
public: virtual void destroy();
// Accessors
// *********
public: Property* GetProperty(const Name& name) const;
public: Properties GetProperties() const {return GetCollection(_propertySet);};
public: Property* getProperty(const Name& name) const;
public: Properties getProperties() const {return getCollection(_propertySet);};
// Predicates
// **********
public: bool HasProperty() const {return !_propertySet.empty();};
public: bool hasProperty() const {return !_propertySet.empty();};
// Updators
// ********
public: void Put(Property* property);
public: void Remove(Property* property);
public: void RemoveProperty(const Name& name);
public: void ClearProperties();
public: void put(Property* property);
public: void remove(Property* property);
public: void removeProperty(const Name& name);
public: void clearProperties();
};

View File

@ -46,10 +46,10 @@ typedef GenericFilter<DBo*> DBoFilter;
#define for_each_dbo(dbo, dbos)\
/******************************/\
{\
DBoLocator _locator = dbos.GetLocator();\
while (_locator.IsValid()) {\
DBo* dbo = _locator.GetElement();\
_locator.Progress();
DBoLocator _locator = dbos.getLocator();\
while (_locator.IsValid()) {\
DBo* dbo = _locator.getElement();\
_locator.Progress();

View File

@ -20,75 +20,53 @@ namespace Hurricane {
DRCError::DRCError(Cell* cell, const Name& name, const Box& boundingBox)
// *********************************************************************
: Inherit(cell),
_name(name),
_boundingBox(boundingBox)
_name(name),
_boundingBox(boundingBox)
{
if (_name.IsEmpty())
throw Error("Can't create " + _TName("DRCError") + " : empty name");
if (_name.IsEmpty())
throw Error("Can't create " + _TName("DRCError") + " : empty name");
if (_boundingBox.isEmpty())
throw Error("Can't create " + _TName("DRCError") + " : empty bounding box");
if (_boundingBox.isEmpty())
throw Error("Can't create " + _TName("DRCError") + " : empty bounding box");
}
DRCError* DRCError::Create(Cell* cell, const Name& name, const Box& boundingBox)
// *****************************************************************************
{
DRCError* drcError = new DRCError(cell, name, boundingBox);
DRCError* drcError = new DRCError(cell, name, boundingBox);
drcError->_PostCreate();
drcError->_postCreate();
return drcError;
return drcError;
}
void DRCError::Translate(const Unit& dx, const Unit& dy)
// *****************************************************
{
if ((dx != 0) || (dy != 0)) {
Invalidate(false);
_boundingBox.translate(dx, dy);
}
if ((dx != 0) || (dy != 0)) {
Invalidate(false);
_boundingBox.translate(dx, dy);
}
}
string DRCError::_GetString() const
string DRCError::_getString() const
// ********************************
{
string s = Inherit::_GetString();
s.insert(s.length() - 1, " " + GetString(_name));
s.insert(s.length() - 1, " " + GetString(_boundingBox));
return s;
string s = Inherit::_getString();
s.insert(s.length() - 1, " " + getString(_name));
s.insert(s.length() - 1, " " + getString(_boundingBox));
return s;
}
Record* DRCError::_GetRecord() const
Record* DRCError::_getRecord() const
// ***************************
{
Record* record = Inherit::_GetRecord();
if (record) {
record->Add(GetSlot("Name", &_name));
record->Add(GetSlot("BoundingBox", &_boundingBox));
}
return record;
Record* record = Inherit::_getRecord();
if (record) {
record->Add(getSlot("Name", &_name));
record->Add(getSlot("BoundingBox", &_boundingBox));
}
return record;
}
//bool DRCError::_IsInterceptedBy(View* view, const Point& point, const Unit& aperture) const
//// ****************************************************************************************
//{
// return GetBoundingBox().Intersect(Box(point).Inflate(aperture));
//}
//
//void DRCError::_Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation)
//// ****************************************************************************************************
//{
// assert(!basicLayer);
//
// view->DrawRectangle(transformation.GetBox(GetBoundingBox()));
//}
//
//void DRCError::_Highlight(View* view, const Box& updateArea, const Transformation& transformation)
//// **********************************************************************************************
//{
// view->FillRectangle(transformation.GetBox(GetBoundingBox()));
//}
//
} // End of Hurricane namespace.

View File

@ -23,43 +23,39 @@ class DRCError : public Marker {
// Types
// *****
public: typedef Marker Inherit;
public: typedef Marker Inherit;
// Attributes
// **********
public: Name _name;
public: Box _boundingBox;
public: Name _name;
public: Box _boundingBox;
// Constructors
// ************
protected: DRCError(Cell* cell, const Name& name, const Box& boundingBox);
protected: DRCError(Cell* cell, const Name& name, const Box& boundingBox);
public: static DRCError* Create(Cell* cell, const Name& name, const Box& boundingBox);
public: static DRCError* Create(Cell* cell, const Name& name, const Box& boundingBox);
// Accessors
// *********
public: virtual Box GetBoundingBox() const {return _boundingBox;};
public: const Name& GetName() const {return _name;};
public: virtual Box getBoundingBox() const {return _boundingBox;};
public: const Name& getName() const {return _name;};
// Updators
// ********
public: virtual void Translate(const Unit& dx, const Unit& dy);
public: virtual void Translate(const Unit& dx, const Unit& dy);
// Others
// ******
public: virtual string _GetTypeName() const {return _TName("DRCError");};
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: virtual string _getTypeName() const {return _TName("DRCError");};
public: virtual string _getString() const;
public: virtual Record* _getRecord() const;
// public: virtual bool _IsInterceptedBy(View* view, const Point& point, const Unit& aperture) const;
// public: virtual void _Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation);
// public: virtual void _Highlight(View* view, const Box& updateArea, const Transformation& transformation);
//
};

View File

@ -24,73 +24,73 @@ static DataBase* DATA_BASE = NULL;
DataBase::DataBase()
// *****************
: Inherit(),
_technology(NULL),
_rootLibrary(NULL)
: Inherit(),
_technology(NULL),
_rootLibrary(NULL)
{
if (DATA_BASE)
throw Error("Can't create " + _TName("DataBase") + " : already exists");
if (DATA_BASE)
throw Error("Can't create " + _TName("DataBase") + " : already exists");
}
DataBase* DataBase::Create()
// *************************
{
DataBase* dataBase = new DataBase();
DataBase* dataBase = new DataBase();
dataBase->_PostCreate();
dataBase->_postCreate();
return dataBase;
return dataBase;
}
void DataBase::_PostCreate()
void DataBase::_postCreate()
// *************************
{
Inherit::_PostCreate();
Inherit::_postCreate();
DATA_BASE = this;
DATA_BASE = this;
}
void DataBase::_PreDelete()
void DataBase::_preDestroy()
// ************************
{
OpenUpdateSession();
Inherit::_PreDelete();
OpenUpdateSession();
Inherit::_preDestroy();
if (_rootLibrary) _rootLibrary->Delete();
if (_technology) _technology->Delete();
CloseUpdateSession ();
if (_rootLibrary) _rootLibrary->destroy();
if (_technology) _technology->destroy();
CloseUpdateSession ();
DATA_BASE = NULL;
DATA_BASE = NULL;
}
string DataBase::_GetString() const
string DataBase::_getString() const
// ********************************
{
return Inherit::_GetString();
return Inherit::_getString();
}
Record* DataBase::_GetRecord() const
Record* DataBase::_getRecord() const
// ***************************
{
Record* record = Inherit::_GetRecord();
if (record) {
record->Add(GetSlot("Technology", _technology));
record->Add(GetSlot("RootLibrary", _rootLibrary));
record->Add(GetSlot("Precision", GetPrecision()));
record->Add(GetSlot("Resolution", GetValueString(1)));
record->Add(GetSlot("GridStep", GetValueString(GetGridStep())));
}
return record;
Record* record = Inherit::_getRecord();
if (record) {
record->Add(getSlot("Technology", _technology));
record->Add(getSlot("RootLibrary", _rootLibrary));
record->Add(getSlot("Precision", getPrecision()));
record->Add(getSlot("Resolution", getValueString(1)));
record->Add(getSlot("GridStep", getValueString(getGridStep())));
}
return record;
}
// ****************************************************************************************************
// Generic functions
// ****************************************************************************************************
DataBase* GetDataBase()
DataBase* getDataBase()
// ********************
{
return DATA_BASE;
return DATA_BASE;
}

View File

@ -29,42 +29,42 @@ class DataBase : public DBo {
// Types
// *****
public: typedef DBo Inherit;
public: typedef DBo Inherit;
// Attributes
// **********
private: Technology* _technology;
private: Library* _rootLibrary;
private: Technology* _technology;
private: Library* _rootLibrary;
// Constructors
// ************
protected: DataBase();
protected: DataBase();
// Others
// ******
protected: virtual void _PostCreate();
protected: virtual void _postCreate();
protected: virtual void _PreDelete();
protected: virtual void _preDestroy();
public: virtual string _GetTypeName() const {return _TName("DataBase");};
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: virtual string _getTypeName() const {return _TName("DataBase");};
public: virtual string _getString() const;
public: virtual Record* _getRecord() const;
public: void _SetTechnology(Technology* technology) {_technology = technology;};
public: void _SetRootLibrary(Library* rootLibrary) {_rootLibrary = rootLibrary;};
public: void _SetTechnology(Technology* technology) {_technology = technology;};
public: void _SetRootLibrary(Library* rootLibrary) {_rootLibrary = rootLibrary;};
# endif
public: static DataBase* Create();
public: static DataBase* Create();
// Accessors
// *********
public: Technology* GetTechnology() const {return _technology;};
public: Library* GetRootLibrary() const {return _rootLibrary;};
public: Technology* getTechnology() const {return _technology;};
public: Library* getRootLibrary() const {return _rootLibrary;};
};
@ -73,7 +73,7 @@ class DataBase : public DBo {
// Generic functions
// ****************************************************************************************************
DataBase* GetDataBase();
DataBase* getDataBase();

View File

@ -96,8 +96,8 @@ namespace {
// Constructor : "DeepNet::DeepNet ()".
DeepNet::DeepNet ( Occurrence& netOccurrence )
: Net(netOccurrence.GetOwnerCell()
,netOccurrence.GetName()
: Net(netOccurrence.getOwnerCell()
,netOccurrence.getName()
)
, _netOccurrence(netOccurrence)
{
@ -107,13 +107,13 @@ DeepNet::DeepNet ( Occurrence& netOccurrence )
// -------------------------------------------------------------------
// Inspector Management : "DeepNet::_GetRecord ()".
// Inspector Management : "DeepNet::_getRecord ()".
Record* DeepNet::_GetRecord () const
Record* DeepNet::_getRecord () const
{
Record* record = Net::_GetRecord();
Record* record = Net::_getRecord();
if (record) {
record->Add(GetSlot("_netOccurrence", &_netOccurrence));
record->Add(getSlot("_netOccurrence", &_netOccurrence));
}
return record;
}
@ -130,13 +130,13 @@ DeepNet* DeepNet::Create ( HyperNet& hyperNet )
if ( !hyperNet.IsValid() )
throw Error ( "Can't create " + _TName("DeepNet") + ": occurence is invalid." );
Occurrence rootNetOccurrence = GetHyperNetRootNetOccurrence ( hyperNet.GetNetOccurrence() );
Occurrence rootNetOccurrence = getHyperNetRootNetOccurrence ( hyperNet.getNetOccurrence() );
if ( rootNetOccurrence.GetMasterCell()->IsFlattenLeaf() ) return NULL;
if ( rootNetOccurrence.GetPath().IsEmpty() ) return NULL;
if ( rootNetOccurrence.getMasterCell()->IsFlattenLeaf() ) return NULL;
if ( rootNetOccurrence.getPath().IsEmpty() ) return NULL;
DeepNet* deepNet = new DeepNet ( rootNetOccurrence );
deepNet->_PostCreate ();
deepNet->_postCreate ();
return deepNet;
}
@ -154,13 +154,13 @@ size_t DeepNet::_CreateRoutingPads ( bool buildRings )
RoutingPad* previousRP = NULL;
RoutingPad* currentRP = NULL;
for_each_occurrence ( plugOccurrence, hyperNet.GetLeafPlugOccurrences() ) {
for_each_occurrence ( plugOccurrence, hyperNet.getLeafPlugOccurrences() ) {
nbRoutingPads++;
currentRP = CreateRoutingPad ( this, plugOccurrence );
if ( buildRings ) {
if ( previousRP ) {
currentRP->GetBodyHook()->Attach ( previousRP->GetBodyHook() );
currentRP->getBodyHook()->Attach ( previousRP->getBodyHook() );
}
previousRP = currentRP;
}
@ -175,15 +175,15 @@ size_t DeepNet::_CreateRoutingPads ( bool buildRings )
// -------------------------------------------------------------------
//
Net* GetDeepNet(HyperNet& hypernet)
Net* getDeepNet(HyperNet& hypernet)
// ********************************
{
Occurrence rootNetOccurrence = GetHyperNetRootNetOccurrence ( hypernet.GetNetOccurrence() );
Occurrence rootNetOccurrence = getHyperNetRootNetOccurrence ( hypernet.getNetOccurrence() );
//if ( rootNetOccurrence.GetMasterCell()->IsFlattenLeaf() ) return NULL;
//if ( rootNetOccurrence.GetPath().IsEmpty() ) return NULL;
//if ( rootNetOccurrence.getMasterCell()->IsFlattenLeaf() ) return NULL;
//if ( rootNetOccurrence.getPath().IsEmpty() ) return NULL;
return rootNetOccurrence.GetOwnerCell()->GetNet(rootNetOccurrence.GetName());
return rootNetOccurrence.getOwnerCell()->getNet(rootNetOccurrence.getName());
}

View File

@ -77,21 +77,21 @@ namespace Hurricane {
// Inspector Management.
public:
virtual Record* _GetRecord () const;
virtual string _GetTypeName() const { return "DeepNet"; };
virtual Record* _getRecord () const;
virtual string _getTypeName() const { return "DeepNet"; };
# endif
// Constructors.
public:
static DeepNet* Create ( HyperNet& hyperNet );
static DeepNet* Create ( HyperNet& hyperNet );
// Accessors.
public:
// Predicates.
public:
virtual bool IsDeepNet () const { return true; };
virtual bool IsDeepNet () const { return true; };
// Internal Modifiers.
public:
@ -99,7 +99,7 @@ namespace Hurricane {
};
Net* GetDeepNet(HyperNet& hyperNet);
Net* getDeepNet(HyperNet& hyperNet);
} // End of Hurricane namespace.

View File

@ -20,9 +20,9 @@ namespace Hurricane {
static Name DisplaySlotsCellRelationName("DisplaySlotsCellRelation");
static StandardRelation* GetDisplaySlotRelation(const Cell* cell)
static StandardRelation* getDisplaySlotRelation(const Cell* cell)
{
Property* property = cell->GetProperty(DisplaySlotsCellRelationName);
Property* property = cell->getProperty(DisplaySlotsCellRelationName);
if (!property)
return NULL;
else
@ -57,19 +57,19 @@ DisplaySlot* DisplaySlot::Create(Cell* cell, const Name& name, unsigned short re
{
DisplaySlot* displaySlot = new DisplaySlot(cell, name, red1, green1, blue1, pattern1, linewidth1, red2, green2, blue2, pattern2, linewidth2);
displaySlot->_PostCreate();
displaySlot->_postCreate();
return displaySlot;
}
void DisplaySlot::_PostCreate()
void DisplaySlot::_postCreate()
// ***********************
{
Inherit::_PostCreate();
StandardRelation* relation = GetDisplaySlotRelation(_cell);
Inherit::_postCreate();
StandardRelation* relation = getDisplaySlotRelation(_cell);
if (!relation)
relation = StandardRelation::Create(_cell, DisplaySlotsCellRelationName);
Put(relation);
relation = StandardRelation::create(_cell, DisplaySlotsCellRelationName);
put(relation);
}
void DisplaySlot::Show()
@ -77,7 +77,7 @@ void DisplaySlot::Show()
{
if (!_isVisible) {
_isVisible = true;
//for_each_view(view, _cell->GetViews())
//for_each_view(view, _cell->getViews())
//{
// view->Invalidate();
// end_for;
@ -88,14 +88,9 @@ void DisplaySlot::Show()
void DisplaySlot::Hide()
// *********************
{
if (_isVisible) {
_isVisible = false;
//for_each_view(view, _cell->GetViews())
//{
// view->Invalidate();
// end_for;
//}
}
if (_isVisible) {
_isVisible = false;
}
}
void DisplaySlot::Flush()
@ -103,91 +98,69 @@ void DisplaySlot::Flush()
{
OpenUpdateSession();
vector<Go*> govect;
_quadTree.GetGos().Fill(govect);
for (unsigned i = 0 ; i < govect.size() ; i++)
{
govect[i]->Delete();
_quadTree.getGos().Fill(govect);
for (unsigned i = 0 ; i < govect.size() ; i++) {
govect[i]->destroy();
}
CloseUpdateSession();
}
//void DisplaySlot::_Draw(View* view, const Box& updateArea, const Transformation& transformation)
//// *********************************************************************************************
//{
// if (GetBoundingBox().Intersect(updateArea)) {
// for_each_go(go, _quadTree.GetGos())
// {
// go->_Draw(view, NULL, updateArea, transformation);
// end_for;
// }
// }
//}
//
void DisplaySlot::_PreDelete()
// ***************************
{
Inherit::_PreDelete();
//gdk_gc_destroy(_drawGC);
//gdk_gc_destroy(_fillGC);
}
UserGos DisplaySlot::GetUserGos() const
UserGos DisplaySlot::getUserGos() const
// ************************************
{
return _quadTree.GetGos().GetSubSet<UserGo*>();
return _quadTree.getGos().getSubSet<UserGo*>();
}
UserGos DisplaySlot::GetUserGosUnder(const Box& area) const
UserGos DisplaySlot::getUserGosUnder(const Box& area) const
// ********************************************************
{
return _quadTree.GetGosUnder(area).GetSubSet<UserGo*>();
return _quadTree.getGosUnder(area).getSubSet<UserGo*>();
}
string DisplaySlot::_GetString() const
string DisplaySlot::_getString() const
// ***********************************
{
string s = Inherit::_GetString();
s.insert(s.length() - 1, " " + GetString(GetName()));
string s = Inherit::_getString();
s.insert(s.length() - 1, " " + getString(getName()));
return s;
}
Record* DisplaySlot::_GetRecord() const
Record* DisplaySlot::_getRecord() const
// ******************************
{
Record* record = Inherit::_GetRecord();
Record* record = Inherit::_getRecord();
if (record) {
record->Add(GetSlot("Cell", _cell));
record->Add(GetSlot("Name", _name));
record->Add(GetSlot("QuadTree", &_quadTree));
record->Add(GetSlot("Is Visible", _isVisible));
record->Add(getSlot("Cell", _cell));
record->Add(getSlot("Name", _name));
record->Add(getSlot("QuadTree", &_quadTree));
record->Add(getSlot("Is Visible", _isVisible));
}
return record;
}
DisplaySlots GetDisplaySlots(const Cell* cell)
DisplaySlots getDisplaySlots(const Cell* cell)
{
if (!cell)
throw Error("Null pointer on cell while getting display slots");
StandardRelation* relation = GetDisplaySlotRelation(cell);
StandardRelation* relation = getDisplaySlotRelation(cell);
if (!relation)
return DisplaySlots();
return relation->GetSlaveOwners().GetSubSet<DisplaySlot*>();
return relation->getSlaveOwners().getSubSet<DisplaySlot*>();
}
DisplaySlot* GetDisplaySlot(const Cell* cell,const Name& name)
DisplaySlot* getDisplaySlot(const Cell* cell,const Name& name)
{
if (!cell)
throw Error("Null pointer on cell while getting display slots");
StandardRelation* relation = GetDisplaySlotRelation(cell);
StandardRelation* relation = getDisplaySlotRelation(cell);
if (!relation)
return NULL;
else
{
for_each_display_slot(displaySlot,relation->GetSlaveOwners().GetSubSet<DisplaySlot*>())
{
if (displaySlot->GetName() == name)
for_each_display_slot(displaySlot,relation->getSlaveOwners().getSubSet<DisplaySlot*>()) {
if (displaySlot->getName() == name)
return displaySlot;
end_for;
}

View File

@ -34,8 +34,6 @@ class DisplaySlot : public DBo {
private: Cell* _cell;
private: Name _name;
private: QuadTree _quadTree;
//private: GdkGC* _drawGC;
//private: GdkGC* _fillGC;
private: bool _isVisible;
// Constructors
@ -43,20 +41,15 @@ class DisplaySlot : public DBo {
protected: DisplaySlot(Cell* cell,const Name& name, unsigned short red1, unsigned short green1, unsigned short blue1, const string& pattern1, unsigned linewidth1, unsigned short red2, unsigned short green2, unsigned short blue2, const string& pattern2, unsigned linewidth2);
public: static DisplaySlot* Create(Cell* cell, const Name& name, unsigned short red1, unsigned short green1, unsigned short blue1, const string& pattern1 = "FFFFFFFFFFFFFFFF", unsigned linewidth1=0, unsigned short red2 = 0, unsigned short green2 = 0, unsigned short blue2 = 0, const string& pattern2 = "FFFFFFFFFFFFFFFF", unsigned linewidth2=0);
protected: virtual void _PostCreate();
// Destructor
// **********
protected: virtual void _PreDelete();
protected: virtual void _postCreate();
// Accessors
// *********
public: const Name& GetName() const {return _name;};
public: const Box& GetBoundingBox() const {return _quadTree.GetBoundingBox();};
public: UserGos GetUserGos() const;
public: UserGos GetUserGosUnder(const Box& area) const;
public: const Name& getName() const {return _name;};
public: const Box& getBoundingBox() const {return _quadTree.getBoundingBox();};
public: UserGos getUserGos() const;
public: UserGos getUserGosUnder(const Box& area) const;
// Predicates
// **********
@ -71,20 +64,17 @@ class DisplaySlot : public DBo {
// Others
// ******
//public: GdkGC* _GetDrawGC() const { return _drawGC; }
//public: GdkGC* _GetFillGC() const { return _fillGC; }
public: QuadTree& _GetQuadTree() { return _quadTree; }
//public: virtual void _Draw(View* view, const Box& updateArea, const Transformation& transformation);
public: QuadTree& _getQuadTree() { return _quadTree; }
public: virtual string _GetTypeName() const {return _TName("DisplaySlot");};
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: virtual string _getTypeName() const {return _TName("DisplaySlot");};
public: virtual string _getString() const;
public: virtual Record* _getRecord() const;
};
DisplaySlots GetDisplaySlots(const Cell* cell);
DisplaySlots getDisplaySlots(const Cell* cell);
DisplaySlot* GetDisplaySlot(const Cell* cell, const Name& name);
DisplaySlot* getDisplaySlot(const Cell* cell, const Name& name);

View File

@ -50,10 +50,10 @@ typedef GenericFilter<DisplaySlot*> DisplaySlotFilter;
#define for_each_display_slot(displaySlot, displaySlots)\
/******************************************************/\
{\
DisplaySlotLocator _locator = displaySlots.GetLocator();\
while (_locator.IsValid()) {\
DisplaySlot* displaySlot = _locator.GetElement();\
_locator.Progress();
DisplaySlotLocator _locator = displaySlots.getLocator();\
while (_locator.IsValid()) {\
DisplaySlot* displaySlot = _locator.getElement();\
_locator.Progress();

View File

@ -46,9 +46,9 @@ typedef GenericFilter<Entity*> EntityFilter;
#define for_each_entity(entity, entities)\
/****************************************/\
{\
EntityLocator _locator = entities.GetLocator();\
EntityLocator _locator = entities.getLocator();\
while (_locator.IsValid()) {\
Entity* entity = _locator.GetElement();\
Entity* entity = _locator.getElement();\
_locator.Progress();

View File

@ -20,71 +20,71 @@ namespace Hurricane {
Entity::Entity()
// *************
: Inherit()
: Inherit()
{
}
void Entity::_PreDelete()
void Entity::_preDestroy()
// **********************
{
// trace << "entering Entity::_PreDelete: " << this << endl;
// trace << "entering Entity::_preDestroy: " << this << endl;
// trace_in();
vector<Entity*> slaveEntities;
SlaveEntityMap::iterator it;
SlaveEntityMap::iterator end;
GetCell()->_GetSlaveEntities(this,it,end);
getCell()->_getSlaveEntities(this,it,end);
for(; it != end ; it++)
slaveEntities.push_back(it->second);
for(; slaveEntities.size() ; slaveEntities.pop_back()) {
cerr << "Erasing " << slaveEntities.back() << endl;
slaveEntities.back()->Delete();
slaveEntities.back()->destroy();
}
Quark* quark = _GetQuark();
if (quark) quark->Delete();
Quark* quark = _getQuark();
if (quark) quark->destroy();
stack<SharedPath*> sharedPathStack;
for_each_instance(instance, GetCell()->GetSlaveInstances()) {
SharedPath* sharedPath = instance->_GetSharedPath(NULL);
if (sharedPath) sharedPathStack.push(sharedPath);
end_for;
}
while (!sharedPathStack.empty()) {
SharedPath* sharedPath = sharedPathStack.top();
sharedPathStack.pop();
Quark* quark = _GetQuark(sharedPath);
if (quark) quark->Delete();
Cell* cell = sharedPath->GetOwnerCell();
for_each_instance(instance, cell->GetSlaveInstances()) {
SharedPath* sharedPath2 = instance->_GetSharedPath(sharedPath);
if (sharedPath2) sharedPathStack.push(sharedPath2);
end_for;
}
}
stack<SharedPath*> sharedPathStack;
for_each_instance(instance, getCell()->getSlaveInstances()) {
SharedPath* sharedPath = instance->_getSharedPath(NULL);
if (sharedPath) sharedPathStack.push(sharedPath);
end_for;
}
while (!sharedPathStack.empty()) {
SharedPath* sharedPath = sharedPathStack.top();
sharedPathStack.pop();
Quark* quark = _getQuark(sharedPath);
if (quark) quark->destroy();
Cell* cell = sharedPath->getOwnerCell();
for_each_instance(instance, cell->getSlaveInstances()) {
SharedPath* sharedPath2 = instance->_getSharedPath(sharedPath);
if (sharedPath2) sharedPathStack.push(sharedPath2);
end_for;
}
}
Inherit::_PreDelete();
Inherit::_preDestroy();
// trace << "exiting Entity::_PreDelete:" << endl;
// trace << "exiting Entity::_preDestroy:" << endl;
// trace_out();
}
string Entity::_GetString() const
string Entity::_getString() const
// ******************************
{
return Inherit::_GetString();
return Inherit::_getString();
}
Record* Entity::_GetRecord() const
Record* Entity::_getRecord() const
// *************************
{
Record* record = Inherit::_GetRecord();
if (record) {
Occurrence occurrence = Occurrence(this);
if (occurrence.HasProperty())
record->Add(GetSlot("Occurrence", occurrence));
}
return record;
Record* record = Inherit::_getRecord();
if (record) {
Occurrence occurrence = Occurrence(this);
if (occurrence.HasProperty())
record->Add(getSlot("Occurrence", occurrence));
}
return record;
}

View File

@ -31,29 +31,29 @@ class Entity : public DBo {
// Types
// *****
public: typedef DBo Inherit;
public: typedef DBo Inherit;
// Constructors
// ************
protected: Entity();
protected: Entity();
// Others
// ******
protected: virtual void _PreDelete();
protected: virtual void _preDestroy();
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: Quark* _GetQuark(SharedPath* sharedPath = NULL) const;
public: virtual string _getString() const;
public: virtual Record* _getRecord() const;
public: Quark* _getQuark(SharedPath* sharedPath = NULL) const;
# endif
// Accessors
// *********
public: virtual Cell* GetCell() const = 0;
public: virtual Box GetBoundingBox() const = 0;
public: virtual Cell* getCell() const = 0;
public: virtual Box getBoundingBox() const = 0;
};

View File

@ -17,34 +17,34 @@ namespace Hurricane {
Error::Error(const string& reason, int code)
// *****************************************
: Inherit(),
_reason(reason),
_code(code)
: Inherit(),
_reason(reason),
_code(code)
{
}
Error::Error(const Error& error)
// *****************************
: Inherit(),
_reason(error._reason),
_code(error._code)
: Inherit(),
_reason(error._reason),
_code(error._code)
{
}
Error& Error::operator=(const Error& error)
// ****************************************
{
_reason = error._reason;
_code = error._code;
return *this;
_reason = error._reason;
_code = error._code;
return *this;
}
string Error::_GetString() const
string Error::_getString() const
// *****************************
{
if (!_code) return "[ERROR] " + _reason;
if (!_code) return "[ERROR] " + _reason;
return "[ERROR:" + GetString(_code) + "] " + _reason;
return "[ERROR:" + getString(_code) + "] " + _reason;
}

View File

@ -23,31 +23,31 @@ class Error : public Exception {
// Types
// *****
public: typedef Exception Inherit;
public: typedef Exception Inherit;
// Attributes
// **********
private: string _reason;
private: int _code;
private: string _reason;
private: int _code;
// Constructors
// ************
public: Error(const string& reason, int code = 0);
public: Error(const string& reason, int code = 0);
public: Error(const Error& error);
public: Error(const Error& error);
// Operators
// *********
public: Error& operator=(const Error& error);
public: Error& operator=(const Error& error);
// Accessors
// *********
public: string GetReason() const {return _reason;};
public: int GetCode() const {return _code;};
public: string getReason() const {return _reason;};
public: int getCode() const {return _code;};
// Modifiers
// *********
@ -57,8 +57,8 @@ class Error : public Exception {
// Others
// ******
public: virtual string _GetTypeName() const { return _TName("Error"); };
public: virtual string _GetString() const;
public: virtual string _getTypeName() const { return _TName("Error"); };
public: virtual string _getString() const;
};

View File

@ -23,29 +23,29 @@ class Exception : public NestedSlotAdapter {
// Constructors
// ************
protected: Exception();
protected: Exception();
private: Exception(const Exception& exception); // not implemented to forbid copy construction
private: Exception(const Exception& exception); // not implemented to forbid copy construction
// Destructor
// **********
public: virtual ~Exception();
public: virtual ~Exception();
// Operators
// *********
private: Exception& operator=(const Exception& exception); // not implemented to forbid assignment
private: Exception& operator=(const Exception& exception); // not implemented to forbid assignment
// Accessors
// *********
public: string What() const { return _GetString(); };
public: string What() const { return _getString(); };
// Others
// ******
public: virtual string _GetString() const = 0;
public: virtual string _getString() const = 0;
};

View File

@ -26,41 +26,41 @@ template<class Type> class Filter : public NestedSlotAdapter {
// Constructors
// ************
public: Filter() {};
public: Filter() {};
private: Filter(const Filter& filter); // not implemented to forbid copie
private: Filter(const Filter& filter); // not implemented to forbid copie
// Destructor
// **********
public: virtual ~Filter() {};
public: virtual ~Filter() {};
// Operators
// *********
private: Filter& operator=(const Filter& filter); // not implemented to forbid assigment
private: Filter& operator=(const Filter& filter); // not implemented to forbid assigment
public: GenericFilter<Type> operator!() const
// ******************************************
{
return NotFilter<Type>(*this);
};
public: GenericFilter<Type> operator!() const
// ******************************************
{
return NotFilter<Type>(*this);
};
// Accessors
// *********
public: virtual Filter<Type>* GetClone() const = 0;
public: virtual Filter<Type>* getClone() const = 0;
// Predicates
// **********
public: virtual bool Accept(Type type) const = 0;
public: virtual bool Accept(Type type) const = 0;
// Others
// ******
public: virtual string _GetTypeName() const { return _TName("Filter"); };
public: virtual string _GetString() const = 0;
public: virtual string _getTypeName() const { return _TName("Filter"); };
public: virtual string _getString() const = 0;
};
@ -76,119 +76,119 @@ template<class Type> class GenericFilter : public Filter<Type> {
// Types
// *****
public: typedef Filter<Type> Inherit;
public: typedef Filter<Type> Inherit;
// Attributes
// **********
private: Filter<Type>* _filter;
private: Filter<Type>* _filter;
// Constructors
// ************
public: GenericFilter()
// ********************
: Inherit(),
_filter(NULL)
{
};
public: GenericFilter()
// ********************
: Inherit(),
_filter(NULL)
{
};
public: GenericFilter(const Filter<Type>& filter)
// **********************************************
: Inherit(),
_filter(filter.GetClone())
{
};
public: GenericFilter(const Filter<Type>& filter)
// **********************************************
: Inherit(),
_filter(filter.getClone())
{
};
public: GenericFilter(const GenericFilter<Type>& genericFilter)
// ************************************************************
: Inherit(),
_filter(genericFilter.GetClone())
{
};
public: GenericFilter(const GenericFilter<Type>& genericFilter)
// ************************************************************
: Inherit(),
_filter(genericFilter.getClone())
{
};
public: GenericFilter(Filter<Type>* filter)
// *****************************************************
// CAUTION : filter will be deleted by the GenericFilter
// *****************************************************
: Inherit(),
_filter(filter)
{
};
public: GenericFilter(Filter<Type>* filter)
// *****************************************************
// CAUTION : filter will be deleted by the GenericFilter
// *****************************************************
: Inherit(),
_filter(filter)
{
};
// Destructor
// **********
public: virtual ~GenericFilter()
// *****************************
{
if (_filter) delete _filter;
};
public: virtual ~GenericFilter()
// *****************************
{
if (_filter) delete _filter;
};
// Operators
// *********
public: GenericFilter& operator=(const Filter<Type>& filter)
// *********************************************************
{
if (_filter) delete _filter;
_filter = filter.GetClone();
return *this;
};
public: GenericFilter& operator=(const Filter<Type>& filter)
// *********************************************************
{
if (_filter) delete _filter;
_filter = filter.getClone();
return *this;
};
public: GenericFilter& operator=(const GenericFilter& genericFilter)
// *****************************************************************
{
if (_filter) delete _filter;
_filter = genericFilter.GetClone();
return *this;
};
public: GenericFilter& operator=(const GenericFilter& genericFilter)
// *****************************************************************
{
if (_filter) delete _filter;
_filter = genericFilter.getClone();
return *this;
};
public: GenericFilter& operator=(Filter<Type>* filter)
// *****************************************************
// CAUTION : filter will be deleted by the GenericFilter
// *****************************************************
{
if (_filter) delete _filter;
_filter = filter;
return *this;
};
public: GenericFilter& operator=(Filter<Type>* filter)
// *****************************************************
// CAUTION : filter will be deleted by the GenericFilter
// *****************************************************
{
if (_filter) delete _filter;
_filter = filter;
return *this;
};
// Accessors
// *********
public: virtual Filter<Type>* GetClone() const
// *******************************************
{
return (_filter) ? _filter->GetClone() : NULL;
};
public: virtual Filter<Type>* getClone() const
// *******************************************
{
return (_filter) ? _filter->getClone() : NULL;
};
// Predicates
// **********
public: virtual bool Accept(Type type) const
// *****************************************
{
return (_filter) ? _filter->Accept(type) : false;
};
public: virtual bool Accept(Type type) const
// *****************************************
{
return (_filter) ? _filter->Accept(type) : false;
};
// Others
// ******
public: virtual string _GetTypeName() const
// **************************************
{
public: virtual string _getTypeName() const
// **************************************
{
return _TName("GenericFilter");
}
public: virtual string _GetString() const
// **************************************
{
if (!_filter)
return "<" + _GetTypeName() + " unbound>";
else
return "<" + _GetTypeName() + " " + GetString(_filter) + ">";
};
public: virtual string _getString() const
// **************************************
{
if (!_filter)
return "<" + _getTypeName() + " unbound>";
else
return "<" + _getTypeName() + " " + getString(_filter) + ">";
};
};
@ -204,79 +204,79 @@ template<class Type> class NotFilter : public Filter<Type> {
// Types
// *****
public: typedef Filter<Type> Inherit;
public: typedef Filter<Type> Inherit;
// Attributes
// **********
private: GenericFilter<Type> _genericFilter;
private: GenericFilter<Type> _genericFilter;
// Constructors
// ************
public: NotFilter()
// ****************
: Inherit(),
_genericFilter()
{
};
public: NotFilter()
// ****************
: Inherit(),
_genericFilter()
{
};
public: NotFilter(const Filter<Type>& filter)
// ******************************************
: Inherit(),
_genericFilter(filter)
{
};
public: NotFilter(const Filter<Type>& filter)
// ******************************************
: Inherit(),
_genericFilter(filter)
{
};
public: NotFilter(const NotFilter<Type>& notFilter)
// ************************************************
: Inherit(),
_genericFilter(notFilter._genericFilter)
{
};
public: NotFilter(const NotFilter<Type>& notFilter)
// ************************************************
: Inherit(),
_genericFilter(notFilter._genericFilter)
{
};
// Operators
// *********
public: NotFilter& operator=(const NotFilter<Type>& notFilter)
// ***********************************************************
{
_genericFilter = notFilter._genericFilter;
return *this;
};
public: NotFilter& operator=(const NotFilter<Type>& notFilter)
// ***********************************************************
{
_genericFilter = notFilter._genericFilter;
return *this;
};
// Accessors
// *********
public: virtual Filter<Type>* GetClone() const
// *******************************************
{
return new NotFilter(*this);
};
public: virtual Filter<Type>* getClone() const
// *******************************************
{
return new NotFilter(*this);
};
// Predicates
// **********
public: virtual bool Accept(Type type) const
// *****************************************
{
return !_genericFilter.Accept(type);
};
public: virtual bool Accept(Type type) const
// *****************************************
{
return !_genericFilter.Accept(type);
};
// Others
// ******
public: virtual string _GetTypeName() const
// **************************************
{
public: virtual string _getTypeName() const
// **************************************
{
return _TName("GenericNotFilter");
}
public: virtual string _GetString() const
// **************************************
{
return "<" + _GetTypeName() + " " + GetString(_genericFilter) + ">";
};
public: virtual string _getString() const
// **************************************
{
return "<" + _getTypeName() + " " + getString(_genericFilter) + ">";
};
};

View File

@ -19,66 +19,66 @@ static bool AUTO_MATERIALIZATION_IS_ENABLED = true;
Go::Go()
// *****
: Inherit(),
_quadTree(NULL),
_nextOfQuadTreeGoSet(NULL)
: Inherit(),
_quadTree(NULL),
_nextOfQuadTreeGoSet(NULL)
{
}
bool Go::AutoMaterializationIsDisabled()
// *************************************
{
return !AUTO_MATERIALIZATION_IS_ENABLED;
return !AUTO_MATERIALIZATION_IS_ENABLED;
}
void Go::EnableAutoMaterialization()
// *********************************
{
AUTO_MATERIALIZATION_IS_ENABLED = true;
AUTO_MATERIALIZATION_IS_ENABLED = true;
}
void Go::DisableAutoMaterialization()
// **********************************
{
AUTO_MATERIALIZATION_IS_ENABLED = false;
AUTO_MATERIALIZATION_IS_ENABLED = false;
}
void Go::_PostCreate()
void Go::_postCreate()
// *******************
{
Inherit::_PostCreate();
Inherit::_postCreate();
if (!AutoMaterializationIsDisabled()) Materialize(); // materialized after entire post creation
if (!AutoMaterializationIsDisabled()) Materialize(); // materialized after entire post creation
}
void Go::_PreDelete()
void Go::_preDestroy()
// ******************
{
// trace << "entering Go::_PreDelete: " << this << endl;
// trace << "entering Go::_preDestroy: " << this << endl;
// trace_in();
Unmaterialize(); // unmaterialized before starting pre destruction
Unmaterialize(); // unmaterialized before starting pre destruction
Inherit::_PreDelete();
Inherit::_preDestroy();
// trace << "exiting Go::_PreDelete:" << endl;
// trace << "exiting Go::_preDestroy:" << endl;
// trace_out();
}
string Go::_GetString() const
string Go::_getString() const
// **************************
{
return Inherit::_GetString();
return Inherit::_getString();
}
Record* Go::_GetRecord() const
Record* Go::_getRecord() const
// *********************
{
Record* record = Inherit::_GetRecord();
if (record) {
record->Add(GetSlot("QuadTree", _quadTree));
}
return record;
Record* record = Inherit::_getRecord();
if (record) {
record->Add(getSlot("QuadTree", _quadTree));
}
return record;
}

View File

@ -29,61 +29,57 @@ class Go : public Entity {
// Friends
// *******
friend class QuadTree;
friend class QuadTree;
// Types
// *****
public: typedef Entity Inherit;
public: typedef Entity Inherit;
// Attributes
// **********
private: QuadTree* _quadTree;
private: Go* _nextOfQuadTreeGoSet;
private: QuadTree* _quadTree;
private: Go* _nextOfQuadTreeGoSet;
// Constructors
// ************
protected: Go();
protected: Go();
// Predicates
// **********
public: static bool AutoMaterializationIsDisabled();
public: static bool AutoMaterializationIsDisabled();
public: bool IsMaterialized() const {return (_quadTree != NULL);};
public: bool IsMaterialized() const {return (_quadTree != NULL);};
// Updators
// ********
public: static void EnableAutoMaterialization();
public: static void DisableAutoMaterialization();
public: static void EnableAutoMaterialization();
public: static void DisableAutoMaterialization();
public: virtual void Materialize() = 0;
public: virtual void Unmaterialize() = 0;
public: virtual void Materialize() = 0;
public: virtual void Unmaterialize() = 0;
public: virtual void Invalidate(bool propagateFlag = true);
// implementation located on file UpdateSession.cpp to access local variables
public: virtual void Invalidate(bool propagateFlag = true);
// implementation located on file UpdateSession.cpp to access local variables
public: virtual void Translate(const Unit& dx, const Unit& dy) = 0;
public: virtual void Translate(const Unit& dx, const Unit& dy) = 0;
// Others
// ******
protected: virtual void _PostCreate();
protected: virtual void _postCreate();
protected: virtual void _PreDelete();
protected: virtual void _preDestroy();
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: Go* _GetNextOfQuadTreeGoSet() const {return _nextOfQuadTreeGoSet;};
public: virtual string _getString() const;
public: virtual Record* _getRecord() const;
public: Go* _getNextOfQuadTreeGoSet() const {return _nextOfQuadTreeGoSet;};
public: void _SetNextOfQuadTreeGoSet(Go* go) {_nextOfQuadTreeGoSet = go;};
//public: virtual bool _IsInterceptedBy(View* view, const Point& point, const Unit& aperture) const = 0;
//public: virtual void _Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation) = 0;
//public: virtual void _Highlight(View* view, const Box& updateArea, const Transformation& transformation) = 0;
public: void _SetNextOfQuadTreeGoSet(Go* go) {_nextOfQuadTreeGoSet = go;};
};

View File

@ -46,10 +46,10 @@ typedef GenericFilter<Go*> GoFilter;
#define for_each_go(go, gos)\
/***************************/\
{\
GoLocator _locator = gos.GetLocator();\
while (_locator.IsValid()) {\
Go* go = _locator.GetElement();\
_locator.Progress();
GoLocator _locator = gos.getLocator();\
while (_locator.IsValid()) {\
Go* go = _locator.getElement();\
_locator.Progress();

View File

@ -20,17 +20,17 @@ namespace Hurricane {
class Hook_IsMasterFilter : public Filter<Hook*> {
// *********************************************
public: Hook_IsMasterFilter() {};
public: Hook_IsMasterFilter() {};
public: Hook_IsMasterFilter(const Hook_IsMasterFilter& filter) {};
public: Hook_IsMasterFilter(const Hook_IsMasterFilter& filter) {};
public: Hook_IsMasterFilter& operator=(const Hook_IsMasterFilter& filter) {return *this;};
public: Hook_IsMasterFilter& operator=(const Hook_IsMasterFilter& filter) {return *this;};
public: virtual Filter<Hook*>* GetClone() const {return new Hook_IsMasterFilter(*this);};
public: virtual Filter<Hook*>* getClone() const {return new Hook_IsMasterFilter(*this);};
public: virtual bool Accept(Hook* hook) const {return hook->IsMaster();};
public: virtual bool Accept(Hook* hook) const {return hook->IsMaster();};
public: virtual string _GetString() const {return "<" + _TName("Hook::IsMasterFilter>");};
public: virtual string _getString() const {return "<" + _TName("Hook::IsMasterFilter>");};
};
@ -46,58 +46,58 @@ class Hook_Hooks : public Collection<Hook*> {
// Types
// *****
public: typedef Collection<Hook*> Inherit;
public: typedef Collection<Hook*> Inherit;
public: class Locator : public Hurricane::Locator<Hook*> {
// *****************************************************
public: class Locator : public Hurricane::Locator<Hook*> {
// *****************************************************
public: typedef Hurricane::Locator<Hook*> Inherit;
public: typedef Hurricane::Locator<Hook*> Inherit;
private: const Hook* _hook;
private: Hook* _currentHook;
private: const Hook* _hook;
private: Hook* _currentHook;
public: Locator(const Hook* hook = NULL);
public: Locator(const Locator& locator);
public: Locator(const Hook* hook = NULL);
public: Locator(const Locator& locator);
public: Locator& operator=(const Locator& locator);
public: Locator& operator=(const Locator& locator);
public: virtual Hook* GetElement() const;
public: virtual Hurricane::Locator<Hook*>* GetClone() const;
public: virtual Hook* getElement() const;
public: virtual Hurricane::Locator<Hook*>* getClone() const;
public: virtual bool IsValid() const;
public: virtual bool IsValid() const;
public: virtual void Progress();
public: virtual void Progress();
public: virtual string _GetString() const;
public: virtual string _getString() const;
};
};
// Attributes
// **********
private: const Hook* _hook;
private: const Hook* _hook;
// Constructors
// ************
public: Hook_Hooks(const Hook* hook = NULL);
public: Hook_Hooks(const Hook_Hooks& hooks);
public: Hook_Hooks(const Hook* hook = NULL);
public: Hook_Hooks(const Hook_Hooks& hooks);
// Operators
// *********
public: Hook_Hooks& operator=(const Hook_Hooks& hooks);
public: Hook_Hooks& operator=(const Hook_Hooks& hooks);
// Accessors
// *********
public: virtual Collection<Hook*>* GetClone() const;
public: virtual Hurricane::Locator<Hook*>* GetLocator() const;
public: virtual Collection<Hook*>* getClone() const;
public: virtual Hurricane::Locator<Hook*>* getLocator() const;
// Others
// ******
public: virtual string _GetString() const;
public: virtual string _getString() const;
};
@ -113,58 +113,58 @@ class Hook_SlaveHooks : public Collection<Hook*> {
// Types
// *****
public: typedef Collection<Hook*> Inherit;
public: typedef Collection<Hook*> Inherit;
public: class Locator : public Hurricane::Locator<Hook*> {
// *****************************************************
public: class Locator : public Hurricane::Locator<Hook*> {
// *****************************************************
public: typedef Hurricane::Locator<Hook*> Inherit;
public: typedef Hurricane::Locator<Hook*> Inherit;
private: const Hook* _hook;
private: Hook* _currentHook;
private: const Hook* _hook;
private: Hook* _currentHook;
public: Locator(const Hook* hook = NULL);
public: Locator(const Locator& locator);
public: Locator(const Hook* hook = NULL);
public: Locator(const Locator& locator);
public: Locator& operator=(const Locator& locator);
public: Locator& operator=(const Locator& locator);
public: virtual Hook* GetElement() const;
public: virtual Hurricane::Locator<Hook*>* GetClone() const;
public: virtual Hook* getElement() const;
public: virtual Hurricane::Locator<Hook*>* getClone() const;
public: virtual bool IsValid() const;
public: virtual bool IsValid() const;
public: virtual void Progress();
public: virtual void Progress();
public: virtual string _GetString() const;
public: virtual string _getString() const;
};
};
// Attributes
// **********
private: const Hook* _hook;
private: const Hook* _hook;
// Constructors
// ************
public: Hook_SlaveHooks(const Hook* hook = NULL);
public: Hook_SlaveHooks(const Hook_SlaveHooks& hooks);
public: Hook_SlaveHooks(const Hook* hook = NULL);
public: Hook_SlaveHooks(const Hook_SlaveHooks& hooks);
// Operators
// *********
public: Hook_SlaveHooks& operator=(const Hook_SlaveHooks& hooks);
public: Hook_SlaveHooks& operator=(const Hook_SlaveHooks& hooks);
// Accessors
// *********
public: virtual Collection<Hook*>* GetClone() const;
public: virtual Hurricane::Locator<Hook*>* GetLocator() const;
public: virtual Collection<Hook*>* getClone() const;
public: virtual Hurricane::Locator<Hook*>* getLocator() const;
// Others
// ******
public: virtual string _GetString() const;
public: virtual string _getString() const;
};
@ -176,200 +176,200 @@ class Hook_SlaveHooks : public Collection<Hook*> {
Hook::Hook()
// *********
: _nextHook(this)
: _nextHook(this)
{
}
Hook::~Hook()
// **********
{
if (_nextHook != this)
throw Error("Abnormal deletion of hook : always attached");
if (_nextHook != this)
throw Error("Abnormal deletion of hook : always attached");
}
Hook* Hook::GetNextHook() const
Hook* Hook::getNextHook() const
// ****************************
{
return _nextHook;
return _nextHook;
}
Hook* Hook::GetPreviousHook() const
Hook* Hook::getPreviousHook() const
// ********************************
{
Hook* hook = (Hook*)this;
while (hook->_nextHook != this) hook = hook->_nextHook;
return hook;
Hook* hook = (Hook*)this;
while (hook->_nextHook != this) hook = hook->_nextHook;
return hook;
}
Hook* Hook::GetMasterHook() const
Hook* Hook::getMasterHook() const
// ******************************
{
Hook* hook = (Hook*)this;
do {
if (hook->IsMaster()) return hook;
hook = hook->_nextHook;
} while (hook != this);
return NULL;
Hook* hook = (Hook*)this;
do {
if (hook->IsMaster()) return hook;
hook = hook->_nextHook;
} while (hook != this);
return NULL;
}
Hook* Hook::GetNextMasterHook() const
Hook* Hook::getNextMasterHook() const
// **********************************
{
return _nextHook->GetMasterHook();
return _nextHook->getMasterHook();
}
Hook* Hook::GetPreviousMasterHook() const
Hook* Hook::getPreviousMasterHook() const
// **************************************
{
Hook* previousMasterHook = NULL;
Hook* hook = (Hook*)this;
do {
if (hook->IsMaster()) previousMasterHook = hook;
hook = hook->_nextHook;
} while (hook != this);
return previousMasterHook;
Hook* previousMasterHook = NULL;
Hook* hook = (Hook*)this;
do {
if (hook->IsMaster()) previousMasterHook = hook;
hook = hook->_nextHook;
} while (hook != this);
return previousMasterHook;
}
Hooks Hook::GetHooks() const
Hooks Hook::getHooks() const
// *************************
{
return Hook_Hooks(this);
return Hook_Hooks(this);
}
Hooks Hook::GetSlaveHooks() const
Hooks Hook::getSlaveHooks() const
// ******************************
{
return Hook_SlaveHooks(this);
return Hook_SlaveHooks(this);
}
HookFilter Hook::GetIsMasterFilter()
HookFilter Hook::getIsMasterFilter()
// *********************************
{
return Hook_IsMasterFilter();
return Hook_IsMasterFilter();
}
bool Hook::IsAttached() const
// **************************
{
if (!IsMaster())
return (GetMasterHook() != NULL);
else
return (GetNextMasterHook() != this);
if (!IsMaster())
return (getMasterHook() != NULL);
else
return (getNextMasterHook() != this);
}
Hook* Hook::Detach()
// *****************
{
Hook* previousHook = NULL;
Hook* hook = _nextHook;
while (hook != this) {
if (!IsMaster() || hook->IsMaster()) previousHook = hook;
hook = hook->_nextHook;
}
if (previousHook) {
Hook* nextHook = _nextHook;
_nextHook = previousHook->_nextHook;
previousHook->_nextHook = nextHook;
Hook* previousHook = NULL;
Hook* hook = _nextHook;
while (hook != this) {
if (!IsMaster() || hook->IsMaster()) previousHook = hook;
hook = hook->_nextHook;
}
if (previousHook) {
Hook* nextHook = _nextHook;
_nextHook = previousHook->_nextHook;
previousHook->_nextHook = nextHook;
// /*
if (IsMaster()) {
assert(previousHook->IsMaster());
Component* component = GetComponent();
Rubber* rubber = component->GetRubber();
if (rubber) {
rubber->_SetHook(previousHook);
component->_SetRubber(NULL);
}
}
// */
// /*
if (IsMaster()) {
assert(previousHook->IsMaster());
Component* component = getComponent();
Rubber* rubber = component->getRubber();
if (rubber) {
rubber->_SetHook(previousHook);
component->_SetRubber(NULL);
}
}
// */
}
return previousHook;
}
return previousHook;
}
Hook* Hook::Attach(Hook* hook)
// ***************************
{
if (IsAttached())
throw Error("Can't attach : already attached");
if (IsAttached())
throw Error("Can't attach : already attached");
if (!hook)
throw Error("Can't attach : null hook");
if (!hook)
throw Error("Can't attach : null hook");
if (!hook->IsMaster())
throw Error("Can't attach : not a master hook");
if (!hook->IsMaster())
throw Error("Can't attach : not a master hook");
if (hook == this)
throw Error("Can't attach : itself");
if (hook == this)
throw Error("Can't attach : itself");
Hook* masterHook = hook->GetPreviousMasterHook();
Hook* nextHook = masterHook->_nextHook;
masterHook->_nextHook = _nextHook;
_nextHook = nextHook;
Hook* masterHook = hook->getPreviousMasterHook();
Hook* nextHook = masterHook->_nextHook;
masterHook->_nextHook = _nextHook;
_nextHook = nextHook;
// /*
if (IsMaster()) {
Rubber* rubber = hook->GetComponent()->GetRubber();
if (rubber)
GetComponent()->_SetRubber(rubber);
else
Rubber::_Create(this);
}
// */
// /*
if (IsMaster()) {
Rubber* rubber = hook->getComponent()->getRubber();
if (rubber)
getComponent()->_SetRubber(rubber);
else
Rubber::_Create(this);
}
// */
return this;
return this;
}
void Hook::_SetNextHook(Hook* hook)
{
if (IsMaster())
{
Rubber* rubber = hook->GetComponent()->GetRubber();
if (rubber)
rubber->_Delete();
}
_nextHook = hook;
if (IsMaster())
{
Rubber* rubber = hook->getComponent()->getRubber();
if (rubber)
rubber->_destroy();
}
_nextHook = hook;
}
Hook* Hook::Merge(Hook* hook)
// **************************
{
if (!IsMaster())
throw Error("Can't merge : not a master");
if (!IsMaster())
throw Error("Can't merge : not a master");
if (!hook)
throw Error("Can't merge : null hook");
if (!hook)
throw Error("Can't merge : null hook");
if (!hook->IsMaster())
throw Error("Can't merge : not a master hook");
if (!hook->IsMaster())
throw Error("Can't merge : not a master hook");
if (hook == this)
throw Error("Can't merge : itself");
if (hook == this)
throw Error("Can't merge : itself");
Hook* masterHook = hook->GetPreviousMasterHook();
Hook* nextHook = masterHook->_nextHook;
masterHook->_nextHook = _nextHook;
_nextHook = nextHook;
Hook* masterHook = hook->getPreviousMasterHook();
Hook* nextHook = masterHook->_nextHook;
masterHook->_nextHook = _nextHook;
_nextHook = nextHook;
Rubber* rubber = GetComponent()->GetRubber();
if (rubber) rubber->_Delete();
rubber = hook->GetComponent()->GetRubber();
if (rubber) rubber->_Delete();
Rubber::_Create(this);
Rubber* rubber = getComponent()->getRubber();
if (rubber) rubber->_destroy();
rubber = hook->getComponent()->getRubber();
if (rubber) rubber->_destroy();
Rubber::_Create(this);
return this;
return this;
}
Record* Hook::_GetRecord() const
Record* Hook::_getRecord() const
// ***********************
{
Record* record = NULL;
if (_nextHook != this) {
record = new Record(GetString(this));
record->Add(GetSlot("Component", GetComponent()));
record->Add(GetSlot("NextHook", _nextHook));
}
return record;
Record* record = NULL;
if (_nextHook != this) {
record = new Record(getString(this));
record->Add(getSlot("Component", getComponent()));
record->Add(getSlot("NextHook", _nextHook));
}
return record;
}
@ -380,44 +380,44 @@ Record* Hook::_GetRecord() const
Hook_Hooks::Hook_Hooks(const Hook* hook)
// *************************************
: Inherit(),
_hook(hook)
: Inherit(),
_hook(hook)
{
}
Hook_Hooks::Hook_Hooks(const Hook_Hooks& hooks)
// ********************************************
: Inherit(),
_hook(hooks._hook)
: Inherit(),
_hook(hooks._hook)
{
}
Hook_Hooks& Hook_Hooks::operator=(const Hook_Hooks& hooks)
// *******************************************************
{
_hook = hooks._hook;
return *this;
_hook = hooks._hook;
return *this;
}
Collection<Hook*>* Hook_Hooks::GetClone() const
Collection<Hook*>* Hook_Hooks::getClone() const
// ********************************************
{
return new Hook_Hooks(*this);
return new Hook_Hooks(*this);
}
Locator<Hook*>* Hook_Hooks::GetLocator() const
Locator<Hook*>* Hook_Hooks::getLocator() const
// *******************************************
{
return new Locator(_hook);
return new Locator(_hook);
}
string Hook_Hooks::_GetString() const
string Hook_Hooks::_getString() const
// **********************************
{
string s = "<" + _TName("Hook::Hooks");
if (_hook) s += " " + GetString(_hook);
s += ">";
return s;
string s = "<" + _TName("Hook::Hooks");
if (_hook) s += " " + getString(_hook);
s += ">";
return s;
}
@ -428,62 +428,62 @@ string Hook_Hooks::_GetString() const
Hook_Hooks::Locator::Locator(const Hook* hook)
// *******************************************
: Inherit(),
_hook(hook),
_currentHook((Hook*)hook)
: Inherit(),
_hook(hook),
_currentHook((Hook*)hook)
{
}
Hook_Hooks::Locator::Locator(const Locator& locator)
// *************************************************
: Inherit(),
_hook(locator._hook),
_currentHook(locator._currentHook)
: Inherit(),
_hook(locator._hook),
_currentHook(locator._currentHook)
{
}
Hook_Hooks::Locator& Hook_Hooks::Locator::operator=(const Locator& locator)
// ************************************************************************
{
_hook = locator._hook;
_currentHook = locator._currentHook;
return *this;
_hook = locator._hook;
_currentHook = locator._currentHook;
return *this;
}
Hook* Hook_Hooks::Locator::GetElement() const
Hook* Hook_Hooks::Locator::getElement() const
// ******************************************
{
return _currentHook;
return _currentHook;
}
Locator<Hook*>* Hook_Hooks::Locator::GetClone() const
Locator<Hook*>* Hook_Hooks::Locator::getClone() const
// **************************************************
{
return new Locator(*this);
return new Locator(*this);
}
bool Hook_Hooks::Locator::IsValid() const
// **************************************
{
return (_currentHook != NULL);
return (_currentHook != NULL);
}
void Hook_Hooks::Locator::Progress()
// *********************************
{
if (_currentHook) {
_currentHook = _currentHook->GetNextHook();
if (_currentHook == _hook) _currentHook = NULL;
}
if (_currentHook) {
_currentHook = _currentHook->getNextHook();
if (_currentHook == _hook) _currentHook = NULL;
}
}
string Hook_Hooks::Locator::_GetString() const
string Hook_Hooks::Locator::_getString() const
// *******************************************
{
string s = "<" + _TName("Hook::Hooks::Locator");
if (_hook) s += " " + GetString(_hook);
s += ">";
return s;
string s = "<" + _TName("Hook::Hooks::Locator");
if (_hook) s += " " + getString(_hook);
s += ">";
return s;
}
@ -494,44 +494,44 @@ string Hook_Hooks::Locator::_GetString() const
Hook_SlaveHooks::Hook_SlaveHooks(const Hook* hook)
// ***********************************************
: Inherit(),
_hook(hook)
: Inherit(),
_hook(hook)
{
}
Hook_SlaveHooks::Hook_SlaveHooks(const Hook_SlaveHooks& slaveHooks)
// ****************************************************************
: Inherit(),
_hook(slaveHooks._hook)
: Inherit(),
_hook(slaveHooks._hook)
{
}
Hook_SlaveHooks& Hook_SlaveHooks::operator=(const Hook_SlaveHooks& slaveHooks)
// ***************************************************************************
{
_hook = slaveHooks._hook;
return *this;
_hook = slaveHooks._hook;
return *this;
}
Collection<Hook*>* Hook_SlaveHooks::GetClone() const
Collection<Hook*>* Hook_SlaveHooks::getClone() const
// *************************************************
{
return new Hook_SlaveHooks(*this);
return new Hook_SlaveHooks(*this);
}
Locator<Hook*>* Hook_SlaveHooks::GetLocator() const
Locator<Hook*>* Hook_SlaveHooks::getLocator() const
// ************************************************
{
return new Locator(_hook);
return new Locator(_hook);
}
string Hook_SlaveHooks::_GetString() const
string Hook_SlaveHooks::_getString() const
// ***************************************
{
string s = "<" + _TName("Hook::SlaveHooks");
if (_hook) s += " " + GetString(_hook);
s += ">";
return s;
string s = "<" + _TName("Hook::SlaveHooks");
if (_hook) s += " " + getString(_hook);
s += ">";
return s;
}
@ -542,71 +542,71 @@ string Hook_SlaveHooks::_GetString() const
Hook_SlaveHooks::Locator::Locator(const Hook* hook)
// ************************************************
: Inherit(),
_hook(hook),
_currentHook(NULL)
: Inherit(),
_hook(hook),
_currentHook(NULL)
{
if (_hook && _hook->IsMaster()) {
_currentHook = _hook->GetPreviousMasterHook();
if (_currentHook) {
_currentHook = _currentHook->GetNextHook();
if (_currentHook == _hook) _currentHook = NULL;
}
assert(!_currentHook || !_currentHook->IsMaster());
}
if (_hook && _hook->IsMaster()) {
_currentHook = _hook->getPreviousMasterHook();
if (_currentHook) {
_currentHook = _currentHook->getNextHook();
if (_currentHook == _hook) _currentHook = NULL;
}
assert(!_currentHook || !_currentHook->IsMaster());
}
}
Hook_SlaveHooks::Locator::Locator(const Locator& locator)
// ******************************************************
: Inherit(),
_hook(locator._hook),
_currentHook(locator._currentHook)
: Inherit(),
_hook(locator._hook),
_currentHook(locator._currentHook)
{
}
Hook_SlaveHooks::Locator& Hook_SlaveHooks::Locator::operator=(const Locator& locator)
// **********************************************************************************
{
_hook = locator._hook;
_currentHook = locator._currentHook;
return *this;
_hook = locator._hook;
_currentHook = locator._currentHook;
return *this;
}
Hook* Hook_SlaveHooks::Locator::GetElement() const
Hook* Hook_SlaveHooks::Locator::getElement() const
// ***********************************************
{
return _currentHook;
return _currentHook;
}
Locator<Hook*>* Hook_SlaveHooks::Locator::GetClone() const
Locator<Hook*>* Hook_SlaveHooks::Locator::getClone() const
// *******************************************************
{
return new Locator(*this);
return new Locator(*this);
}
bool Hook_SlaveHooks::Locator::IsValid() const
// *******************************************
{
return (_currentHook != NULL);
return (_currentHook != NULL);
}
void Hook_SlaveHooks::Locator::Progress()
// **************************************
{
if (_currentHook) {
_currentHook = _currentHook->GetNextHook();
if (_currentHook == _hook) _currentHook = NULL;
assert(!_currentHook || !_currentHook->IsMaster());
}
if (_currentHook) {
_currentHook = _currentHook->getNextHook();
if (_currentHook == _hook) _currentHook = NULL;
assert(!_currentHook || !_currentHook->IsMaster());
}
}
string Hook_SlaveHooks::Locator::_GetString() const
string Hook_SlaveHooks::Locator::_getString() const
// ************************************************
{
string s = "<" + _TName("Hook::SlaveHooks::Locator");
if (_hook) s += " " + GetString(_hook);
s += ">";
return s;
string s = "<" + _TName("Hook::SlaveHooks::Locator");
if (_hook) s += " " + getString(_hook);
s += ">";
return s;
}

View File

@ -25,65 +25,65 @@ class Hook : public NestedSlotAdapter {
// Attributes
// **********
private: Hook* _nextHook;
private: Hook* _nextHook;
// Constructors
// ************
protected: Hook();
protected: Hook();
private: Hook(const Hook& hook); // not implemented to forbid copy construction
private: Hook(const Hook& hook); // not implemented to forbid copy construction
// Destructor
// **********
protected: virtual ~Hook();
protected: virtual ~Hook();
// Operators
// *********
private: Hook& operator=(const Hook& hook); // not implemented to forbid assignment
private: Hook& operator=(const Hook& hook); // not implemented to forbid assignment
// Accessors
// *********
public: virtual Component* GetComponent() const = 0;
public: virtual Component* getComponent() const = 0;
public: Hook* GetNextHook() const;
public: Hook* GetPreviousHook() const;
public: Hook* getNextHook() const;
public: Hook* getPreviousHook() const;
public: Hook* GetMasterHook() const;
public: Hook* GetNextMasterHook() const;
public: Hook* GetPreviousMasterHook() const;
public: Hook* getMasterHook() const;
public: Hook* getNextMasterHook() const;
public: Hook* getPreviousMasterHook() const;
public: Hooks GetHooks() const;
public: Hooks GetSlaveHooks() const;
public: Hooks getHooks() const;
public: Hooks getSlaveHooks() const;
// Filters
// *******
public: static HookFilter GetIsMasterFilter();
public: static HookFilter getIsMasterFilter();
// Predicates
// **********
public: virtual bool IsMaster() const = 0;
public: virtual bool IsMaster() const = 0;
public: bool IsAttached() const;
public: bool IsAttached() const;
// Updators
// ********
public: Hook* Detach();
public: Hook* Attach(Hook* hook);
public: Hook* Merge(Hook* hook);
public: void _SetNextHook(Hook* hook);
public: Hook* Detach();
public: Hook* Attach(Hook* hook);
public: Hook* Merge(Hook* hook);
public: void _SetNextHook(Hook* hook);
// Others
// ******
public: virtual string _GetString() const = 0;
public: virtual Record* _GetRecord() const;
public: virtual string _getString() const = 0;
public: virtual Record* _getRecord() const;
};

View File

@ -46,10 +46,10 @@ typedef GenericFilter<Hook*> HookFilter;
#define for_each_hook(hook, hooks)\
/*********************************/\
{\
HookLocator _locator = hooks.GetLocator();\
while (_locator.IsValid()) {\
Hook* hook = _locator.GetElement();\
_locator.Progress();
HookLocator _locator = hooks.getLocator();\
while (_locator.IsValid()) {\
Hook* hook = _locator.getElement();\
_locator.Progress();

View File

@ -22,149 +22,149 @@ namespace Hurricane {
Horizontal::Horizontal(Net* net, Component* source, Component* target, Layer* layer, const Unit& y, const Unit& width, const Unit& dxSource, const Unit& dxTarget)
// ****************************************************************************************************
: Inherit(net, source, target, layer, width),
_y(y),
_dxSource(dxSource),
_dxTarget(dxTarget)
_y(y),
_dxSource(dxSource),
_dxTarget(dxTarget)
{
}
Horizontal* Horizontal::Create(Net* net, Layer* layer, const Unit& y, const Unit& width, const Unit& dxSource, const Unit& dxTarget)
// ****************************************************************************************************
{
if (!net)
throw Error("Can't create " + _TName("Horizontal") + " : null net");
if (!net)
throw Error("Can't create " + _TName("Horizontal") + " : null net");
Horizontal* horizontal = new Horizontal(net, NULL, NULL, layer, y, width, dxSource, dxTarget);
Horizontal* horizontal = new Horizontal(net, NULL, NULL, layer, y, width, dxSource, dxTarget);
horizontal->_PostCreate();
horizontal->_postCreate();
return horizontal;
return horizontal;
}
Horizontal* Horizontal::Create(Component* source, Component* target, Layer* layer, const Unit& y, const Unit& width, const Unit& dxSource, const Unit& dxTarget)
// ****************************************************************************************************
{
if (!source)
throw Error("Can't create " + _TName("Horizontal") + " : null source");
if (!source)
throw Error("Can't create " + _TName("Horizontal") + " : null source");
if (!target)
throw Error("Can't create " + _TName("Horizontal") + " : null target");
if (!target)
throw Error("Can't create " + _TName("Horizontal") + " : null target");
Horizontal* horizontal =
new Horizontal(source->GetNet(), source, target, layer, y, width, dxSource, dxTarget);
Horizontal* horizontal =
new Horizontal(source->getNet(), source, target, layer, y, width, dxSource, dxTarget);
horizontal->_PostCreate();
horizontal->_postCreate();
return horizontal;
return horizontal;
}
Box Horizontal::GetBoundingBox() const
Box Horizontal::getBoundingBox() const
// ***********************************
{
Unit size = GetHalfWidth() + _GetSize();
Unit extention = _GetExtention();
Unit size = getHalfWidth() + _getSize();
Unit extention = _getExtention();
return Box(GetSourceX(), _y, GetTargetX(), _y).inflate(extention, size);
return Box(getSourceX(), _y, getTargetX(), _y).inflate(extention, size);
}
Box Horizontal::GetBoundingBox(const BasicLayer* basicLayer) const
Box Horizontal::getBoundingBox(const BasicLayer* basicLayer) const
// *********************************************************
{
if (!GetLayer()->contains(basicLayer)) return Box();
if (!getLayer()->contains(basicLayer)) return Box();
Unit size = GetHalfWidth() + _GetSize(basicLayer);
Unit extention = _GetExtention(basicLayer);
Unit size = getHalfWidth() + _getSize(basicLayer);
Unit extention = _getExtention(basicLayer);
return Box(GetSourceX(), _y, GetTargetX(), _y).inflate(extention, size);
return Box(getSourceX(), _y, getTargetX(), _y).inflate(extention, size);
}
Unit Horizontal::GetSourceX() const
Unit Horizontal::getSourceX() const
// ********************************
{
Component* source = GetSource();
return (source) ? source->GetX() + _dxSource : _dxSource;
Component* source = getSource();
return (source) ? source->getX() + _dxSource : _dxSource;
}
Unit Horizontal::GetTargetX() const
Unit Horizontal::getTargetX() const
// ********************************
{
Component* target = GetTarget();
return (target) ? target->GetX() + _dxTarget : _dxTarget;
Component* target = getTarget();
return (target) ? target->getX() + _dxTarget : _dxTarget;
}
Unit Horizontal::GetLength() const
Unit Horizontal::getLength() const
// *******************************
{
return abs(GetSourceX() - GetTargetX());
return abs(getSourceX() - getTargetX());
}
Point Horizontal::GetCenter() const
Point Horizontal::getCenter() const
// *******************************
{
return Point ( (GetSourceX()+GetTargetX())/2, GetY() );
return Point ( (getSourceX()+getTargetX())/2, getY() );
}
void Horizontal::Translate(const Unit& dx, const Unit& dy)
// *******************************************************
{
if (dy != 0) {
Invalidate(true);
_y += dy;
}
if (dy != 0) {
Invalidate(true);
_y += dy;
}
}
void Horizontal::SetY(const Unit& y)
// *********************************
{
if (y != _y) {
Invalidate(true);
_y = y;
}
if (y != _y) {
Invalidate(true);
_y = y;
}
}
void Horizontal::SetDxSource(const Unit& dxSource)
// ***********************************************
{
if (dxSource != _dxSource) {
Invalidate(false);
_dxSource = dxSource;
}
if (dxSource != _dxSource) {
Invalidate(false);
_dxSource = dxSource;
}
}
void Horizontal::SetDxTarget(const Unit& dxTarget)
// ***********************************************
{
if (dxTarget != _dxTarget) {
Invalidate(false);
_dxTarget = dxTarget;
}
if (dxTarget != _dxTarget) {
Invalidate(false);
_dxTarget = dxTarget;
}
}
void Horizontal::Translate(const Unit& dy)
// ***************************************
{
if (dy != 0) {
Invalidate(true);
_y += dy;
}
if (dy != 0) {
Invalidate(true);
_y += dy;
}
}
string Horizontal::_GetString() const
string Horizontal::_getString() const
// **********************************
{
return Inherit::_GetString();
return Inherit::_getString();
}
Record* Horizontal::_GetRecord() const
Record* Horizontal::_getRecord() const
// *****************************
{
Record* record = Inherit::_GetRecord();
if (record) {
record->Add(GetSlot("Y", &_y));
record->Add(GetSlot("DxSource", &_dxSource));
record->Add(GetSlot("DxTarget", &_dxTarget));
}
return record;
Record* record = Inherit::_getRecord();
if (record) {
record->Add(getSlot("Y", &_y));
record->Add(getSlot("DxSource", &_dxSource));
record->Add(getSlot("DxTarget", &_dxTarget));
}
return record;
}
} // End of Hurricane namespace.

View File

@ -24,54 +24,54 @@ class Horizontal : public Segment {
// Types
// *****
public: typedef Segment Inherit;
public: typedef Segment Inherit;
// Attributes
// **********
private: Unit _y;
private: Unit _dxSource;
private: Unit _dxTarget;
private: Unit _y;
private: Unit _dxSource;
private: Unit _dxTarget;
// Constructors
// ************
protected: Horizontal(Net* net, Component* source, Component* target, Layer* layer, const Unit& y, const Unit& width = 0, const Unit& dxSource = 0, const Unit& dxTarget = 0);
protected: Horizontal(Net* net, Component* source, Component* target, Layer* layer, const Unit& y, const Unit& width = 0, const Unit& dxSource = 0, const Unit& dxTarget = 0);
public: static Horizontal* Create(Net* net, Layer* layer, const Unit& y, const Unit& width = 0, const Unit& dxSource = 0, const Unit& dxTarget = 0);
public: static Horizontal* Create(Component* source, Component* target, Layer* layer, const Unit& y, const Unit& width = 0, const Unit& dxSource = 0, const Unit& dxTarget = 0);
public: static Horizontal* Create(Net* net, Layer* layer, const Unit& y, const Unit& width = 0, const Unit& dxSource = 0, const Unit& dxTarget = 0);
public: static Horizontal* Create(Component* source, Component* target, Layer* layer, const Unit& y, const Unit& width = 0, const Unit& dxSource = 0, const Unit& dxTarget = 0);
// Accessors
// *********
public: virtual Unit GetY() const {return _y;};
public: virtual Point GetCenter() const;
public: virtual Box GetBoundingBox() const;
public: virtual Box GetBoundingBox(const BasicLayer* basicLayer) const;
public: virtual Unit GetSourceX() const;
public: virtual Unit GetSourceY() const {return GetY();};
public: virtual Unit GetTargetX() const;
public: virtual Unit GetTargetY() const {return GetY();};
public: virtual Unit GetLength() const;
public: const Unit& GetDxSource() const {return _dxSource;};
public: const Unit& GetDxTarget() const {return _dxTarget;};
public: virtual Unit getY() const {return _y;};
public: virtual Point getCenter() const;
public: virtual Box getBoundingBox() const;
public: virtual Box getBoundingBox(const BasicLayer* basicLayer) const;
public: virtual Unit getSourceX() const;
public: virtual Unit getSourceY() const {return getY();};
public: virtual Unit getTargetX() const;
public: virtual Unit getTargetY() const {return getY();};
public: virtual Unit getLength() const;
public: const Unit& getDxSource() const {return _dxSource;};
public: const Unit& getDxTarget() const {return _dxTarget;};
// Updators
// ********
public: virtual void Translate(const Unit& dx, const Unit& dy);
public: virtual void Translate(const Unit& dx, const Unit& dy);
public: void SetY(const Unit& y);
public: void SetDxSource(const Unit& dxSource);
public: void SetDxTarget(const Unit& dxSource);
public: void Translate(const Unit& dy);
public: void SetY(const Unit& y);
public: void SetDxSource(const Unit& dxSource);
public: void SetDxTarget(const Unit& dxSource);
public: void Translate(const Unit& dy);
// Others
// ******
public: virtual string _GetTypeName() const {return _TName("Horizontal");};
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: virtual string _getTypeName() const {return _TName("Horizontal");};
public: virtual string _getString() const;
public: virtual Record* _getRecord() const;
};

View File

@ -46,9 +46,9 @@ typedef GenericFilter<Horizontal*> HorizontalFilter;
#define for_each_horizontal(horizontal, horizontals)\
/***************************************************/\
{\
HorizontalLocator _locator = horizontals.GetLocator();\
HorizontalLocator _locator = horizontals.getLocator();\
while (_locator.IsValid()) {\
Horizontal* horizontal = _locator.GetElement();\
Horizontal* horizontal = _locator.getElement();\
_locator.Progress();

View File

@ -47,14 +47,14 @@ class HyperNet_NetOccurrences : public Collection<Occurrence> {
public: Locator& operator=(const Locator& locator);
public: virtual Occurrence GetElement() const;
public: virtual Hurricane::Locator<Occurrence>* GetClone() const;
public: virtual Occurrence getElement() const;
public: virtual Hurricane::Locator<Occurrence>* getClone() const;
public: virtual bool IsValid() const;
public: virtual void Progress();
public: virtual string _GetString() const;
public: virtual string _getString() const;
};
@ -80,13 +80,13 @@ class HyperNet_NetOccurrences : public Collection<Occurrence> {
// Accessors
// *********
public: virtual Collection<Occurrence>* GetClone() const;
public: virtual Hurricane::Locator<Occurrence>* GetLocator() const;
public: virtual Collection<Occurrence>* getClone() const;
public: virtual Hurricane::Locator<Occurrence>* getLocator() const;
// Others
// ******
public: virtual string _GetString() const;
public: virtual string _getString() const;
};
@ -121,14 +121,14 @@ class HyperNet_NetOccurrencesUnder : public Collection<Occurrence> {
public: Locator& operator=(const Locator& locator);
public: virtual Occurrence GetElement() const;
public: virtual Hurricane::Locator<Occurrence>* GetClone() const;
public: virtual Occurrence getElement() const;
public: virtual Hurricane::Locator<Occurrence>* getClone() const;
public: virtual bool IsValid() const;
public: virtual void Progress();
public: virtual string _GetString() const;
public: virtual string _getString() const;
};
@ -158,13 +158,13 @@ class HyperNet_NetOccurrencesUnder : public Collection<Occurrence> {
// Accessors
// *********
public: virtual Collection<Occurrence>* GetClone() const;
public: virtual Hurricane::Locator<Occurrence>* GetLocator() const;
public: virtual Collection<Occurrence>* getClone() const;
public: virtual Hurricane::Locator<Occurrence>* getLocator() const;
// Others
// ******
public: virtual string _GetString() const;
public: virtual string _getString() const;
};
@ -197,14 +197,14 @@ class HyperNet_LeafPlugOccurrences : public Collection<Occurrence> {
public: Locator& operator=(const Locator& locator);
public: virtual Occurrence GetElement() const;
public: virtual Hurricane::Locator<Occurrence>* GetClone() const;
public: virtual Occurrence getElement() const;
public: virtual Hurricane::Locator<Occurrence>* getClone() const;
public: virtual bool IsValid() const;
public: virtual void Progress();
public: virtual string _GetString() const;
public: virtual string _getString() const;
};
@ -230,13 +230,13 @@ class HyperNet_LeafPlugOccurrences : public Collection<Occurrence> {
// Accessors
// *********
public: virtual Collection<Occurrence>* GetClone() const;
public: virtual Hurricane::Locator<Occurrence>* GetLocator() const;
public: virtual Collection<Occurrence>* getClone() const;
public: virtual Hurricane::Locator<Occurrence>* getLocator() const;
// Others
// ******
public: virtual string _GetString() const;
public: virtual string _getString() const;
};
@ -251,18 +251,18 @@ HyperNet::HyperNet(const Occurrence& occurrence)
: _netOccurrence()
{
if (occurrence.IsValid()) {
Entity* entity = occurrence.GetEntity();
Entity* entity = occurrence.getEntity();
if (is_a<Net*>(entity))
_netOccurrence = occurrence;
else {
if (is_a<Rubber*>(entity)) {
Rubber* rubber = (Rubber*)entity;
_netOccurrence = Occurrence(rubber->GetNet(), occurrence.GetPath());
_netOccurrence = Occurrence(rubber->getNet(), occurrence.getPath());
}
else {
if (is_a<Component*>(entity)) {
Component* component = (Component*)entity;
_netOccurrence = Occurrence(component->GetNet(), occurrence.GetPath());
_netOccurrence = Occurrence(component->getNet(), occurrence.getPath());
}
else
throw Error("Can't create " + _TName("HyperNet") + " : bad occurrence entity type");
@ -271,83 +271,83 @@ HyperNet::HyperNet(const Occurrence& occurrence)
}
}
Occurrences HyperNet::GetNetOccurrences(bool doExtraction, bool allowInterruption) const
Occurrences HyperNet::getNetOccurrences(bool doExtraction, bool allowInterruption) const
// ***********************************************************************************
{
return HyperNet_NetOccurrences(this, doExtraction, allowInterruption);
}
Occurrences HyperNet::GetNetOccurrencesUnder(Box area, bool doExtraction, bool allowInterruption) const
Occurrences HyperNet::getNetOccurrencesUnder(Box area, bool doExtraction, bool allowInterruption) const
// **************************************************************************************************
{
return HyperNet_NetOccurrencesUnder(this, area, doExtraction, allowInterruption);
}
Occurrences HyperNet::GetLeafPlugOccurrences(bool doExtraction, bool allowInterruption) const
Occurrences HyperNet::getLeafPlugOccurrences(bool doExtraction, bool allowInterruption) const
// ********************************************************************************************
{
return HyperNet_LeafPlugOccurrences(this, doExtraction, allowInterruption);
}
string HyperNet::_GetString() const
string HyperNet::_getString() const
// ********************************
{
string s = "<" + _TName("HyperNet");
if (IsValid()) s += " " + GetString(_netOccurrence);
if (IsValid()) s += " " + getString(_netOccurrence);
s += ">";
return s;
}
Record* HyperNet::_GetRecord() const
Record* HyperNet::_getRecord() const
// ***************************
{
Record* record = new Record(GetString(this));
Record* record = new Record(getString(this));
if (record) {
record->Add(GetSlot("NetOccurrence", &_netOccurrence));
record->Add(getSlot("NetOccurrence", &_netOccurrence));
}
return record;
}
Occurrence GetHyperNetRootNetOccurrence(const Occurrence& netoccurrence)
Occurrence getHyperNetRootNetOccurrence(const Occurrence& netoccurrence)
// *********************************************************************
{
if (!netoccurrence.IsValid())
throw Error("GetHyperNetRootNetOccurrence : invalid occurrence");
throw Error("getHyperNetRootNetOccurrence : invalid occurrence");
Net* net = dynamic_cast<Net*>(netoccurrence.GetEntity());
Net* net = dynamic_cast<Net*>(netoccurrence.getEntity());
if (!net)
throw Error("GetHyperNetRootNetOccurrence : not a net occurrence");
throw Error("getHyperNetRootNetOccurrence : not a net occurrence");
if (!net->IsExternal())
return netoccurrence;
Path path = netoccurrence.GetPath();
Path path = netoccurrence.getPath();
if (path.IsEmpty())
return netoccurrence;
Instance* instance = path.GetTailInstance();
Instance* instance = path.getTailInstance();
Plug* plug = instance->GetPlug(net);
Plug* plug = instance->getPlug(net);
if (!plug)
throw Error("GetHyperNetRootNetOccurrence : no plug for external net !");
throw Error("getHyperNetRootNetOccurrence : no plug for external net !");
if(!plug->IsConnected())
return netoccurrence;
return GetHyperNetRootNetOccurrence(Occurrence(plug->GetNet(), path.GetHeadPath()));
return getHyperNetRootNetOccurrence(Occurrence(plug->getNet(), path.getHeadPath()));
}
bool IsHyperNetRootNetOccurrence(Occurrence netoccurrence)
// *******************************************************
{
Net* net=dynamic_cast<Net*>(netoccurrence.GetEntity());
Net* net=dynamic_cast<Net*>(netoccurrence.getEntity());
if (!net) return false;
if (!net->IsExternal()) return true;
if (netoccurrence.GetPath().IsEmpty()) return true;
if (netoccurrence.getPath().IsEmpty()) return true;
if (net->IsGlobal()) return false;
if (!netoccurrence.GetPath().GetTailInstance()->GetPlug(net)->IsConnected())
if (!netoccurrence.getPath().getTailInstance()->getPlug(net)->IsConnected())
return true;
return false;
}
@ -394,24 +394,24 @@ HyperNet_NetOccurrences& HyperNet_NetOccurrences::operator=(const HyperNet_NetOc
return *this;
}
Collection<Occurrence>* HyperNet_NetOccurrences::GetClone() const
Collection<Occurrence>* HyperNet_NetOccurrences::getClone() const
// ************************************************************
{
return new HyperNet_NetOccurrences(*this);
}
Locator<Occurrence>* HyperNet_NetOccurrences::GetLocator() const
Locator<Occurrence>* HyperNet_NetOccurrences::getLocator() const
// ***********************************************************
{
return new Locator(_hyperNet, _doExtraction, _allowInterruption);
}
string HyperNet_NetOccurrences::_GetString() const
string HyperNet_NetOccurrences::_getString() const
// **********************************************
{
string s = "<" + _TName("HyperNet::NetOccurrences");
if (_hyperNet) {
s += " " + GetString(_hyperNet);
s += " " + getString(_hyperNet);
if (_doExtraction) {
s += " DO_EXTRACTION";
if (_allowInterruption) s += " ALLOW_INTERRUPTION";
@ -448,7 +448,7 @@ HyperNet_NetOccurrences::Locator::Locator(const HyperNet* hyperNet, bool doExtra
_netOccurrenceStack()
{
if (_hyperNet) {
Occurrence netOccurrence = _hyperNet->GetNetOccurrence();
Occurrence netOccurrence = _hyperNet->getNetOccurrence();
if (netOccurrence.IsValid()) {
_netOccurrenceSet.insert(netOccurrence);
_netOccurrenceStack.push(netOccurrence);
@ -478,13 +478,13 @@ HyperNet_NetOccurrences::Locator& HyperNet_NetOccurrences::Locator::operator=(co
return *this;
}
Occurrence HyperNet_NetOccurrences::Locator::GetElement() const
Occurrence HyperNet_NetOccurrences::Locator::getElement() const
// **********************************************************
{
return (!_netOccurrenceStack.empty()) ? _netOccurrenceStack.top() : Occurrence();
}
Locator<Occurrence>* HyperNet_NetOccurrences::Locator::GetClone() const
Locator<Occurrence>* HyperNet_NetOccurrences::Locator::getClone() const
// ******************************************************************
{
return new Locator(*this);
@ -499,18 +499,18 @@ bool HyperNet_NetOccurrences::Locator::IsValid() const
static bool IsConnex(const Occurrence& componentOccurrence1, const Occurrence& componentOccurrence2)
// *********************************************************************************************
{
Component* component1 = (Component*)componentOccurrence1.GetEntity();
Component* component2 = (Component*)componentOccurrence2.GetEntity();
Layer* layer1 = component1->GetLayer();
Layer* layer2 = component2->GetLayer();
Component* component1 = (Component*)componentOccurrence1.getEntity();
Component* component2 = (Component*)componentOccurrence2.getEntity();
Layer* layer1 = component1->getLayer();
Layer* layer2 = component2->getLayer();
if (layer1->getExtractMask() & layer2->getExtractMask()) {
Transformation transformation1 = componentOccurrence1.GetPath().GetTransformation();
Transformation transformation2 = componentOccurrence2.GetPath().GetTransformation();
Transformation transformation1 = componentOccurrence1.getPath().getTransformation();
Transformation transformation2 = componentOccurrence2.getPath().getTransformation();
for_each_basic_layer(basicLayer1, layer1->getBasicLayers()) {
Box box1 = transformation1.getBox(component1->GetBoundingBox(basicLayer1));
Box box1 = transformation1.getBox(component1->getBoundingBox(basicLayer1));
for_each_basic_layer(basicLayer2, layer2->getBasicLayers()) {
if (basicLayer1->getExtractMask() & basicLayer2->getExtractMask()) {
Box box2 = transformation2.getBox(component2->GetBoundingBox(basicLayer2));
Box box2 = transformation2.getBox(component2->getBoundingBox(basicLayer2));
if (box1.intersect(box2)) return true;
}
end_for;
@ -527,22 +527,22 @@ void HyperNet_NetOccurrences::Locator::Progress()
if (!_netOccurrenceStack.empty()) {
Occurrence netOccurrence = _netOccurrenceStack.top();
_netOccurrenceStack.pop();
Net* net = (Net*)netOccurrence.GetEntity();
Path path = netOccurrence.GetPath();
Net* net = (Net*)netOccurrence.getEntity();
Path path = netOccurrence.getPath();
if (_doExtraction) {
Cell* cell = netOccurrence.GetOwnerCell();
for_each_component(component, net->GetComponents()) {
Cell* cell = netOccurrence.getOwnerCell();
for_each_component(component, net->getComponents()) {
if (!is_a<Plug*>(component)) {
//if (_allowInterruption && !((i++) % 200)) gtk_check_for_interruption();
Occurrence occurrence = Occurrence(component, path);
Box area = occurrence.GetBoundingBox();
for_each_occurrence(occurrence2, cell->GetOccurrencesUnder(area)) {
if (is_a<Component*>(occurrence2.GetEntity())) {
Component* component2 = (Component*)occurrence2.GetEntity();
Box area = occurrence.getBoundingBox();
for_each_occurrence(occurrence2, cell->getOccurrencesUnder(area)) {
if (is_a<Component*>(occurrence2.getEntity())) {
Component* component2 = (Component*)occurrence2.getEntity();
if (IsConnex(occurrence, occurrence2)) {
Occurrence net2Occurrence =
Occurrence(component2->GetNet(), occurrence2.GetPath());
Occurrence(component2->getNet(), occurrence2.getPath());
if (_netOccurrenceSet.find(net2Occurrence) == _netOccurrenceSet.end()) {
_netOccurrenceSet.insert(net2Occurrence);
_netOccurrenceStack.push(net2Occurrence);
@ -556,8 +556,8 @@ void HyperNet_NetOccurrences::Locator::Progress()
}
}
for_each_plug(plug, net->GetPlugs()) {
Occurrence occurrence = Occurrence(plug->GetMasterNet(), Path(path, plug->GetInstance()));
for_each_plug(plug, net->getPlugs()) {
Occurrence occurrence = Occurrence(plug->getMasterNet(), Path(path, plug->getInstance()));
if (_netOccurrenceSet.find(occurrence) == _netOccurrenceSet.end()) {
_netOccurrenceSet.insert(occurrence);
_netOccurrenceStack.push(occurrence);
@ -566,13 +566,13 @@ void HyperNet_NetOccurrences::Locator::Progress()
}
if (net->IsExternal()) {
Instance* instance = path.GetTailInstance();
Instance* instance = path.getTailInstance();
if (instance) {
Plug* plug = instance->GetPlug(net);
Plug* plug = instance->getPlug(net);
if (plug) {
Net* net = plug->GetNet();
Net* net = plug->getNet();
if (net) {
Occurrence occurrence = Occurrence(net, path.GetHeadPath());
Occurrence occurrence = Occurrence(net, path.getHeadPath());
if (_netOccurrenceSet.find(occurrence) == _netOccurrenceSet.end()) {
_netOccurrenceSet.insert(occurrence);
_netOccurrenceStack.push(occurrence);
@ -584,12 +584,12 @@ void HyperNet_NetOccurrences::Locator::Progress()
}
}
string HyperNet_NetOccurrences::Locator::_GetString() const
string HyperNet_NetOccurrences::Locator::_getString() const
// *******************************************************
{
string s = "<" + _TName("HyperNet::NetOccurrences::Locator");
if (_hyperNet) {
s += " " + GetString(_hyperNet);
s += " " + getString(_hyperNet);
if (_doExtraction) {
s += " DO_EXTRACTION";
if (_allowInterruption) s += " ALLOW_INTERRUPTION";
@ -645,24 +645,24 @@ HyperNet_NetOccurrencesUnder& HyperNet_NetOccurrencesUnder::operator=(const Hype
return *this;
}
Collection<Occurrence>* HyperNet_NetOccurrencesUnder::GetClone() const
Collection<Occurrence>* HyperNet_NetOccurrencesUnder::getClone() const
// *****************************************************************
{
return new HyperNet_NetOccurrencesUnder(*this);
}
Locator<Occurrence>* HyperNet_NetOccurrencesUnder::GetLocator() const
Locator<Occurrence>* HyperNet_NetOccurrencesUnder::getLocator() const
// ****************************************************************
{
return new Locator(_hyperNet, _area, _doExtraction, _allowInterruption);
}
string HyperNet_NetOccurrencesUnder::_GetString() const
string HyperNet_NetOccurrencesUnder::_getString() const
// ***************************************************
{
string s = "<" + _TName("HyperNet::NetOccurrences");
if (_hyperNet) {
s += " " + GetString(_hyperNet);
s += " " + getString(_hyperNet);
if (_doExtraction) {
s += " DO_EXTRACTION";
if (_allowInterruption) s += " ALLOW_INTERRUPTION";
@ -702,7 +702,7 @@ HyperNet_NetOccurrencesUnder::Locator::Locator(const HyperNet* hyperNet, Box are
_netOccurrenceStack()
{
if (_hyperNet) {
Occurrence netOccurrence = _hyperNet->GetNetOccurrence();
Occurrence netOccurrence = _hyperNet->getNetOccurrence();
if (netOccurrence.IsValid()) {
_netOccurrenceSet.insert(netOccurrence);
_netOccurrenceStack.push(netOccurrence);
@ -734,13 +734,13 @@ HyperNet_NetOccurrencesUnder::Locator& HyperNet_NetOccurrencesUnder::Locator::op
return *this;
}
Occurrence HyperNet_NetOccurrencesUnder::Locator::GetElement() const
Occurrence HyperNet_NetOccurrencesUnder::Locator::getElement() const
// ***************************************************************
{
return (!_netOccurrenceStack.empty()) ? _netOccurrenceStack.top() : Occurrence();
}
Locator<Occurrence>* HyperNet_NetOccurrencesUnder::Locator::GetClone() const
Locator<Occurrence>* HyperNet_NetOccurrencesUnder::Locator::getClone() const
// ***********************************************************************
{
return new Locator(*this);
@ -758,14 +758,14 @@ void HyperNet_NetOccurrencesUnder::Locator::Progress()
if (!_netOccurrenceStack.empty()) {
Occurrence netOccurrence = _netOccurrenceStack.top();
_netOccurrenceStack.pop();
Net* net = (Net*)netOccurrence.GetEntity();
Path path = netOccurrence.GetPath();
Net* net = (Net*)netOccurrence.getEntity();
Path path = netOccurrence.getPath();
if (_doExtraction) {
Cell* cell = netOccurrence.GetOwnerCell();
for_each_component(component, net->GetComponents()) {
Cell* cell = netOccurrence.getOwnerCell();
for_each_component(component, net->getComponents()) {
Occurrence occurrence = Occurrence(component, path);
Box area = occurrence.GetBoundingBox();
Box area = occurrence.getBoundingBox();
if (! area.intersect (_area)) {
// Outside useful area
} else if (is_a<Plug*>(component)) {
@ -775,12 +775,12 @@ void HyperNet_NetOccurrencesUnder::Locator::Progress()
} else {
//if (_allowInterruption && !((i++) % 200)) gtk_check_for_interruption();
Box under = area.getIntersection (_area);
for_each_occurrence(occurrence2, cell->GetOccurrencesUnder(under)) {
if (is_a<Component*>(occurrence2.GetEntity())) {
Component* component2 = (Component*)occurrence2.GetEntity();
for_each_occurrence(occurrence2, cell->getOccurrencesUnder(under)) {
if (is_a<Component*>(occurrence2.getEntity())) {
Component* component2 = (Component*)occurrence2.getEntity();
if (IsConnex(occurrence, occurrence2)) {
Occurrence net2Occurrence =
Occurrence(component2->GetNet(), occurrence2.GetPath());
Occurrence(component2->getNet(), occurrence2.getPath());
if (_netOccurrenceSet.find(net2Occurrence) == _netOccurrenceSet.end()) {
_netOccurrenceSet.insert(net2Occurrence);
_netOccurrenceStack.push(net2Occurrence);
@ -794,8 +794,8 @@ void HyperNet_NetOccurrencesUnder::Locator::Progress()
}
}
for_each_plug(plug, net->GetPlugs()) {
Occurrence occurrence = Occurrence(plug->GetMasterNet(), Path(path, plug->GetInstance()));
for_each_plug(plug, net->getPlugs()) {
Occurrence occurrence = Occurrence(plug->getMasterNet(), Path(path, plug->getInstance()));
if (_netOccurrenceSet.find(occurrence) == _netOccurrenceSet.end()) {
_netOccurrenceSet.insert(occurrence);
_netOccurrenceStack.push(occurrence);
@ -804,13 +804,13 @@ void HyperNet_NetOccurrencesUnder::Locator::Progress()
}
if (net->IsExternal()) {
Instance* instance = path.GetTailInstance();
Instance* instance = path.getTailInstance();
if (instance) {
Plug* plug = instance->GetPlug(net);
Plug* plug = instance->getPlug(net);
if (plug) {
Net* net = plug->GetNet();
Net* net = plug->getNet();
if (net) {
Occurrence occurrence = Occurrence(net, path.GetHeadPath());
Occurrence occurrence = Occurrence(net, path.getHeadPath());
if (_netOccurrenceSet.find(occurrence) == _netOccurrenceSet.end()) {
_netOccurrenceSet.insert(occurrence);
_netOccurrenceStack.push(occurrence);
@ -822,12 +822,12 @@ void HyperNet_NetOccurrencesUnder::Locator::Progress()
}
}
string HyperNet_NetOccurrencesUnder::Locator::_GetString() const
string HyperNet_NetOccurrencesUnder::Locator::_getString() const
// ***********************************************************
{
string s = "<" + _TName("HyperNet::NetOccurrences::Locator");
if (_hyperNet) {
s += " " + GetString(_hyperNet);
s += " " + getString(_hyperNet);
if (_doExtraction) {
s += " DO_EXTRACTION";
if (_allowInterruption) s += " ALLOW_INTERRUPTION";
@ -877,24 +877,24 @@ HyperNet_LeafPlugOccurrences& HyperNet_LeafPlugOccurrences::operator=(const Hype
return *this;
}
Collection<Occurrence>* HyperNet_LeafPlugOccurrences::GetClone() const
Collection<Occurrence>* HyperNet_LeafPlugOccurrences::getClone() const
// ************************************************************
{
return new HyperNet_LeafPlugOccurrences(*this);
}
Locator<Occurrence>* HyperNet_LeafPlugOccurrences::GetLocator() const
Locator<Occurrence>* HyperNet_LeafPlugOccurrences::getLocator() const
// ***********************************************************
{
return new Locator(_hyperNet, _doExtraction, _allowInterruption);
}
string HyperNet_LeafPlugOccurrences::_GetString() const
string HyperNet_LeafPlugOccurrences::_getString() const
// **********************************************
{
string s = "<" + _TName("HyperNet::LeafPlugOccurrences");
if (_hyperNet) {
s += " " + GetString(_hyperNet);
s += " " + getString(_hyperNet);
if (_doExtraction) {
s += " DO_EXTRACTION";
if (_allowInterruption) s += " ALLOW_INTERRUPTION";
@ -926,7 +926,7 @@ HyperNet_LeafPlugOccurrences::Locator::Locator(const HyperNet* hyperNet, bool do
_plugOccurrence()
{
if (hyperNet) {
_netOccurrenceLocator = hyperNet->GetNetOccurrences(doExtraction,allowInterruption).GetLocator();
_netOccurrenceLocator = hyperNet->getNetOccurrences(doExtraction,allowInterruption).getLocator();
Progress();
}
}
@ -947,13 +947,13 @@ HyperNet_LeafPlugOccurrences::Locator& HyperNet_LeafPlugOccurrences::Locator::op
return *this;
}
Occurrence HyperNet_LeafPlugOccurrences::Locator::GetElement() const
Occurrence HyperNet_LeafPlugOccurrences::Locator::getElement() const
// **********************************************************
{
return _plugOccurrence;
}
Locator<Occurrence>* HyperNet_LeafPlugOccurrences::Locator::GetClone() const
Locator<Occurrence>* HyperNet_LeafPlugOccurrences::Locator::getClone() const
// ******************************************************************
{
return new Locator(*this);
@ -972,25 +972,25 @@ void HyperNet_LeafPlugOccurrences::Locator::Progress()
_plugOccurrence = Occurrence();
while(_netOccurrenceLocator.IsValid() && !_plugOccurrence.IsValid())
{
Occurrence netOccurrence = _netOccurrenceLocator.GetElement();
Occurrence netOccurrence = _netOccurrenceLocator.getElement();
_netOccurrenceLocator.Progress();
Net* net = (Net*)netOccurrence.GetEntity();
Path path = netOccurrence.GetPath();
if (!path.IsEmpty() && net->GetCell()->IsLeaf())
Net* net = (Net*)netOccurrence.getEntity();
Path path = netOccurrence.getPath();
if (!path.IsEmpty() && net->getCell()->IsLeaf())
{
Instance *instance = path.GetTailInstance();
Plug *plug=instance->GetPlug(net);
Instance *instance = path.getTailInstance();
Plug *plug=instance->getPlug(net);
if (plug)
_plugOccurrence=Occurrence(plug,path.GetHeadPath());
_plugOccurrence=Occurrence(plug,path.getHeadPath());
}
}
}
string HyperNet_LeafPlugOccurrences::Locator::_GetString() const
string HyperNet_LeafPlugOccurrences::Locator::_getString() const
// *******************************************************
{
string s = "<" + _TName("HyperNet::LeafPlugOccurrences::Locator");
s += " " + GetString(_netOccurrenceLocator);
s += " " + getString(_netOccurrenceLocator);
s += ">";
return s;
}

View File

@ -24,45 +24,45 @@ class HyperNet {
// Attributes
// **********
private: Occurrence _netOccurrence;
private: Occurrence _netOccurrence;
// Constructors
// ************
public: HyperNet(const Occurrence& occurrence);
public: HyperNet(const Occurrence& occurrence);
private: HyperNet(const HyperNet& hyperNet); // not implemented to forbid copy construction
private: HyperNet(const HyperNet& hyperNet); // not implemented to forbid copy construction
// Operators
// *********
private: HyperNet& operator=(const HyperNet& hyperNet); // not implemented to forbid assignment
private: HyperNet& operator=(const HyperNet& hyperNet); // not implemented to forbid assignment
// Accessors
// *********
public: const Occurrence& GetNetOccurrence() const {return _netOccurrence;};
public: Cell* GetCell() const {return _netOccurrence.GetOwnerCell();};
public: Occurrences GetNetOccurrences(bool doExtraction = false, bool allowInterruption = false) const;
public: Occurrences GetNetOccurrencesUnder(Box area, bool doExtraction = false,
bool allowInterruption = false) const;
public: Occurrences GetLeafPlugOccurrences(bool doExtraction = false , bool allowInterruption = false) const;
public: const Occurrence& getNetOccurrence() const {return _netOccurrence;};
public: Cell* getCell() const {return _netOccurrence.getOwnerCell();};
public: Occurrences getNetOccurrences(bool doExtraction = false, bool allowInterruption = false) const;
public: Occurrences getNetOccurrencesUnder(Box area, bool doExtraction = false,
bool allowInterruption = false) const;
public: Occurrences getLeafPlugOccurrences(bool doExtraction = false , bool allowInterruption = false) const;
// Predicates
// **********
public: bool IsValid() const {return _netOccurrence.IsValid();};
public: bool IsValid() const {return _netOccurrence.IsValid();};
// Others
// ******
public: string _GetTypeName() const { return _TName("HyperNet"); };
public: string _GetString() const;
public: Record* _GetRecord() const;
public: string _getTypeName() const { return _TName("HyperNet"); };
public: string _getString() const;
public: Record* _getRecord() const;
};
Occurrence GetHyperNetRootNetOccurrence(const Occurrence& netoccurrence);
Occurrence getHyperNetRootNetOccurrence(const Occurrence& netoccurrence);
bool IsHyperNetRootNetOccurrence(Occurrence netoccurrence);

View File

@ -44,7 +44,7 @@ class Instance_IsUnderFilter : public Filter<Instance*> {
return *this;
};
public: virtual Filter<Instance*>* GetClone() const
public: virtual Filter<Instance*>* getClone() const
// ************************************************
{
return new Instance_IsUnderFilter(*this);
@ -53,13 +53,13 @@ class Instance_IsUnderFilter : public Filter<Instance*> {
public: virtual bool Accept(Instance* instance) const
// **************************************************
{
return _area.intersect(instance->GetBoundingBox());
return _area.intersect(instance->getBoundingBox());
};
public: virtual string _GetString() const
public: virtual string _getString() const
// **************************************
{
return "<" + _TName("Instance::IsUnderFilter") + " " + GetString(_area) + ">";
return "<" + _TName("Instance::IsUnderFilter") + " " + getString(_area) + ">";
};
};
@ -73,11 +73,11 @@ class Instance_IsTerminalFilter : public Filter<Instance*> {
public: Instance_IsTerminalFilter& operator=(const Instance_IsTerminalFilter& filter) {return *this;};
public: virtual Filter<Instance*>* GetClone() const {return new Instance_IsTerminalFilter(*this);};
public: virtual Filter<Instance*>* getClone() const {return new Instance_IsTerminalFilter(*this);};
public: virtual bool Accept(Instance* instance) const {return instance->IsTerminal();};
public: virtual string _GetString() const {return "<" + _TName("Instance::IsTerminalFilter") + ">";};
public: virtual string _getString() const {return "<" + _TName("Instance::IsTerminalFilter") + ">";};
};
@ -90,11 +90,11 @@ class Instance_IsLeafFilter : public Filter<Instance*> {
public: Instance_IsLeafFilter& operator=(const Instance_IsLeafFilter& filter) {return *this;};
public: virtual Filter<Instance*>* GetClone() const {return new Instance_IsLeafFilter(*this);};
public: virtual Filter<Instance*>* getClone() const {return new Instance_IsLeafFilter(*this);};
public: virtual bool Accept(Instance* instance) const {return instance->IsLeaf();};
public: virtual string _GetString() const {return "<" + _TName("Instance::IsLeafFilter") + ">";};
public: virtual string _getString() const {return "<" + _TName("Instance::IsLeafFilter") + ">";};
};
@ -107,11 +107,11 @@ class Instance_IsUnplacedFilter : public Filter<Instance*> {
public: Instance_IsUnplacedFilter& operator=(const Instance_IsUnplacedFilter& filter) {return *this;};
public: virtual Filter<Instance*>* GetClone() const {return new Instance_IsUnplacedFilter(*this);};
public: virtual Filter<Instance*>* getClone() const {return new Instance_IsUnplacedFilter(*this);};
public: virtual bool Accept(Instance* instance) const {return instance->IsUnplaced();};
public: virtual string _GetString() const {return "<" + _TName("Net::IsUnplacedFilter>");};
public: virtual string _getString() const {return "<" + _TName("Net::IsUnplacedFilter>");};
};
@ -124,11 +124,11 @@ class Instance_IsPlacedFilter : public Filter<Instance*> {
public: Instance_IsPlacedFilter& operator=(const Instance_IsPlacedFilter& filter) {return *this;};
public: virtual Filter<Instance*>* GetClone() const {return new Instance_IsPlacedFilter(*this);};
public: virtual Filter<Instance*>* getClone() const {return new Instance_IsPlacedFilter(*this);};
public: virtual bool Accept(Instance* instance) const {return instance->IsPlaced();};
public: virtual string _GetString() const {return "<" + _TName("Net::IsPlacedFilter>");};
public: virtual string _getString() const {return "<" + _TName("Net::IsPlacedFilter>");};
};
@ -141,11 +141,11 @@ class Instance_IsFixedFilter : public Filter<Instance*> {
public: Instance_IsFixedFilter& operator=(const Instance_IsFixedFilter& filter) {return *this;};
public: virtual Filter<Instance*>* GetClone() const {return new Instance_IsFixedFilter(*this);};
public: virtual Filter<Instance*>* getClone() const {return new Instance_IsFixedFilter(*this);};
public: virtual bool Accept(Instance* instance) const {return instance->IsFixed();};
public: virtual string _GetString() const {return "<" + _TName("Net::IsFixedFilter>");};
public: virtual string _getString() const {return "<" + _TName("Net::IsFixedFilter>");};
};
@ -172,7 +172,7 @@ Instance::Instance(Cell* cell, const Name& name, Cell* masterCell, const Transfo
if (name.IsEmpty())
throw Error("Can't create " + _TName("Instance") + " : empty name");
if (_cell->GetInstance(_name))
if (_cell->getInstance(_name))
throw Error("Can't create " + _TName("Instance") + " : already exists");
if (!_masterCell)
@ -188,7 +188,7 @@ Instance* Instance::Create(Cell* cell, const Name& name, Cell* masterCell, bool
Instance* instance =
new Instance(cell, name, masterCell, Transformation(), PlacementStatus(), secureFlag);
instance->_PostCreate();
instance->_postCreate();
return instance;
}
@ -199,90 +199,90 @@ Instance* Instance::Create(Cell* cell, const Name& name, Cell* masterCell, const
Instance* instance =
new Instance(cell, name, masterCell, transformation, placementstatus, secureFlag);
instance->_PostCreate();
instance->_postCreate();
return instance;
}
Box Instance::GetBoundingBox() const
Box Instance::getBoundingBox() const
// *********************************
{
return _transformation.getBox(_masterCell->GetBoundingBox());
return _transformation.getBox(_masterCell->getBoundingBox());
}
Plugs Instance::GetConnectedPlugs() const
Plugs Instance::getConnectedPlugs() const
// **************************************
{
return GetPlugs().GetSubSet(Plug::GetIsConnectedFilter());
return getPlugs().getSubSet(Plug::getIsConnectedFilter());
}
Plugs Instance::GetUnconnectedPlugs() const
Plugs Instance::getUnconnectedPlugs() const
// ****************************************
{
return GetPlugs().GetSubSet(Plug::GetIsUnconnectedFilter());
return getPlugs().getSubSet(Plug::getIsUnconnectedFilter());
}
Path Instance::GetPath(const Path& tailPath) const
Path Instance::getPath(const Path& tailPath) const
// ***********************************************
{
return Path((Instance*)this, tailPath);
}
Box Instance::GetAbutmentBox() const
Box Instance::getAbutmentBox() const
// *********************************
{
return _transformation.getBox(_masterCell->GetAbutmentBox());
return _transformation.getBox(_masterCell->getAbutmentBox());
}
bool Instance::IsTerminal() const
// ******************************
{
return GetMasterCell()->IsTerminal();
return getMasterCell()->IsTerminal();
}
bool Instance::IsLeaf() const
// **************************
{
return GetMasterCell()->IsLeaf();
return getMasterCell()->IsLeaf();
}
InstanceFilter Instance::GetIsUnderFilter(const Box& area)
InstanceFilter Instance::getIsUnderFilter(const Box& area)
// *******************************************************
{
return Instance_IsUnderFilter(area);
}
InstanceFilter Instance::GetIsTerminalFilter()
InstanceFilter Instance::getIsTerminalFilter()
// *******************************************
{
return Instance_IsTerminalFilter();
}
InstanceFilter Instance::GetIsLeafFilter()
InstanceFilter Instance::getIsLeafFilter()
// *******************************************
{
return Instance_IsLeafFilter();
}
InstanceFilter Instance::GetIsUnplacedFilter()
InstanceFilter Instance::getIsUnplacedFilter()
// *******************************************
{
return Instance_IsUnplacedFilter();
}
InstanceFilter Instance::GetIsPlacedFilter()
InstanceFilter Instance::getIsPlacedFilter()
// *****************************************
{
return Instance_IsPlacedFilter();
}
InstanceFilter Instance::GetIsFixedFilter()
InstanceFilter Instance::getIsFixedFilter()
// ****************************************
{
return Instance_IsFixedFilter();
}
InstanceFilter Instance::GetIsNotUnplacedFilter()
InstanceFilter Instance::getIsNotUnplacedFilter()
// **********************************************
{
return !Instance_IsUnplacedFilter();
@ -292,11 +292,11 @@ void Instance::Materialize()
// *************************
{
if (!IsMaterialized()) {
Box boundingBox = GetBoundingBox();
Box boundingBox = getBoundingBox();
if (!boundingBox.isEmpty()) {
QuadTree* quadTree = _cell->_GetQuadTree();
QuadTree* quadTree = _cell->_getQuadTree();
quadTree->Insert(this);
_cell->_Fit(quadTree->GetBoundingBox());
_cell->_Fit(quadTree->getBoundingBox());
}
}
}
@ -305,8 +305,8 @@ void Instance::Unmaterialize()
// ***************************
{
if (IsMaterialized()) {
_cell->_Unfit(GetBoundingBox());
_cell->_GetQuadTree()->Remove(this);
_cell->_Unfit(getBoundingBox());
_cell->_getQuadTree()->Remove(this);
}
}
@ -316,7 +316,7 @@ void Instance::Invalidate(bool propagateFlag)
Inherit::Invalidate(false);
if (propagateFlag) {
for_each_plug(plug, GetConnectedPlugs()) {
for_each_plug(plug, getConnectedPlugs()) {
plug->Invalidate(true);
end_for;
}
@ -342,12 +342,12 @@ void Instance::SetName(const Name& name)
if (name.IsEmpty())
throw Error("Can't change instance name : empty name");
if (_cell->GetInstance(name))
if (_cell->getInstance(name))
throw Error("Can't change instance name : already exists");
_cell->_GetInstanceMap()._Remove(this);
_cell->_getInstanceMap()._Remove(this);
_name = name;
_cell->_GetInstanceMap()._Insert(this);
_cell->_getInstanceMap()._Insert(this);
}
}
@ -382,8 +382,8 @@ void Instance::SetMasterCell(Cell* masterCell, bool secureFlag)
list<Plug*> connectedPlugList;
list<Net*> masterNetList;
for_each_plug(plug, GetConnectedPlugs()) {
Net* masterNet = masterCell->GetNet(plug->GetMasterNet()->GetName());
for_each_plug(plug, getConnectedPlugs()) {
Net* masterNet = masterCell->getNet(plug->getMasterNet()->getName());
if (!masterNet || !masterNet->IsExternal())
throw Error("Can't set master (bad master net matching)");
connectedPlugList.push_back(plug);
@ -391,8 +391,8 @@ void Instance::SetMasterCell(Cell* masterCell, bool secureFlag)
end_for;
}
for_each_shared_path(sharedPath, _GetSharedPathes()) {
if (!sharedPath->GetTailSharedPath())
for_each_shared_path(sharedPath, _getSharedPathes()) {
if (!sharedPath->getTailSharedPath())
// if the tail is empty the SharedPath isn't impacted by the change
delete sharedPath;
end_for;
@ -400,8 +400,8 @@ void Instance::SetMasterCell(Cell* masterCell, bool secureFlag)
Invalidate(true);
for_each_plug(plug, GetUnconnectedPlugs()) {
plug->_Delete();
for_each_plug(plug, getUnconnectedPlugs()) {
plug->_destroy();
end_for;
}
@ -415,67 +415,67 @@ void Instance::SetMasterCell(Cell* masterCell, bool secureFlag)
masterNetList.pop_front();
}
_masterCell->_GetSlaveInstanceSet()._Remove(this);
_masterCell->_getSlaveInstanceSet()._Remove(this);
_masterCell = masterCell;
_masterCell->_GetSlaveInstanceSet()._Insert(this);
_masterCell->_getSlaveInstanceSet()._Insert(this);
for_each_net(externalNet, _masterCell->GetExternalNets()) {
if (!GetPlug(externalNet)) Plug::_Create(this, externalNet);
for_each_net(externalNet, _masterCell->getExternalNets()) {
if (!getPlug(externalNet)) Plug::_Create(this, externalNet);
end_for;
}
}
}
void Instance::_PostCreate()
void Instance::_postCreate()
// *************************
{
_cell->_GetInstanceMap()._Insert(this);
_masterCell->_GetSlaveInstanceSet()._Insert(this);
_cell->_getInstanceMap()._Insert(this);
_masterCell->_getSlaveInstanceSet()._Insert(this);
for_each_net(externalNet, _masterCell->GetExternalNets()) {
for_each_net(externalNet, _masterCell->getExternalNets()) {
Plug::_Create(this, externalNet);
end_for;
}
Inherit::_PostCreate();
Inherit::_postCreate();
}
void Instance::_PreDelete()
void Instance::_preDestroy()
// ************************
{
for_each_shared_path(sharedPath, _GetSharedPathes()) delete sharedPath; end_for;
for_each_shared_path(sharedPath, _getSharedPathes()) delete sharedPath; end_for;
Inherit::_PreDelete();
Inherit::_preDestroy();
for_each_plug(plug, GetPlugs()) plug->_Delete(); end_for;
for_each_plug(plug, getPlugs()) plug->_destroy(); end_for;
_masterCell->_GetSlaveInstanceSet()._Remove(this);
_cell->_GetInstanceMap()._Remove(this);
_masterCell->_getSlaveInstanceSet()._Remove(this);
_cell->_getInstanceMap()._Remove(this);
}
string Instance::_GetString() const
string Instance::_getString() const
// ********************************
{
string s = Inherit::_GetString();
s.insert(s.length() - 1, " " + GetString(_name));
s.insert(s.length() - 1, " " + GetString(_masterCell->GetName()));
string s = Inherit::_getString();
s.insert(s.length() - 1, " " + getString(_name));
s.insert(s.length() - 1, " " + getString(_masterCell->getName()));
return s;
}
Record* Instance::_GetRecord() const
Record* Instance::_getRecord() const
// ***************************
{
Record* record = Inherit::_GetRecord();
Record* record = Inherit::_getRecord();
if (record) {
record->Add(GetSlot("Cell", _cell));
record->Add(GetSlot("Name", &_name));
record->Add(GetSlot("MasterCell", _masterCell));
record->Add(GetSlot("Transformation", &_transformation));
record->Add(GetSlot("PlacementStatus", _placementStatus));
record->Add(GetSlot("XCenter", GetValue(GetAbutmentBox().getXCenter())));
record->Add(GetSlot("YCenter", GetValue(GetAbutmentBox().getYCenter())));
record->Add(GetSlot("Plugs", &_plugMap));
record->Add(GetSlot("SharedPathes", &_sharedPathMap));
record->Add(getSlot("Cell", _cell));
record->Add(getSlot("Name", &_name));
record->Add(getSlot("MasterCell", _masterCell));
record->Add(getSlot("Transformation", &_transformation));
record->Add(getSlot("PlacementStatus", _placementStatus));
record->Add(getSlot("XCenter", getValue(getAbutmentBox().getXCenter())));
record->Add(getSlot("YCenter", getValue(getAbutmentBox().getYCenter())));
record->Add(getSlot("Plugs", &_plugMap));
record->Add(getSlot("SharedPathes", &_sharedPathMap));
}
return record;
}
@ -483,11 +483,11 @@ Record* Instance::_GetRecord() const
//void Instance::_DrawPhantoms(View* view, const Box& updateArea, const Transformation& transformation)
//// **************************************************************************************************
//{
// Symbol* symbol = _masterCell->GetSymbol();
// Symbol* symbol = _masterCell->getSymbol();
// if (!symbol) {
// Box masterArea = updateArea;
// Transformation masterTransformation = _transformation;
// _transformation.GetInvert().ApplyOn(masterArea);
// _transformation.getInvert().ApplyOn(masterArea);
// transformation.ApplyOn(masterTransformation);
// _masterCell->_DrawPhantoms(view, masterArea, masterTransformation);
// }
@ -498,13 +498,13 @@ Record* Instance::_GetRecord() const
//{
// Box masterArea = updateArea;
// Transformation masterTransformation = _transformation;
// _transformation.GetInvert().ApplyOn(masterArea);
// _transformation.getInvert().ApplyOn(masterArea);
// transformation.ApplyOn(masterTransformation);
// Symbol* symbol = _masterCell->GetSymbol();
// Symbol* symbol = _masterCell->getSymbol();
// if (!symbol)
// _masterCell->_DrawBoundaries(view, masterArea, masterTransformation);
// else
// _masterCell->GetSymbol()->_Draw(view, masterArea, masterTransformation);
// _masterCell->getSymbol()->_Draw(view, masterArea, masterTransformation);
//}
//
//void Instance::_DrawRubbers(View* view, const Box& updateArea, const Transformation& transformation)
@ -512,7 +512,7 @@ Record* Instance::_GetRecord() const
//{
// Box masterArea = updateArea;
// Transformation masterTransformation = _transformation;
// _transformation.GetInvert().ApplyOn(masterArea);
// _transformation.getInvert().ApplyOn(masterArea);
// transformation.ApplyOn(masterTransformation);
// _masterCell->_DrawRubbers(view, masterArea, masterTransformation);
//}
@ -522,7 +522,7 @@ Record* Instance::_GetRecord() const
//{
// Box masterArea = updateArea;
// Transformation masterTransformation = _transformation;
// _transformation.GetInvert().ApplyOn(masterArea);
// _transformation.getInvert().ApplyOn(masterArea);
// transformation.ApplyOn(masterTransformation);
// _masterCell->_DrawMarkers(view, masterArea, masterTransformation);
//}
@ -532,7 +532,7 @@ Record* Instance::_GetRecord() const
//{
// Box masterArea = updateArea;
// Transformation masterTransformation = _transformation;
// _transformation.GetInvert().ApplyOn(masterArea);
// _transformation.getInvert().ApplyOn(masterArea);
// transformation.ApplyOn(masterTransformation);
// _masterCell->_DrawDisplaySlots(view, area, masterArea, masterTransformation);
//}
@ -540,13 +540,13 @@ Record* Instance::_GetRecord() const
//bool Instance::_IsInterceptedBy(View* view, const Point& point, const Unit& aperture) const
//// ****************************************************************************************
//{
// Symbol* symbol = _masterCell->GetSymbol();
// Symbol* symbol = _masterCell->getSymbol();
// if (!symbol)
// return (view->PhantomsAreVisible() || view->BoundariesAreVisible()) &&
// GetAbutmentBox().intersect(Box(point).Inflate(aperture));
// getAbutmentBox().intersect(Box(point).Inflate(aperture));
// else {
// Point masterPoint = point;
// _transformation.GetInvert().ApplyOn(masterPoint);
// _transformation.getInvert().ApplyOn(masterPoint);
// return (view->BoundariesAreVisible() && symbol->_IsInterceptedBy(view, masterPoint, aperture));
// }
//}
@ -554,11 +554,11 @@ Record* Instance::_GetRecord() const
//void Instance::_Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation)
//// ****************************************************************************************************
//{
// Symbol* symbol = _masterCell->GetSymbol();
// Symbol* symbol = _masterCell->getSymbol();
// if (!symbol) {
// Box masterArea = updateArea;
// Transformation masterTransformation = _transformation;
// _transformation.GetInvert().ApplyOn(masterArea);
// _transformation.getInvert().ApplyOn(masterArea);
// transformation.ApplyOn(masterTransformation);
// _masterCell->_DrawContent(view, basicLayer, masterArea, masterTransformation);
// }
@ -567,27 +567,27 @@ Record* Instance::_GetRecord() const
//void Instance::_Highlight(View* view, const Box& updateArea, const Transformation& transformation)
//// ***********************************************************************************************
//{
// Symbol* symbol = _masterCell->GetSymbol();
// Symbol* symbol = _masterCell->getSymbol();
// if (!symbol) {
// Box abutmentBox = transformation.GetBox(GetAbutmentBox());
// Box abutmentBox = transformation.getBox(getAbutmentBox());
// view->FillRectangle(abutmentBox);
// view->DrawRectangle(abutmentBox);
//
// if ( view->GetScale() > 1 )
// if ( view->getScale() > 1 )
// {
// if ( view->IsTextVisible() )
// {
// string text = GetString ( _name ) + " ("
// + GetString ( GetValue ( abutmentBox.GetXCenter () ) ) + ","
// + GetString ( GetValue ( abutmentBox.GetYCenter () ) ) + ")";
// view->DrawString ( text, abutmentBox.GetXMin(), abutmentBox.GetYMax() );
// string text = getString ( _name ) + " ("
// + getString ( getValue ( abutmentBox.getXCenter () ) ) + ","
// + getString ( getValue ( abutmentBox.getYCenter () ) ) + ")";
// view->DrawString ( text, abutmentBox.getXMin(), abutmentBox.getYMax() );
// }
// }
// }
// else {
// Box masterArea = updateArea;
// Transformation masterTransformation = _transformation;
// _transformation.GetInvert().ApplyOn(masterArea);
// _transformation.getInvert().ApplyOn(masterArea);
// transformation.ApplyOn(masterTransformation);
// symbol->_Highlight(view, masterArea, masterTransformation);
// }
@ -604,22 +604,22 @@ Instance::PlugMap::PlugMap()
{
}
const Net* Instance::PlugMap::_GetKey(Plug* plug) const
const Net* Instance::PlugMap::_getKey(Plug* plug) const
// ****************************************************
{
return plug->GetMasterNet();
return plug->getMasterNet();
}
unsigned Instance::PlugMap::_GetHashValue(const Net* masterNet) const
unsigned Instance::PlugMap::_getHashValue(const Net* masterNet) const
// ******************************************************************
{
return ( (unsigned int)( (unsigned long)masterNet ) ) / 8;
}
Plug* Instance::PlugMap::_GetNextElement(Plug* plug) const
Plug* Instance::PlugMap::_getNextElement(Plug* plug) const
// *******************************************************
{
return plug->_GetNextOfInstancePlugMap();
return plug->_getNextOfInstancePlugMap();
}
void Instance::PlugMap::_SetNextElement(Plug* plug, Plug* nextPlug) const
@ -640,22 +640,22 @@ Instance::SharedPathMap::SharedPathMap()
{
}
const SharedPath* Instance::SharedPathMap::_GetKey(SharedPath* sharedPath) const
const SharedPath* Instance::SharedPathMap::_getKey(SharedPath* sharedPath) const
// *****************************************************************************
{
return sharedPath->GetTailSharedPath();
return sharedPath->getTailSharedPath();
}
unsigned Instance::SharedPathMap::_GetHashValue(const SharedPath* tailSharedPath) const
unsigned Instance::SharedPathMap::_getHashValue(const SharedPath* tailSharedPath) const
// ************************************************************************************
{
return ( (unsigned int)( (unsigned long)tailSharedPath ) ) / 8;
}
SharedPath* Instance::SharedPathMap::_GetNextElement(SharedPath* sharedPath) const
SharedPath* Instance::SharedPathMap::_getNextElement(SharedPath* sharedPath) const
// *******************************************************************************
{
return sharedPath->_GetNextOfInstanceSharedPathMap();
return sharedPath->_getNextOfInstanceSharedPathMap();
}
void Instance::SharedPathMap::_SetNextElement(SharedPath* sharedPath, SharedPath* nextSharedPath) const
@ -687,17 +687,17 @@ Instance::PlacementStatus& Instance::PlacementStatus::operator=(const PlacementS
return *this;
}
string Instance::PlacementStatus::_GetString() const
string Instance::PlacementStatus::_getString() const
// *************************************************
{
return GetString(&_code);
return getString(&_code);
}
Record* Instance::PlacementStatus::_GetRecord() const
Record* Instance::PlacementStatus::_getRecord() const
// ********************************************
{
Record* record = new Record(GetString(this));
record->Add(GetSlot("Code", &_code));
Record* record = new Record(getString(this));
record->Add(getSlot("Code", &_code));
return record;
}

View File

@ -3,7 +3,6 @@
// Authors: R. Escassut
// Copyright (c) BULL S.A. 2000-2004, All Rights Reserved
// ****************************************************************************************************
// 21-10-2003 Alignment BULL-LIP6
#ifndef HURRICANE_INSTANCE
#define HURRICANE_INSTANCE
@ -32,157 +31,147 @@ class Instance : public Go {
// Types
// *****
public: typedef Go Inherit;
public: typedef Go Inherit;
public: class PlacementStatus {
// **************************
// **************************
public: enum Code {UNPLACED=0, PLACED=1, FIXED=2};
public: enum Code {UNPLACED=0, PLACED=1, FIXED=2};
private: Code _code;
private: Code _code;
public: PlacementStatus(const Code& code = UNPLACED);
public: PlacementStatus(const PlacementStatus& placementstatus);
public: PlacementStatus(const Code& code = UNPLACED);
public: PlacementStatus(const PlacementStatus& placementstatus);
public: PlacementStatus& operator=(const PlacementStatus& placementstatus);
public: PlacementStatus& operator=(const PlacementStatus& placementstatus);
public: operator const Code&() const {return _code;};
public: operator const Code&() const {return _code;};
public: const Code& GetCode() const {return _code;};
public: const Code& getCode() const {return _code;};
public: string _GetTypeName() const { return _TName("Instance::PlacementStatus"); };
public: string _GetString() const;
public: Record* _GetRecord() const;
public: string _getTypeName() const { return _TName("Instance::PlacementStatus"); };
public: string _getString() const;
public: Record* _getRecord() const;
};
};
public: class PlugMap : public IntrusiveMap<const Net*, Plug> {
// **********************************************************
public: class PlugMap : public IntrusiveMap<const Net*, Plug> {
// **********************************************************
public: typedef IntrusiveMap<const Net*, Plug> Inherit;
public: PlugMap();
public: typedef IntrusiveMap<const Net*, Plug> Inherit;
public: PlugMap();
public: virtual const Net* _GetKey(Plug* plug) const;
public: virtual unsigned _GetHashValue(const Net* masterNet) const;
public: virtual Plug* _GetNextElement(Plug* plug) const;
public: virtual void _SetNextElement(Plug* plug, Plug* nextPlug) const;
public: virtual const Net* _getKey(Plug* plug) const;
public: virtual unsigned _getHashValue(const Net* masterNet) const;
public: virtual Plug* _getNextElement(Plug* plug) const;
public: virtual void _SetNextElement(Plug* plug, Plug* nextPlug) const;
};
};
public: class SharedPathMap : public IntrusiveMap<const SharedPath*, SharedPath> {
// *****************************************************************************
public: class SharedPathMap : public IntrusiveMap<const SharedPath*, SharedPath> {
// *****************************************************************************
public: typedef IntrusiveMap<const SharedPath*, SharedPath> Inherit;
public: SharedPathMap();
public: typedef IntrusiveMap<const SharedPath*, SharedPath> Inherit;
public: SharedPathMap();
public: virtual const SharedPath* _GetKey(SharedPath* sharedPath) const;
public: virtual unsigned _GetHashValue(const SharedPath* tailSharedPath) const;
public: virtual SharedPath* _GetNextElement(SharedPath* sharedPath) const;
public: virtual void _SetNextElement(SharedPath* sharedPath, SharedPath* nextSharedPath) const;
public: virtual const SharedPath* _getKey(SharedPath* sharedPath) const;
public: virtual unsigned _getHashValue(const SharedPath* tailSharedPath) const;
public: virtual SharedPath* _getNextElement(SharedPath* sharedPath) const;
public: virtual void _SetNextElement(SharedPath* sharedPath, SharedPath* nextSharedPath) const;
};
};
// Attributes
// **********
private: Cell* _cell;
private: Name _name;
private: Cell* _masterCell;
private: Transformation _transformation;
private: Cell* _cell;
private: Name _name;
private: Cell* _masterCell;
private: Transformation _transformation;
private: PlacementStatus _placementStatus;
private: PlugMap _plugMap;
private: SharedPathMap _sharedPathMap;
private: Instance* _nextOfCellInstanceMap;
private: Instance* _nextOfCellSlaveInstanceSet;
private: PlugMap _plugMap;
private: SharedPathMap _sharedPathMap;
private: Instance* _nextOfCellInstanceMap;
private: Instance* _nextOfCellSlaveInstanceSet;
// Constructors
// ************
protected: Instance(Cell* cell, const Name& name, Cell* masterCell, const Transformation& transformation, const PlacementStatus& placementstatus, bool secureFlag);
protected: Instance(Cell* cell, const Name& name, Cell* masterCell, const Transformation& transformation, const PlacementStatus& placementstatus, bool secureFlag);
public: static Instance* Create(Cell* cell, const Name& name, Cell* masterCell, bool secureFlag = true);
public: static Instance* Create(Cell* cell, const Name& name, Cell* masterCell, const Transformation& transformation, const PlacementStatus& placementstatus, bool secureFlag = true);
public: static Instance* Create(Cell* cell, const Name& name, Cell* masterCell, bool secureFlag = true);
public: static Instance* Create(Cell* cell, const Name& name, Cell* masterCell, const Transformation& transformation, const PlacementStatus& placementstatus, bool secureFlag = true);
// Accessors
// *********
public: virtual Cell* GetCell() const {return _cell;};
public: virtual Box GetBoundingBox() const;
public: const Name& GetName() const {return _name;};
public: Cell* GetMasterCell() const {return _masterCell;};
public: const Transformation& GetTransformation() const {return _transformation;};
public: const PlacementStatus& GetPlacementStatus() const {return _placementStatus;};
public: Plug* GetPlug(const Net* masterNet) const {return _plugMap.GetElement(masterNet);};
public: Plugs GetPlugs() const {return _plugMap.GetElements();};
public: Plugs GetConnectedPlugs() const;
public: Plugs GetUnconnectedPlugs() const;
public: Path GetPath(const Path& tailPath = Path()) const;
public: Box GetAbutmentBox() const;
public: virtual Cell* getCell() const {return _cell;};
public: virtual Box getBoundingBox() const;
public: const Name& getName() const {return _name;};
public: Cell* getMasterCell() const {return _masterCell;};
public: const Transformation& getTransformation() const {return _transformation;};
public: const PlacementStatus& getPlacementStatus() const {return _placementStatus;};
public: Plug* getPlug(const Net* masterNet) const {return _plugMap.getElement(masterNet);};
public: Plugs getPlugs() const {return _plugMap.getElements();};
public: Plugs getConnectedPlugs() const;
public: Plugs getUnconnectedPlugs() const;
public: Path getPath(const Path& tailPath = Path()) const;
public: Box getAbutmentBox() const;
// Predicates
// **********
public: bool IsUnplaced() const {return _placementStatus == PlacementStatus::UNPLACED;};
public: bool IsPlaced() const {return _placementStatus == PlacementStatus::PLACED;};
public: bool IsFixed() const {return _placementStatus == PlacementStatus::FIXED;};
public: bool IsTerminal() const;
public: bool IsLeaf() const;
public: bool IsFixed() const {return _placementStatus == PlacementStatus::FIXED;};
public: bool IsTerminal() const;
public: bool IsLeaf() const;
// Filters
// *******
public: static InstanceFilter GetIsUnderFilter(const Box& area);
public: static InstanceFilter GetIsTerminalFilter();
public: static InstanceFilter GetIsLeafFilter();
public: static InstanceFilter GetIsUnplacedFilter();
public: static InstanceFilter GetIsPlacedFilter();
public: static InstanceFilter GetIsFixedFilter();
public: static InstanceFilter GetIsNotUnplacedFilter();
public: static InstanceFilter getIsUnderFilter(const Box& area);
public: static InstanceFilter getIsTerminalFilter();
public: static InstanceFilter getIsLeafFilter();
public: static InstanceFilter getIsUnplacedFilter();
public: static InstanceFilter getIsPlacedFilter();
public: static InstanceFilter getIsFixedFilter();
public: static InstanceFilter getIsNotUnplacedFilter();
// Updators
// ********
public: virtual void Materialize();
public: virtual void Unmaterialize();
public: virtual void Invalidate(bool propagateFlag = true);
public: virtual void Translate(const Unit& dx, const Unit& dy);
public: virtual void Materialize();
public: virtual void Unmaterialize();
public: virtual void Invalidate(bool propagateFlag = true);
public: virtual void Translate(const Unit& dx, const Unit& dy);
public: void SetName(const Name& name);
public: void SetTransformation(const Transformation& transformation);
public: void SetPlacementStatus(const PlacementStatus& placementstatus);
public: void SetMasterCell(Cell* masterCell, bool secureFlag = true);
public: void SetName(const Name& name);
public: void SetTransformation(const Transformation& transformation);
public: void SetPlacementStatus(const PlacementStatus& placementstatus);
public: void SetMasterCell(Cell* masterCell, bool secureFlag = true);
// Others
// ******
protected: virtual void _PostCreate();
protected: virtual void _postCreate();
protected: virtual void _PreDelete();
protected: virtual void _preDestroy();
public: virtual string _GetTypeName() const {return _TName("Instance");};
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: PlugMap& _GetPlugMap() {return _plugMap;};
public: SharedPath* _GetSharedPath(const SharedPath* tailSharedPath) const {return _sharedPathMap.GetElement(tailSharedPath);}
public: SharedPathes _GetSharedPathes() const {return _sharedPathMap.GetElements();};
public: SharedPathMap& _GetSharedPathMap() {return _sharedPathMap;};
public: Instance* _GetNextOfCellInstanceMap() const {return _nextOfCellInstanceMap;};
public: Instance* _GetNextOfCellSlaveInstanceSet() const {return _nextOfCellSlaveInstanceSet;};
public: virtual string _getTypeName() const {return _TName("Instance");};
public: virtual string _getString() const;
public: virtual Record* _getRecord() const;
public: PlugMap& _getPlugMap() {return _plugMap;};
public: SharedPath* _getSharedPath(const SharedPath* tailSharedPath) const {return _sharedPathMap.getElement(tailSharedPath);}
public: SharedPathes _getSharedPathes() const {return _sharedPathMap.getElements();};
public: SharedPathMap& _getSharedPathMap() {return _sharedPathMap;};
public: Instance* _getNextOfCellInstanceMap() const {return _nextOfCellInstanceMap;};
public: Instance* _getNextOfCellSlaveInstanceSet() const {return _nextOfCellSlaveInstanceSet;};
public: void _SetNextOfCellInstanceMap(Instance* instance) {_nextOfCellInstanceMap = instance;};
public: void _SetNextOfCellSlaveInstanceSet(Instance* instance) {_nextOfCellSlaveInstanceSet = instance;};
//public: void _DrawPhantoms(View* view, const Box& updateArea, const Transformation& transformation);
//public: void _DrawBoundaries(View* view, const Box& updateArea, const Transformation& transformation);
//public: void _DrawRubbers(View* view, const Box& updateArea, const Transformation& transformation);
//public: void _DrawMarkers(View* view, const Box& updateArea, const Transformation& transformation);
//public: void _DrawDisplaySlots(View* view, const Box& area, const Box& updateArea, const Transformation& transformation);
//public: virtual bool _IsInterceptedBy(View* view, const Point& point, const Unit& aperture) const;
//public: virtual void _Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation);
//public: virtual void _Highlight(View* view, const Box& updateArea, const Transformation& transformation);
public: void _SetNextOfCellInstanceMap(Instance* instance) {_nextOfCellInstanceMap = instance;};
public: void _SetNextOfCellSlaveInstanceSet(Instance* instance) {_nextOfCellSlaveInstanceSet = instance;};
};
@ -213,8 +202,8 @@ template<>
inline Record* ProxyRecord <Instance::PlacementStatus::Code>
( const Instance::PlacementStatus::Code* object )
{
Record* record = new Record(GetString(object));
record->Add(GetSlot("Code", (unsigned int*)object));
Record* record = new Record(getString(object));
record->Add(getSlot("Code", (unsigned int*)object));
return record;
}

View File

@ -46,10 +46,10 @@ typedef GenericFilter<Instance*> InstanceFilter;
#define for_each_instance(instance, instances)\
/*********************************************/\
{\
InstanceLocator _locator = instances.GetLocator();\
while (_locator.IsValid()) {\
Instance* instance = _locator.GetElement();\
_locator.Progress();
InstanceLocator _locator = instances.getLocator();\
while (_locator.IsValid()) {\
Instance* instance = _locator.getElement();\
_locator.Progress();

View File

@ -16,34 +16,34 @@ namespace Hurricane {
Interruption::Interruption(const string& reason, int code)
// *******************************************************
: Inherit(),
_reason(reason),
_code(code)
: Inherit(),
_reason(reason),
_code(code)
{
}
Interruption::Interruption(const Interruption& interruption)
// *********************************************************
: Inherit(),
_reason(interruption._reason),
_code(interruption._code)
: Inherit(),
_reason(interruption._reason),
_code(interruption._code)
{
}
Interruption& Interruption::operator=(const Interruption& interruption)
// ********************************************************************
{
_reason = interruption._reason;
_code = interruption._code;
return *this;
_reason = interruption._reason;
_code = interruption._code;
return *this;
}
string Interruption::_GetString() const
string Interruption::_getString() const
// ************************************
{
if (!_code) return "[INTERRUPTION] " + _reason;
if (!_code) return "[INTERRUPTION] " + _reason;
return "[INTERRUPTION:" + GetString(_code) + "] " + _reason;
return "[INTERRUPTION:" + getString(_code) + "] " + _reason;
}

View File

@ -23,37 +23,37 @@ class Interruption : public Exception {
// Types
// *****
public: typedef Exception Inherit;
public: typedef Exception Inherit;
// Attributes
// **********
private: string _reason;
private: int _code;
private: string _reason;
private: int _code;
// Constructors
// ************
public: Interruption(const string& reason, int code = 0);
public: Interruption(const string& reason, int code = 0);
public: Interruption(const Interruption& interruption);
public: Interruption(const Interruption& interruption);
// Operators
// *********
public: Interruption& operator=(const Interruption& interruption);
public: Interruption& operator=(const Interruption& interruption);
// Accessors
// *********
public: string GetReason() const {return _reason;};
public: int GetCode() const {return _code;};
public: string getReason() const {return _reason;};
public: int getCode() const {return _code;};
// Others
// ******
public: virtual string _GetTypeName() const { return _TName("Interruption"); };
public: virtual string _GetString() const;
public: virtual string _getTypeName() const { return _TName("Interruption"); };
public: virtual string _getString() const;
};

View File

@ -16,8 +16,8 @@ namespace Hurricane {
Interval::Interval(bool makeEmpty)
// *******************************
: _vMin(1),
_vMax(-1)
: _vMin(1),
_vMax(-1)
{
if (!makeEmpty) {
_vMin = UNIT_MIN;
@ -27,87 +27,87 @@ Interval::Interval(bool makeEmpty)
Interval::Interval(const Unit& value)
// **********************************
: _vMin(value),
_vMax(value)
: _vMin(value),
_vMax(value)
{
}
Interval::Interval(const Unit& v1, const Unit& v2)
// ***********************************************
: _vMin(min(v1, v2)),
_vMax(max(v1, v2))
: _vMin(min(v1, v2)),
_vMax(max(v1, v2))
{
}
Interval::Interval(const Interval& interval)
// *****************************************
: _vMin(interval._vMin),
_vMax(interval._vMax)
: _vMin(interval._vMin),
_vMax(interval._vMax)
{
}
Interval& Interval::operator=(const Interval& interval)
// ****************************************************
{
_vMin = interval._vMin;
_vMax = interval._vMax;
return *this;
_vMin = interval._vMin;
_vMax = interval._vMax;
return *this;
}
bool Interval::operator==(const Interval& interval) const
// ******************************************************
{
return !IsEmpty() && !interval.IsEmpty() && (_vMin == interval._vMin) && (_vMax == interval._vMax);
return !IsEmpty() && !interval.IsEmpty() && (_vMin == interval._vMin) && (_vMax == interval._vMax);
}
bool Interval::operator!=(const Interval& interval) const
// ******************************************************
{
return IsEmpty() || interval.IsEmpty() || (_vMin != interval._vMin) || (_vMax != interval._vMax);
return IsEmpty() || interval.IsEmpty() || (_vMin != interval._vMin) || (_vMax != interval._vMax);
}
Interval Interval::GetUnion(const Interval& interval) const
Interval Interval::getUnion(const Interval& interval) const
// ********************************************************
{
if (IsEmpty() && interval.IsEmpty()) return Interval();
return Interval(min(_vMin, interval._vMin), max(_vMax, interval._vMax));
if (IsEmpty() && interval.IsEmpty()) return Interval();
return Interval(min(_vMin, interval._vMin), max(_vMax, interval._vMax));
}
Interval Interval::GetIntersection(const Interval& interval) const
Interval Interval::getIntersection(const Interval& interval) const
// ***************************************************************
{
if (!Intersect(interval)) return Interval();
return Interval(max(_vMin, interval._vMin), min(_vMax, interval._vMax));
if (!Intersect(interval)) return Interval();
return Interval(max(_vMin, interval._vMin), min(_vMax, interval._vMax));
}
bool Interval::IsEmpty() const
// ***************************
{
return (_vMax < _vMin);
return (_vMax < _vMin);
}
bool Interval::IsPonctual() const
// ******************************
{
return (_vMax == _vMin);
return (_vMax == _vMin);
}
bool Interval::Contains(const Unit& v) const
// *****************************************
{
return !IsEmpty() && (_vMin <= v) && (v <= _vMax);
return !IsEmpty() && (_vMin <= v) && (v <= _vMax);
}
bool Interval::Contains(const Interval& interval) const
// ****************************************************
{
return !IsEmpty() && !interval.IsEmpty() && (_vMin <= interval._vMin) && (interval._vMax <= _vMax);
return !IsEmpty() && !interval.IsEmpty() && (_vMin <= interval._vMin) && (interval._vMax <= _vMax);
}
bool Interval::Intersect(const Interval& interval) const
// *****************************************************
{
return !IsEmpty() && !interval.IsEmpty() && !((_vMax < interval._vMin) || (interval._vMax < _vMin));
return !IsEmpty() && !interval.IsEmpty() && !((_vMax < interval._vMin) || (interval._vMax < _vMin));
}
bool Interval::Inferior(const Interval& interval, bool strict) const
@ -127,57 +127,57 @@ bool Interval::Superior(const Interval& interval, bool strict) const
bool Interval::IsConstrainedBy(const Interval& interval) const
// ***********************************************************
{
return (!IsEmpty() &&
!interval.IsEmpty() &&
((_vMin == interval.GetVMin()) || (_vMax == interval.GetVMax())));
return (!IsEmpty() &&
!interval.IsEmpty() &&
((_vMin == interval.getVMin()) || (_vMax == interval.getVMax())));
}
Interval& Interval::MakeEmpty()
// ****************************
{
_vMin = 1;
_vMax = -1;
return *this;
_vMin = 1;
_vMax = -1;
return *this;
}
Interval& Interval::Inflate(const Unit& dv)
// ****************************************
{
return Inflate(dv, dv);
return Inflate(dv, dv);
}
Interval& Interval::Inflate(const Unit& dvMin, const Unit& dvMax)
// **************************************************************
{
if (!IsEmpty()) {
_vMin -= dvMin;
_vMax += dvMax;
}
return *this;
if (!IsEmpty()) {
_vMin -= dvMin;
_vMax += dvMax;
}
return *this;
}
Interval& Interval::Merge(const Unit& v)
// *************************************
{
if (IsEmpty()) {
_vMin = v;
_vMax = v;
}
else {
_vMin = min(_vMin, v);
_vMax = max(_vMax, v);
}
return *this;
if (IsEmpty()) {
_vMin = v;
_vMax = v;
}
else {
_vMin = min(_vMin, v);
_vMax = max(_vMax, v);
}
return *this;
}
Interval& Interval::Merge(const Interval& interval)
// ************************************************
{
if (!interval.IsEmpty()) {
_vMin = min(_vMin, interval._vMin);
_vMax = max(_vMax, interval._vMax);
}
return *this;
if (!interval.IsEmpty()) {
_vMin = min(_vMin, interval._vMin);
_vMax = max(_vMax, interval._vMax);
}
return *this;
}
Interval& Interval::Intersection(const Unit& vMin, const Unit& vMax)
@ -201,26 +201,26 @@ Interval& Interval::Intersection(const Interval& interval)
Interval& Interval::Translate(const Unit& dv)
// ******************************************
{
if (!IsEmpty()) {
_vMin += dv;
_vMax += dv;
}
return *this;
if (!IsEmpty()) {
_vMin += dv;
_vMax += dv;
}
return *this;
}
string Interval::_GetString() const
string Interval::_getString() const
// ********************************
{
return "<" + _TName("Interval") + " " + GetValueString(_vMin) + " " + GetValueString(_vMax) + ">";
return "<" + _TName("Interval") + " " + getValueString(_vMin) + " " + getValueString(_vMax) + ">";
}
Record* Interval::_GetRecord() const
Record* Interval::_getRecord() const
// ***************************
{
Record* record = new Record(GetString(this));
record->Add(GetSlot("VMin", &_vMin));
record->Add(GetSlot("VMin", &_vMax));
return record;
Record* record = new Record(getString(this));
record->Add(getSlot("VMin", &_vMin));
record->Add(getSlot("VMin", &_vMax));
return record;
}

View File

@ -23,68 +23,68 @@ class Interval {
// Attributes
// **********
private: Unit _vMin;
private: Unit _vMax;
private: Unit _vMin;
private: Unit _vMax;
// Constructors
// ************
public: Interval(bool makeEmpty=true);
public: Interval(const Unit& v);
public: Interval(const Unit& v1, const Unit& v2);
public: Interval(const Interval& interval);
public: Interval(bool makeEmpty=true);
public: Interval(const Unit& v);
public: Interval(const Unit& v1, const Unit& v2);
public: Interval(const Interval& interval);
// Operators
// *********
public: Interval& operator=(const Interval& interval);
public: Interval& operator=(const Interval& interval);
public: bool operator==(const Interval& interval) const;
public: bool operator!=(const Interval& interval) const;
public: bool operator==(const Interval& interval) const;
public: bool operator!=(const Interval& interval) const;
// Accessors
// *********
public: const Unit& GetVMin() const {return _vMin;};
public: const Unit& GetVMax() const {return _vMax;};
public: Unit& GetVMin() {return _vMin;};
public: Unit& GetVMax() {return _vMax;};
public: Unit GetCenter() const {return ((_vMin + _vMax) / 2);};
public: Unit GetSize() const {return (_vMax - _vMin);};
public: Unit GetHalfSize() const {return (GetSize() / 2);};
public: Interval GetUnion(const Interval& interval) const;
public: Interval GetIntersection(const Interval& interval) const;
public: const Unit& getVMin() const {return _vMin;};
public: const Unit& getVMax() const {return _vMax;};
public: Unit& getVMin() {return _vMin;};
public: Unit& getVMax() {return _vMax;};
public: Unit getCenter() const {return ((_vMin + _vMax) / 2);};
public: Unit getSize() const {return (_vMax - _vMin);};
public: Unit getHalfSize() const {return (getSize() / 2);};
public: Interval getUnion(const Interval& interval) const;
public: Interval getIntersection(const Interval& interval) const;
// Predicates
// **********
public: bool IsEmpty() const;
public: bool IsPonctual() const;
public: bool Contains(const Unit& v) const;
public: bool Contains(const Interval& interval) const;
public: bool Intersect(const Interval& interval) const;
public: bool Inferior(const Interval& interval, bool strict=true) const;
public: bool Superior(const Interval& interval, bool strict=true) const;
public: bool IsConstrainedBy(const Interval& interval) const;
public: bool IsEmpty() const;
public: bool IsPonctual() const;
public: bool Contains(const Unit& v) const;
public: bool Contains(const Interval& interval) const;
public: bool Intersect(const Interval& interval) const;
public: bool Inferior(const Interval& interval, bool strict=true) const;
public: bool Superior(const Interval& interval, bool strict=true) const;
public: bool IsConstrainedBy(const Interval& interval) const;
// Updators
// ********
public: Interval& MakeEmpty();
public: Interval& Inflate(const Unit& dv);
public: Interval& Inflate(const Unit& dvMin, const Unit& dvMax);
public: Interval& Merge(const Unit& v);
public: Interval& Merge(const Interval& interval);
public: Interval& Intersection(const Unit& vMin, const Unit& vMax);
public: Interval& Intersection(const Interval& interval);
public: Interval& Translate(const Unit& dv);
public: Interval& MakeEmpty();
public: Interval& Inflate(const Unit& dv);
public: Interval& Inflate(const Unit& dvMin, const Unit& dvMax);
public: Interval& Merge(const Unit& v);
public: Interval& Merge(const Interval& interval);
public: Interval& Intersection(const Unit& vMin, const Unit& vMax);
public: Interval& Intersection(const Interval& interval);
public: Interval& Translate(const Unit& dv);
// Others
// ******
public: string _GetTypeName() const { return _TName("Interval"); };
public: string _GetString() const;
public: Record* _GetRecord() const;
public: string _getTypeName() const { return _TName("Interval"); };
public: string _getString() const;
public: Record* _getRecord() const;
};

View File

@ -45,9 +45,9 @@ typedef GenericFilter<Interval> IntervalFilter;
#define for_each_interval(interval, intervals)\
/*********************************************/\
{\
IntervalLocator _locator = intervals.GetLocator();\
IntervalLocator _locator = intervals.getLocator();\
while (_locator.IsValid()) {\
Interval interval = _locator.GetElement();\
Interval interval = _locator.getElement();\
_locator.Progress();

View File

@ -26,415 +26,415 @@ template<class Key, class Element> class IntrusiveMap {
// Types
// *****
class Elements : public Collection<Element*> {
// *****************************************
// Types
// *****
public: typedef Collection<Element*> Inherit;
public: class Locator : public Hurricane::Locator<Element*> {
// ********************************************************
// Types
// *****
public: typedef Hurricane::Locator<Element*> Inherit;
// Attributes
// **********
private: const IntrusiveMap* _map;
private: unsigned _index;
private: Element* _element;
// Constructors
// ************
public: Locator(const IntrusiveMap* map = NULL)
// ********************************************
: Inherit(),
_map(map),
_index(0),
_element(NULL)
{
if (_map) {
unsigned length = _map->_GetLength();
do {
_element = _map->_GetArray()[_index++];
} while (!_element && (_index < length));
}
};
class Elements : public Collection<Element*> {
// *****************************************
// Types
// *****
public: typedef Collection<Element*> Inherit;
public: class Locator : public Hurricane::Locator<Element*> {
// ********************************************************
// Types
// *****
public: typedef Hurricane::Locator<Element*> Inherit;
// Attributes
// **********
private: const IntrusiveMap* _map;
private: unsigned _index;
private: Element* _element;
// Constructors
// ************
public: Locator(const IntrusiveMap* map = NULL)
// ********************************************
: Inherit(),
_map(map),
_index(0),
_element(NULL)
{
if (_map) {
unsigned length = _map->_getLength();
do {
_element = _map->_getArray()[_index++];
} while (!_element && (_index < length));
}
};
public: Locator(const Locator& locator)
// ************************************
: Inherit(),
_map(locator._map),
_index(locator._index),
_element(locator._element)
{
};
// Operators
// *********
public: Locator& operator=(const Locator& locator)
// ***********************************************
{
_map = locator._map;
_index = locator._index;
_element = locator._element;
return *this;
};
// Accessors
// *********
public: virtual Element* GetElement() const
// ****************************************
{
return _element;
};
public: Locator(const Locator& locator)
// ************************************
: Inherit(),
_map(locator._map),
_index(locator._index),
_element(locator._element)
{
};
// Operators
// *********
public: Locator& operator=(const Locator& locator)
// ***********************************************
{
_map = locator._map;
_index = locator._index;
_element = locator._element;
return *this;
};
// Accessors
// *********
public: virtual Element* getElement() const
// ****************************************
{
return _element;
};
public: virtual Hurricane::Locator<Element*>* GetClone() const
// ***********************************************************
{
return new Locator(*this);
};
// Predicates
// **********
public: virtual bool IsValid() const
// *********************************
{
return (_element != NULL);
};
// Updators
// ********
public: virtual void Progress()
// ****************************
{
if (_element) {
_element = _map->_GetNextElement(_element);
if (!_element) {
unsigned length = _map->_GetLength();
if (_index < length) {
do {
_element = _map->_GetArray()[_index++];
} while (!_element && (_index < length));
}
}
}
};
// Others
// ******
public: virtual string _GetString() const
// **************************************
{
string s = "<" + _TName("IntrusiveMap::Elements::Locator");
if (_map) s += " " + GetString(_map);
s += ">";
return s;
};
};
// Attributes
// **********
private: const IntrusiveMap* _map;
// Constructors
// ************
public: Elements(const IntrusiveMap* map = NULL)
// *********************************************
: Inherit(),
_map(map)
{
};
public: virtual Hurricane::Locator<Element*>* getClone() const
// ***********************************************************
{
return new Locator(*this);
};
// Predicates
// **********
public: virtual bool IsValid() const
// *********************************
{
return (_element != NULL);
};
// Updators
// ********
public: virtual void Progress()
// ****************************
{
if (_element) {
_element = _map->_getNextElement(_element);
if (!_element) {
unsigned length = _map->_getLength();
if (_index < length) {
do {
_element = _map->_getArray()[_index++];
} while (!_element && (_index < length));
}
}
}
};
// Others
// ******
public: virtual string _getString() const
// **************************************
{
string s = "<" + _TName("IntrusiveMap::Elements::Locator");
if (_map) s += " " + getString(_map);
s += ">";
return s;
};
};
// Attributes
// **********
private: const IntrusiveMap* _map;
// Constructors
// ************
public: Elements(const IntrusiveMap* map = NULL)
// *********************************************
: Inherit(),
_map(map)
{
};
public: Elements(const Elements& elements)
// ***************************************
: Inherit(),
_map(elements._map)
{
};
// Operators
// *********
public: Elements& operator=(const Elements& elements)
// **************************************************
{
_map = elements._map;
return *this;
};
// Accessors
// *********
public: virtual Collection<Element*>* GetClone() const
// ***************************************************
{
return new Elements(*this);
};
public: Elements(const Elements& elements)
// ***************************************
: Inherit(),
_map(elements._map)
{
};
// Operators
// *********
public: Elements& operator=(const Elements& elements)
// **************************************************
{
_map = elements._map;
return *this;
};
// Accessors
// *********
public: virtual Collection<Element*>* getClone() const
// ***************************************************
{
return new Elements(*this);
};
public: virtual Hurricane::Locator<Element*>* GetLocator() const
// *************************************************************
{
return new Locator(_map);
};
// Others
// ******
public: virtual string _GetString() const
// **************************************
{
string s = "<" + _TName("IntrusiveMap::Elements");
if (_map) s += " " + GetString(_map);
s += ">";
return s;
};
};
public: virtual Hurricane::Locator<Element*>* getLocator() const
// *************************************************************
{
return new Locator(_map);
};
// Others
// ******
public: virtual string _getString() const
// **************************************
{
string s = "<" + _TName("IntrusiveMap::Elements");
if (_map) s += " " + getString(_map);
s += ">";
return s;
};
};
// Attributes
// **********
private: unsigned _size;
private: unsigned _length;
private: Element** _array;
private: unsigned _size;
private: unsigned _length;
private: Element** _array;
// Constructors
// ************
public: IntrusiveMap()
// *******************
: _size(0),
_length(1),
_array(new Element*[1])
{
_array[0] = NULL;
};
public: IntrusiveMap()
// *******************
: _size(0),
_length(1),
_array(new Element*[1])
{
_array[0] = NULL;
};
private: IntrusiveMap(const IntrusiveMap& map); // not implemented to forbid copy
private: IntrusiveMap(const IntrusiveMap& map); // not implemented to forbid copy
// Destructor
// **********
public: virtual ~IntrusiveMap()
// ****************************
{
for (unsigned index = 0; index < _length; index++) {
Element* element = _array[index];
while (element) {
_array[index] = _GetNextElement(element);
_SetNextElement(element, NULL);
element = _array[index];
}
_array[index] = NULL;
}
delete[] _array;
};
public: virtual ~IntrusiveMap()
// ****************************
{
for (unsigned index = 0; index < _length; index++) {
Element* element = _array[index];
while (element) {
_array[index] = _getNextElement(element);
_SetNextElement(element, NULL);
element = _array[index];
}
_array[index] = NULL;
}
delete[] _array;
};
// Operators
// *********
private: IntrusiveMap& operator=(const IntrusiveMap& map); // not implemented to forbid assignment
private: IntrusiveMap& operator=(const IntrusiveMap& map); // not implemented to forbid assignment
// Accessors
// *********
public: Element* GetElement(Key key) const
// ***************************************
{
unsigned index = (_GetHashValue(key) / 8) % _length;
Element* element = _array[index];
while (element && (_GetKey(element) != key)) element = _GetNextElement(element);
return element;
};
public: Element* getElement(Key key) const
// ***************************************
{
unsigned index = (_getHashValue(key) / 8) % _length;
Element* element = _array[index];
while (element && (_getKey(element) != key)) element = _getNextElement(element);
return element;
};
public: Elements GetElements() const
// *********************************
{
return Elements(this);
};
public: Elements getElements() const
// *********************************
{
return Elements(this);
};
// Predicates
// **********
public: bool IsEmpty() const
// *************************
{
return (_size == 0);
};
public: bool IsEmpty() const
// *************************
{
return (_size == 0);
};
// Overridables
// ************
public: virtual Key _GetKey(Element* element) const = 0;
public: virtual Key _getKey(Element* element) const = 0;
public: virtual unsigned _GetHashValue(Key key) const = 0;
public: virtual unsigned _getHashValue(Key key) const = 0;
// public: virtual Element* _GetNextElement(Element* element) const = 0; // AD
public: virtual Element* _GetNextElement(Element* element) const
// *************************************************************
{
throw Error(_TName("IntrusiveMap") + "::_GetNextElement(...) : should be overrided");
return NULL;
};
// public: virtual Element* _getNextElement(Element* element) const = 0; // AD
public: virtual Element* _getNextElement(Element* element) const
// *************************************************************
{
throw Error(_TName("IntrusiveMap") + "::_getNextElement(...) : should be overrided");
return NULL;
};
// public: virtual void _SetNextElement(Element* element, Element* nextElement) const = 0; // AD
public: virtual void _SetNextElement(Element* element, Element* nextElement) const
// *******************************************************************************
{
throw Error(_TName("IntrusiveMap") + "::_SetNextElement(...) : should be overrided");
};
// public: virtual void _SetNextElement(Element* element, Element* nextElement) const = 0; // AD
public: virtual void _SetNextElement(Element* element, Element* nextElement) const
// *******************************************************************************
{
throw Error(_TName("IntrusiveMap") + "::_SetNextElement(...) : should be overrided");
};
// Others
// ******
public: string _GetTypeName() const
// ********************************
{
public: string _getTypeName() const
// ********************************
{
return _TName("IntrusiveMap");
}
public: string _GetString() const
// ******************************
{
if (IsEmpty())
return "<" + _GetTypeName() + " empty>";
else
return "<" + _GetTypeName() + " " + GetString(_size) + ">";
};
public: string _getString() const
// ******************************
{
if (IsEmpty())
return "<" + _getTypeName() + " empty>";
else
return "<" + _getTypeName() + " " + getString(_size) + ">";
};
public: Record* _GetRecord() const
// *************************
{
Record* record = NULL;
if (!IsEmpty()) {
record = new Record(GetString(this));
unsigned n = 1;
for (unsigned index = 0; index < _length; index++) {
/**/
n = 1;
/**/
Element* element = _array[index];
while (element) {
// record->Add(GetSlot(GetString(n++), element));
record->Add(GetSlot(GetString(index) + ":" + GetString(n++), element));
/**/
element = _GetNextElement(element);
}
}
}
return record;
};
public: Record* _getRecord() const
// *************************
{
Record* record = NULL;
if (!IsEmpty()) {
record = new Record(getString(this));
unsigned n = 1;
for (unsigned index = 0; index < _length; index++) {
/**/
n = 1;
/**/
Element* element = _array[index];
while (element) {
// record->Add(getSlot(getString(n++), element));
record->Add(getSlot(getString(index) + ":" + getString(n++), element));
/**/
element = _getNextElement(element);
}
}
}
return record;
};
public: unsigned _GetSize() const
// ******************************
{
return _size;
};
public: unsigned _getSize() const
// ******************************
{
return _size;
};
public: unsigned _GetLength() const
// ********************************
{
return _length;
};
public: unsigned _getLength() const
// ********************************
{
return _length;
};
public: Element** _GetArray() const
// ********************************
{
return _array;
};
public: Element** _getArray() const
// ********************************
{
return _array;
};
public: bool _Contains(Element* element) const
// *******************************************
{
unsigned index = (_GetHashValue(_GetKey(element)) / 8) % _length;
Element* currentElement = _array[index];
while (currentElement && (currentElement != element))
currentElement = _GetNextElement(currentElement);
return (currentElement != NULL);
};
public: bool _Contains(Element* element) const
// *******************************************
{
unsigned index = (_getHashValue(_getKey(element)) / 8) % _length;
Element* currentElement = _array[index];
while (currentElement && (currentElement != element))
currentElement = _getNextElement(currentElement);
return (currentElement != NULL);
};
public: void _Insert(Element* element)
// ***********************************
{
if (!_Contains(element)) {
unsigned index = (_GetHashValue(_GetKey(element)) / 8) % _length;
_SetNextElement(element, _array[index]);
_array[index] = element;
_size++;
_Resize();
}
};
public: void _Insert(Element* element)
// ***********************************
{
if (!_Contains(element)) {
unsigned index = (_getHashValue(_getKey(element)) / 8) % _length;
_SetNextElement(element, _array[index]);
_array[index] = element;
_size++;
_Resize();
}
};
public: void _Remove(Element* element)
// ***********************************
{
if (_Contains(element)) {
unsigned index = (_GetHashValue(_GetKey(element)) / 8) % _length;
Element* currentElement = _array[index];
if (currentElement) {
if (currentElement == element) {
_array[index] = _GetNextElement(element);
_SetNextElement(element, NULL);
_size--;
}
else {
while (_GetNextElement(currentElement) && (_GetNextElement(currentElement) != element))
currentElement = _GetNextElement(currentElement);
if (currentElement && (_GetNextElement(currentElement) == element)) {
_SetNextElement(currentElement, _GetNextElement(element));
_SetNextElement(element, NULL);
_size--;
}
}
}
}
};
public: void _Remove(Element* element)
// ***********************************
{
if (_Contains(element)) {
unsigned index = (_getHashValue(_getKey(element)) / 8) % _length;
Element* currentElement = _array[index];
if (currentElement) {
if (currentElement == element) {
_array[index] = _getNextElement(element);
_SetNextElement(element, NULL);
_size--;
}
else {
while (_getNextElement(currentElement) && (_getNextElement(currentElement) != element))
currentElement = _getNextElement(currentElement);
if (currentElement && (_getNextElement(currentElement) == element)) {
_SetNextElement(currentElement, _getNextElement(element));
_SetNextElement(element, NULL);
_size--;
}
}
}
}
};
public: void _Resize()
// *******************
{
unsigned newLength = _length;
double ratio = (double)_size / (double)_length;
if (ratio < 3)
newLength = max(_size / 8, (unsigned)1);
else if (10 < ratio)
newLength = min(_size / 5, (unsigned)512);
public: void _Resize()
// *******************
{
unsigned newLength = _length;
double ratio = (double)_size / (double)_length;
if (ratio < 3)
newLength = max(_size / 8, (unsigned)1);
else if (10 < ratio)
newLength = min(_size / 5, (unsigned)512);
if (newLength != _length) {
// cerr << "Resizing: " << this << " " << _length << " " << newLength << endl;
unsigned oldLength = _length;
Element** oldArray = _array;
_length = newLength;
_array = new Element*[_length];
memset(_array, 0, _length * sizeof(Element*));
for (unsigned index = 0; index < oldLength; index++) {
Element* element = oldArray[index];
while (element) {
Element* nextElement = _GetNextElement(element);
unsigned newIndex = (_GetHashValue(_GetKey(element)) / 8) % _length;
_SetNextElement(element, _array[newIndex]);
_array[newIndex] = element;
element = nextElement;
}
}
delete[] oldArray;
}
};
if (newLength != _length) {
// cerr << "Resizing: " << this << " " << _length << " " << newLength << endl;
unsigned oldLength = _length;
Element** oldArray = _array;
_length = newLength;
_array = new Element*[_length];
memset(_array, 0, _length * sizeof(Element*));
for (unsigned index = 0; index < oldLength; index++) {
Element* element = oldArray[index];
while (element) {
Element* nextElement = _getNextElement(element);
unsigned newIndex = (_getHashValue(_getKey(element)) / 8) % _length;
_SetNextElement(element, _array[newIndex]);
_array[newIndex] = element;
element = nextElement;
}
}
delete[] oldArray;
}
};
};

View File

@ -26,436 +26,436 @@ template<class Element> class IntrusiveSet : public NestedSlotAdapter {
// Types
// *****
class Elements : public Collection<Element*> {
// *****************************************
// Types
// *****
public: typedef Collection<Element*> Inherit;
public: class Locator : public Hurricane::Locator<Element*> {
// ********************************************************
// Types
// *****
public: typedef Hurricane::Locator<Element*> Inherit;
// Attributes
// **********
private: const IntrusiveSet* _set;
private: unsigned _index;
private: Element* _element;
// Constructors
// ************
public: Locator(const IntrusiveSet* set = NULL)
// ********************************************
: Inherit(),
_set(set),
_index(0),
_element(NULL)
{
if (_set) {
unsigned length = _set->_GetLength();
do {
_element = _set->_GetArray()[_index++];
} while (!_element && (_index < length));
}
};
class Elements : public Collection<Element*> {
// *****************************************
// Types
// *****
public: typedef Collection<Element*> Inherit;
public: class Locator : public Hurricane::Locator<Element*> {
// ********************************************************
// Types
// *****
public: typedef Hurricane::Locator<Element*> Inherit;
// Attributes
// **********
private: const IntrusiveSet* _set;
private: unsigned _index;
private: Element* _element;
// Constructors
// ************
public: Locator(const IntrusiveSet* set = NULL)
// ********************************************
: Inherit(),
_set(set),
_index(0),
_element(NULL)
{
if (_set) {
unsigned length = _set->_getLength();
do {
_element = _set->_getArray()[_index++];
} while (!_element && (_index < length));
}
};
public: Locator(const Locator& locator)
// ************************************
: Inherit(),
_set(locator._set),
_index(locator._index),
_element(locator._element)
{
};
// Operators
// *********
public: Locator& operator=(const Locator& locator)
// ***********************************************
{
_set = locator._set;
_index = locator._index;
_element = locator._element;
return *this;
};
// Accessors
// *********
public: virtual Element* GetElement() const
// ****************************************
{
return _element;
};
public: Locator(const Locator& locator)
// ************************************
: Inherit(),
_set(locator._set),
_index(locator._index),
_element(locator._element)
{
};
// Operators
// *********
public: Locator& operator=(const Locator& locator)
// ***********************************************
{
_set = locator._set;
_index = locator._index;
_element = locator._element;
return *this;
};
// Accessors
// *********
public: virtual Element* getElement() const
// ****************************************
{
return _element;
};
public: virtual Hurricane::Locator<Element*>* GetClone() const
// ***********************************************************
{
return new Locator(_set);
};
// Predicates
// **********
public: virtual bool IsValid() const
// *********************************
{
return (_element != NULL);
};
// Updators
// ********
public: virtual void Progress()
// ****************************
{
if (_element) {
_element = _set->_GetNextElement(_element);
if (!_element) {
unsigned length = _set->_GetLength();
if (_index < length) {
do {
_element = _set->_GetArray()[_index++];
} while (!_element && (_index < length));
}
}
}
};
// Others
// ******
public: virtual string _GetTypeName() const
public: virtual Hurricane::Locator<Element*>* getClone() const
// ***********************************************************
{
return new Locator(_set);
};
// Predicates
// **********
public: virtual bool IsValid() const
// *********************************
{
return (_element != NULL);
};
// Updators
// ********
public: virtual void Progress()
// ****************************
{
if (_element) {
_element = _set->_getNextElement(_element);
if (!_element) {
unsigned length = _set->_getLength();
if (_index < length) {
do {
_element = _set->_getArray()[_index++];
} while (!_element && (_index < length));
}
}
}
};
// Others
// ******
public: virtual string _getTypeName() const
// ****************************************
{
return _TName("IntrusiveSet::Elements::Locator");
};
public: virtual string _GetString() const
// **************************************
{
string s = "<" + _GetTypeName();
if (_set) s += " " + GetString(_set);
s += ">";
return s;
};
};
// Attributes
// **********
private: const IntrusiveSet* _set;
// Constructors
// ************
public: Elements(const IntrusiveSet* set = NULL)
// *********************************************
: Inherit(),
_set(set)
{
};
public: virtual string _getString() const
// **************************************
{
string s = "<" + _getTypeName();
if (_set) s += " " + getString(_set);
s += ">";
return s;
};
};
// Attributes
// **********
private: const IntrusiveSet* _set;
// Constructors
// ************
public: Elements(const IntrusiveSet* set = NULL)
// *********************************************
: Inherit(),
_set(set)
{
};
public: Elements(const Elements& elements)
// ***************************************
: Inherit(),
_set(elements._set)
{
};
// Operators
// *********
public: Elements& operator=(const Elements& elements)
// **************************************************
{
_set = elements._set;
return *this;
};
// Accessors
// *********
public: virtual Collection<Element*>* GetClone() const
// ***************************************************
{
return new Elements(*this);
};
public: Elements(const Elements& elements)
// ***************************************
: Inherit(),
_set(elements._set)
{
};
// Operators
// *********
public: Elements& operator=(const Elements& elements)
// **************************************************
{
_set = elements._set;
return *this;
};
// Accessors
// *********
public: virtual Collection<Element*>* getClone() const
// ***************************************************
{
return new Elements(*this);
};
public: virtual Hurricane::Locator<Element*>* GetLocator() const
// *************************************************************
{
return new Locator(_set);
};
// Others
// ******
public: virtual Hurricane::Locator<Element*>* getLocator() const
// *************************************************************
{
return new Locator(_set);
};
// Others
// ******
public: virtual string _GetTypeName() const
// **************************************
public: virtual string _getTypeName() const
// **************************************
{
return _TName("IntrusiveSet::Elements");
};
public: virtual string _GetString() const
// **************************************
{
string s = "<" + _GetTypeName();
if (_set) s += " " + GetString(_set);
s += ">";
return s;
};
};
public: virtual string _getString() const
// **************************************
{
string s = "<" + _getTypeName();
if (_set) s += " " + getString(_set);
s += ">";
return s;
};
};
// Attributes
// **********
private: unsigned _size;
private: unsigned _length;
private: Element** _array;
private: unsigned _size;
private: unsigned _length;
private: Element** _array;
// Constructors
// ************
public: IntrusiveSet()
// *******************
: _size(0),
_length(1),
_array(new Element*[1])
{
_array[0] = NULL;
};
public: IntrusiveSet()
// *******************
: _size(0),
_length(1),
_array(new Element*[1])
{
_array[0] = NULL;
};
private: IntrusiveSet(const IntrusiveSet& set); // not implemented to forbid copy
private: IntrusiveSet(const IntrusiveSet& set); // not implemented to forbid copy
// Destructor
// **********
public: virtual ~IntrusiveSet()
// ****************************
{
for (unsigned index = 0; index < _length; index++) {
Element* element = _array[index];
while (element) {
_array[index] = _GetNextElement(element);
_SetNextElement(element, NULL);
element = _array[index];
}
_array[index] = NULL;
}
delete[] _array;
};
public: virtual ~IntrusiveSet()
// ****************************
{
for (unsigned index = 0; index < _length; index++) {
Element* element = _array[index];
while (element) {
_array[index] = _getNextElement(element);
_SetNextElement(element, NULL);
element = _array[index];
}
_array[index] = NULL;
}
delete[] _array;
};
// Operators
// *********
private: IntrusiveSet& operator=(const IntrusiveSet& set); // not implemented to forbid assignment
private: IntrusiveSet& operator=(const IntrusiveSet& set); // not implemented to forbid assignment
// Accessors
// *********
public: Elements GetElements() const
// *********************************
{
return Elements(this);
};
public: Elements getElements() const
// *********************************
{
return Elements(this);
};
// Predicates
// **********
public: bool IsEmpty() const
// *************************
{
return (_size == 0);
};
public: bool IsEmpty() const
// *************************
{
return (_size == 0);
};
// Overridables
// ************
public: virtual unsigned _GetHashValue(Element* element) const = 0;
public: virtual unsigned _getHashValue(Element* element) const = 0;
// public: virtual Element* _GetNextElement(Element* element) const = 0; // AD
public: virtual Element* _GetNextElement(Element* element) const
// *************************************************************
{
throw Error(_TName("IntrusiveSet") + "::_GetNextElement(...) : should be overrided");
return NULL;
};
// public: virtual Element* _getNextElement(Element* element) const = 0; // AD
public: virtual Element* _getNextElement(Element* element) const
// *************************************************************
{
throw Error(_TName("IntrusiveSet") + "::_getNextElement(...) : should be overrided");
return NULL;
};
// public: virtual void _SetNextElement(Element* element, Element* nextElement) const = 0; // AD
public: virtual void _SetNextElement(Element* element, Element* nextElement) const
// *******************************************************************************
{
throw Error(_TName("IntrusiveSet") + "::_SetNextElement(...) : should be overrided");
};
// public: virtual void _SetNextElement(Element* element, Element* nextElement) const = 0; // AD
public: virtual void _SetNextElement(Element* element, Element* nextElement) const
// *******************************************************************************
{
throw Error(_TName("IntrusiveSet") + "::_SetNextElement(...) : should be overrided");
};
// Others
// ******
public: virtual string _GetTypeName() const
// **************************************
public: virtual string _getTypeName() const
// **************************************
{
return _TName("InstrusiveSet");
};
public: string _GetString() const
// ******************************
{
if (IsEmpty())
return "<" + _GetTypeName() + " empty>";
else
return "<" + _GetTypeName() + " " + GetString(_size) + ">";
};
public: string _getString() const
// ******************************
{
if (IsEmpty())
return "<" + _getTypeName() + " empty>";
else
return "<" + _getTypeName() + " " + getString(_size) + ">";
};
public: Record* _GetRecord() const
// *************************
{
Record* record = NULL;
if (!IsEmpty()) {
record = new Record(GetString(this));
unsigned n = 1;
for (unsigned index = 0; index < _length; index++) {
/**/
n = 1;
/**/
Element* element = _array[index];
while (element) {
// record->Add(GetSlot(GetString(n++), element));
record->Add(GetSlot(GetString(index) + ":" + GetString(n++), element));
/**/
element = _GetNextElement(element);
}
}
}
return record;
};
public: Record* _getRecord() const
// *************************
{
Record* record = NULL;
if (!IsEmpty()) {
record = new Record(getString(this));
unsigned n = 1;
for (unsigned index = 0; index < _length; index++) {
/**/
n = 1;
/**/
Element* element = _array[index];
while (element) {
// record->Add(getSlot(getString(n++), element));
record->Add(getSlot(getString(index) + ":" + getString(n++), element));
/**/
element = _getNextElement(element);
}
}
}
return record;
};
public: unsigned _GetSize() const
// ******************************
{
return _size;
};
public: unsigned _getSize() const
// ******************************
{
return _size;
};
public: unsigned _GetLength() const
// ********************************
{
return _length;
};
public: unsigned _getLength() const
// ********************************
{
return _length;
};
public: Element** _GetArray() const
// ********************************
{
return _array;
};
public: Element** _getArray() const
// ********************************
{
return _array;
};
public: bool _Contains(Element* element) const
// *******************************************
{
unsigned index = (_GetHashValue(element) / 8) % _length;
Element* currentElement = _array[index];
while (currentElement && (currentElement != element))
currentElement = _GetNextElement(currentElement);
return (currentElement != NULL);
};
public: bool _Contains(Element* element) const
// *******************************************
{
unsigned index = (_getHashValue(element) / 8) % _length;
Element* currentElement = _array[index];
while (currentElement && (currentElement != element))
currentElement = _getNextElement(currentElement);
return (currentElement != NULL);
};
public: void _Insert(Element* element)
// ***********************************
{
if (!_Contains(element)) {
unsigned index = (_GetHashValue(element) / 8) % _length;
_SetNextElement(element, _array[index]);
_array[index] = element;
_size++;
_Resize();
}
};
public: void _Insert(Element* element)
// ***********************************
{
if (!_Contains(element)) {
unsigned index = (_getHashValue(element) / 8) % _length;
_SetNextElement(element, _array[index]);
_array[index] = element;
_size++;
_Resize();
}
};
public: void _Remove(Element* element)
// ***********************************
{
if (_Contains(element)) {
unsigned index = (_GetHashValue(element) / 8) % _length;
Element* currentElement = _array[index];
if (currentElement) {
if (currentElement == element) {
_array[index] = _GetNextElement(element);
_SetNextElement(element, NULL);
_size--;
}
else {
while (_GetNextElement(currentElement) && (_GetNextElement(currentElement) != element))
currentElement = _GetNextElement(currentElement);
if (currentElement && (_GetNextElement(currentElement) == element)) {
_SetNextElement(currentElement, _GetNextElement(element));
_SetNextElement(element, NULL);
_size--;
}
}
}
}
};
public: void _Remove(Element* element)
// ***********************************
{
if (_Contains(element)) {
unsigned index = (_getHashValue(element) / 8) % _length;
Element* currentElement = _array[index];
if (currentElement) {
if (currentElement == element) {
_array[index] = _getNextElement(element);
_SetNextElement(element, NULL);
_size--;
}
else {
while (_getNextElement(currentElement) && (_getNextElement(currentElement) != element))
currentElement = _getNextElement(currentElement);
if (currentElement && (_getNextElement(currentElement) == element)) {
_SetNextElement(currentElement, _getNextElement(element));
_SetNextElement(element, NULL);
_size--;
}
}
}
}
};
public: void _Resize()
// *******************
{
unsigned newLength = _length;
double ratio = (double)_size / (double)_length;
if (ratio < 3)
newLength = max(_size / 8, (unsigned)1);
else if (10 < ratio)
newLength = min(_size / 5, (unsigned)512);
public: void _Resize()
// *******************
{
unsigned newLength = _length;
double ratio = (double)_size / (double)_length;
if (ratio < 3)
newLength = max(_size / 8, (unsigned)1);
else if (10 < ratio)
newLength = min(_size / 5, (unsigned)512);
if (newLength != _length) {
// cerr << "Resizing: " << this << " " << _length << " " << newLength << endl;
unsigned oldLength = _length;
Element** oldArray = _array;
_length = newLength;
_array = new Element*[_length];
memset(_array, 0, _length * sizeof(Element*));
for (unsigned index = 0; index < oldLength; index++) {
Element* element = oldArray[index];
while (element) {
Element* nextElement = _GetNextElement(element);
unsigned newIndex = (_GetHashValue(element) / 8) % _length;
_SetNextElement(element, _array[newIndex]);
_array[newIndex] = element;
element = nextElement;
}
}
delete[] oldArray;
}
};
if (newLength != _length) {
// cerr << "Resizing: " << this << " " << _length << " " << newLength << endl;
unsigned oldLength = _length;
Element** oldArray = _array;
_length = newLength;
_array = new Element*[_length];
memset(_array, 0, _length * sizeof(Element*));
for (unsigned index = 0; index < oldLength; index++) {
Element* element = oldArray[index];
while (element) {
Element* nextElement = _getNextElement(element);
unsigned newIndex = (_getHashValue(element) / 8) % _length;
_SetNextElement(element, _array[newIndex]);
_array[newIndex] = element;
element = nextElement;
}
}
delete[] oldArray;
}
};
public: void _Clear()
// ******************
{
for (unsigned index = 0; index < _length; index++) {
Element* element = _array[index];
while (element) {
_array[index] = _GetNextElement(element);
_SetNextElement(element, NULL);
element = _array[index];
}
_array[index] = NULL;
}
delete[] _array;
public: void _Clear()
// ******************
{
for (unsigned index = 0; index < _length; index++) {
Element* element = _array[index];
while (element) {
_array[index] = _getNextElement(element);
_SetNextElement(element, NULL);
element = _array[index];
}
_array[index] = NULL;
}
delete[] _array;
_size = 0;
_length = 1;
_array = new Element*[1];
_array[0] = NULL;
};
_size = 0;
_length = 1;
_array = new Element*[1];
_array[0] = NULL;
};
};

View File

@ -34,8 +34,8 @@ Layer::Layer(Technology* technology, const Name& name, const Unit& minimalSize,
if (_name.IsEmpty())
throw Error("Can't create " + _TName("Layer") + " : empty name");
if (_technology->GetLayer(_name))
throw Error("Can't create " + _TName("Layer") + " " + GetString(_name) + " : already exists");
if (_technology->getLayer(_name))
throw Error("Can't create " + _TName("Layer") + " " + getString(_name) + " : already exists");
}
bool Layer::contains(const Layer* layer) const
@ -57,12 +57,12 @@ void Layer::setName(const Name& name)
if (name.IsEmpty())
throw Error("Can't change layer name : empty name");
if (_technology->GetLayer(name))
if (_technology->getLayer(name))
throw Error("Can't change layer name : already exists");
_technology->_GetLayerMap()._Remove(this);
_technology->_getLayerMap()._Remove(this);
_name = name;
_technology->_GetLayerMap()._Insert(this);
_technology->_getLayerMap()._Insert(this);
}
}
@ -84,44 +84,44 @@ void Layer::setPitch(const Unit& pitch)
_pitch = pitch;
}
void Layer::_PostCreate()
void Layer::_postCreate()
// **********************
{
_technology->_GetLayerMap()._Insert(this);
_technology->_GetLayerList().push_back(this);
_technology->_getLayerMap()._Insert(this);
_technology->_getLayerList().push_back(this);
Inherit::_PostCreate();
Inherit::_postCreate();
}
void Layer::_PreDelete()
void Layer::_preDestroy()
// *********************
{
Inherit::_PreDelete();
Inherit::_preDestroy();
_technology->_GetLayerList().remove(this);
_technology->_GetLayerMap()._Remove(this);
_technology->_getLayerList().remove(this);
_technology->_getLayerMap()._Remove(this);
}
string Layer::_GetString() const
string Layer::_getString() const
// *****************************
{
string s = Inherit::_GetString();
s.insert(s.length() - 1, " " + GetString(_name));
string s = Inherit::_getString();
s.insert(s.length() - 1, " " + getString(_name));
return s;
}
Record* Layer::_GetRecord() const
Record* Layer::_getRecord() const
// ************************
{
Record* record = Inherit::_GetRecord();
Record* record = Inherit::_getRecord();
if (record) {
record->Add(GetSlot("Technology", _technology));
record->Add(GetSlot("Name", &_name));
record->Add(GetSlot("Mask", &_mask));
record->Add(GetSlot("ExtractMask", &_extractMask));
record->Add(GetSlot("MinimalSize", &_minimalSize));
record->Add(GetSlot("MinimalSpacing", &_minimalSpacing));
record->Add(GetSlot("Pitch", &_pitch));
record->Add(getSlot("Technology", _technology));
record->Add(getSlot("Name", &_name));
record->Add(getSlot("Mask", &_mask));
record->Add(getSlot("ExtractMask", &_extractMask));
record->Add(getSlot("MinimalSize", &_minimalSize));
record->Add(getSlot("MinimalSpacing", &_minimalSpacing));
record->Add(getSlot("Pitch", &_pitch));
}
return record;
}

View File

@ -78,12 +78,12 @@ class Layer : public DBo {
// Others
// ******
protected: virtual void _PostCreate();
protected: virtual void _postCreate();
protected: virtual void _PreDelete();
protected: virtual void _preDestroy();
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: virtual string _getString() const;
public: virtual Record* _getRecord() const;
public: virtual BasicLayer* _getSymbolicBasicLayer() = 0;
public: Layer* _getNextOfTechnologyLayerMap() const {return _nextOfTechnologyLayerMap;};

View File

@ -46,10 +46,10 @@ typedef GenericFilter<Layer*> LayerFilter;
#define for_each_layer(layer, layers)\
/************************************/\
{\
LayerLocator _locator = layers.GetLocator();\
while (_locator.IsValid()) {\
Layer* layer = _locator.GetElement();\
_locator.Progress();
LayerLocator _locator = layers.getLocator();\
while (_locator.IsValid()) {\
Layer* layer = _locator.getElement();\
_locator.Progress();

View File

@ -46,10 +46,10 @@ typedef GenericFilter<Library*> LibraryFilter;
#define for_each_library(library, libraries)\
/*******************************************/\
{\
LibraryLocator _locator = libraries.GetLocator();\
while (_locator.IsValid()) {\
Library* library = _locator.GetElement();\
_locator.Progress();
LibraryLocator _locator = libraries.getLocator();\
while (_locator.IsValid()) {\
Library* library = _locator.getElement();\
_locator.Progress();

View File

@ -20,115 +20,115 @@ namespace Hurricane {
Library::Library(DataBase* dataBase, Library* library, const Name& name)
// *********************************************************************
: Inherit(),
_dataBase(dataBase),
_library(library),
_name(name),
_libraryMap(),
_cellMap(),
_nextOfLibraryLibraryMap(NULL)
: Inherit(),
_dataBase(dataBase),
_library(library),
_name(name),
_libraryMap(),
_cellMap(),
_nextOfLibraryLibraryMap(NULL)
{
if (!_dataBase)
throw Error("Can't create " + _TName("Library") + " : null data base");
if (!_dataBase)
throw Error("Can't create " + _TName("Library") + " : null data base");
if (name.IsEmpty())
throw Error("Can't create " + _TName("Library") + " : empty name");
if (name.IsEmpty())
throw Error("Can't create " + _TName("Library") + " : empty name");
if (!_library) {
if (_dataBase->GetRootLibrary())
throw Error("Can't create " + _TName("Library") + " : root library already exists");
}
else {
if (_library->GetLibrary(_name))
throw Error("Can't create " + _TName("Library") + " : already exists");
}
if (!_library) {
if (_dataBase->getRootLibrary())
throw Error("Can't create " + _TName("Library") + " : root library already exists");
}
else {
if (_library->getLibrary(_name))
throw Error("Can't create " + _TName("Library") + " : already exists");
}
}
Library* Library::Create(DataBase* dataBase, const Name& name)
// ***********************************************************
{
Library* library = new Library(dataBase, NULL, name);
Library* library = new Library(dataBase, NULL, name);
library->_PostCreate();
library->_postCreate();
return library;
return library;
}
Library* Library::Create(Library* library, const Name& name)
// *********************************************************
{
if (!library)
throw Error("Can't create " + _TName("Library") + " : null library");
if (!library)
throw Error("Can't create " + _TName("Library") + " : null library");
library = new Library(library->GetDataBase(), library, name);
library = new Library(library->getDataBase(), library, name);
library->_PostCreate();
library->_postCreate();
return library;
return library;
}
void Library::SetName(const Name& name)
// ************************************
{
if (name != _name) {
if (name.IsEmpty())
throw Error("Can't change library name : empty name");
if (name != _name) {
if (name.IsEmpty())
throw Error("Can't change library name : empty name");
if (_library && _library->GetLibrary(name))
throw Error("Can't change library name : already exists");
if (_library && _library->getLibrary(name))
throw Error("Can't change library name : already exists");
if (_library) _library->_GetLibraryMap()._Remove(this);
_name = name;
if (_library) _library->_GetLibraryMap()._Insert(this);
}
if (_library) _library->_getLibraryMap()._Remove(this);
_name = name;
if (_library) _library->_getLibraryMap()._Insert(this);
}
}
void Library::_PostCreate()
void Library::_postCreate()
// ************************
{
if (!_library)
_dataBase->_SetRootLibrary(this);
else
_library->_GetLibraryMap()._Insert(this);
if (!_library)
_dataBase->_SetRootLibrary(this);
else
_library->_getLibraryMap()._Insert(this);
Inherit::_PostCreate();
Inherit::_postCreate();
}
void Library::_PreDelete()
void Library::_preDestroy()
// ***********************
{
Inherit::_PreDelete();
Inherit::_preDestroy();
for_each_cell(cell, GetCells()) cell->Delete(); end_for;
for_each_library(library, GetLibraries()) library->Delete(); end_for;
for_each_cell(cell, getCells()) cell->destroy(); end_for;
for_each_library(library, getLibraries()) library->destroy(); end_for;
if (!_library)
_dataBase->_SetRootLibrary(NULL);
else
_library->_GetLibraryMap()._Remove(this);
if (!_library)
_dataBase->_SetRootLibrary(NULL);
else
_library->_getLibraryMap()._Remove(this);
}
string Library::_GetString() const
string Library::_getString() const
// *******************************
{
string s = Inherit::_GetString();
s.insert(s.length() - 1, " ");
s.insert(s.length() - 1, GetString(_name));
return s;
string s = Inherit::_getString();
s.insert(s.length() - 1, " ");
s.insert(s.length() - 1, getString(_name));
return s;
}
Record* Library::_GetRecord() const
Record* Library::_getRecord() const
// **************************
{
Record* record = Inherit::_GetRecord();
if (record) {
record->Add(GetSlot("DataBase", _dataBase));
record->Add(GetSlot("Library", _library));
record->Add(GetSlot("Name", &_name));
record->Add(GetSlot("Libraries", &_libraryMap));
record->Add(GetSlot("Cells", &_cellMap));
}
return record;
Record* record = Inherit::_getRecord();
if (record) {
record->Add(getSlot("DataBase", _dataBase));
record->Add(getSlot("Library", _library));
record->Add(getSlot("Name", &_name));
record->Add(getSlot("Libraries", &_libraryMap));
record->Add(getSlot("Cells", &_cellMap));
}
return record;
}
// ****************************************************************************************************
@ -137,32 +137,32 @@ Record* Library::_GetRecord() const
Library::LibraryMap::LibraryMap()
// ******************************
: Inherit()
: Inherit()
{
}
Name Library::LibraryMap::_GetKey(Library* library) const
Name Library::LibraryMap::_getKey(Library* library) const
// ******************************************************
{
return library->GetName();
return library->getName();
}
unsigned Library::LibraryMap::_GetHashValue(Name name) const
unsigned Library::LibraryMap::_getHashValue(Name name) const
// *********************************************************
{
return ( (unsigned int)( (unsigned long)name._GetSharedName() ) ) / 8;
return ( (unsigned int)( (unsigned long)name._getSharedName() ) ) / 8;
}
Library* Library::LibraryMap::_GetNextElement(Library* library) const
Library* Library::LibraryMap::_getNextElement(Library* library) const
// ******************************************************************
{
return library->_GetNextOfLibraryLibraryMap();
return library->_getNextOfLibraryLibraryMap();
}
void Library::LibraryMap::_SetNextElement(Library* library, Library* nextLibrary) const
// ************************************************************************************
{
library->_SetNextOfLibraryLibraryMap(nextLibrary);
library->_SetNextOfLibraryLibraryMap(nextLibrary);
};
@ -173,32 +173,32 @@ void Library::LibraryMap::_SetNextElement(Library* library, Library* nextLibrary
Library::CellMap::CellMap()
// ************************
: Inherit()
: Inherit()
{
}
Name Library::CellMap::_GetKey(Cell* cell) const
Name Library::CellMap::_getKey(Cell* cell) const
// *********************************************
{
return cell->GetName();
return cell->getName();
}
unsigned Library::CellMap::_GetHashValue(Name name) const
unsigned Library::CellMap::_getHashValue(Name name) const
// ******************************************************
{
return ( (unsigned int)( (unsigned long)name._GetSharedName() ) ) / 8;
return ( (unsigned int)( (unsigned long)name._getSharedName() ) ) / 8;
}
Cell* Library::CellMap::_GetNextElement(Cell* cell) const
Cell* Library::CellMap::_getNextElement(Cell* cell) const
// ******************************************************
{
return cell->_GetNextOfLibraryCellMap();
return cell->_getNextOfLibraryCellMap();
}
void Library::CellMap::_SetNextElement(Cell* cell, Cell* nextCell) const
// *********************************************************************
{
cell->_SetNextOfLibraryCellMap(nextCell);
cell->_SetNextOfLibraryCellMap(nextCell);
};

View File

@ -28,85 +28,85 @@ class Library : public DBo {
// Types
// *****
public: typedef DBo Inherit;
public: typedef DBo Inherit;
public: class LibraryMap : public IntrusiveMap<Name, Library> {
// **********************************************************
public: class LibraryMap : public IntrusiveMap<Name, Library> {
// **********************************************************
public: typedef IntrusiveMap<Name, Library> Inherit;
public: LibraryMap();
public: typedef IntrusiveMap<Name, Library> Inherit;
public: LibraryMap();
public: virtual Name _GetKey(Library* library) const;
public: virtual unsigned _GetHashValue(Name name) const;
public: virtual Library* _GetNextElement(Library* library) const;
public: virtual void _SetNextElement(Library* library, Library* nextLibrary) const;
public: virtual Name _getKey(Library* library) const;
public: virtual unsigned _getHashValue(Name name) const;
public: virtual Library* _getNextElement(Library* library) const;
public: virtual void _SetNextElement(Library* library, Library* nextLibrary) const;
};
};
public: class CellMap : public IntrusiveMap<Name, Cell> {
// ****************************************************
public: class CellMap : public IntrusiveMap<Name, Cell> {
// ****************************************************
public: typedef IntrusiveMap<Name, Cell> Inherit;
public: CellMap();
public: typedef IntrusiveMap<Name, Cell> Inherit;
public: CellMap();
public: virtual Name _GetKey(Cell* cell) const;
public: virtual unsigned _GetHashValue(Name name) const;
public: virtual Cell* _GetNextElement(Cell* cell) const;
public: virtual void _SetNextElement(Cell* cell, Cell* nextCell) const;
public: virtual Name _getKey(Cell* cell) const;
public: virtual unsigned _getHashValue(Name name) const;
public: virtual Cell* _getNextElement(Cell* cell) const;
public: virtual void _SetNextElement(Cell* cell, Cell* nextCell) const;
};
};
// Attributes
// **********
private: DataBase* _dataBase;
private: Library* _library;
private: Name _name;
private: LibraryMap _libraryMap;
private: CellMap _cellMap;
private: Library* _nextOfLibraryLibraryMap;
private: DataBase* _dataBase;
private: Library* _library;
private: Name _name;
private: LibraryMap _libraryMap;
private: CellMap _cellMap;
private: Library* _nextOfLibraryLibraryMap;
// Constructors
// ************
protected: Library(DataBase* dataBase, Library* library, const Name& name);
protected: Library(DataBase* dataBase, Library* library, const Name& name);
public: static Library* Create(DataBase* dataBase, const Name& name);
public: static Library* Create(Library* library, const Name& name);
public: static Library* Create(DataBase* dataBase, const Name& name);
public: static Library* Create(Library* library, const Name& name);
// Accessors
// *********
public: DataBase* GetDataBase() const {return _dataBase;};
public: Library* GetLibrary() const {return _library;};
public: const Name& GetName() const {return _name;};
public: Library* GetLibrary(const Name& name) const {return _libraryMap.GetElement(name);};
public: Libraries GetLibraries() const {return _libraryMap.GetElements();};
public: Cell* GetCell(const Name& name) const {return _cellMap.GetElement(name);};
public: Cells GetCells() const {return _cellMap.GetElements();};
public: DataBase* getDataBase() const {return _dataBase;};
public: Library* getLibrary() const {return _library;};
public: const Name& getName() const {return _name;};
public: Library* getLibrary(const Name& name) const {return _libraryMap.getElement(name);};
public: Libraries getLibraries() const {return _libraryMap.getElements();};
public: Cell* getCell(const Name& name) const {return _cellMap.getElement(name);};
public: Cells getCells() const {return _cellMap.getElements();};
// Updators
// ********
public: void SetName(const Name& name);
public: void SetName(const Name& name);
// Others
// ******
protected: virtual void _PostCreate();
protected: virtual void _postCreate();
protected: virtual void _PreDelete();
protected: virtual void _preDestroy();
public: virtual string _GetTypeName() const {return _TName("Library");};
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: LibraryMap& _GetLibraryMap() {return _libraryMap;};
public: CellMap& _GetCellMap() {return _cellMap;};
public: Library* _GetNextOfLibraryLibraryMap() const {return _nextOfLibraryLibraryMap;};
public: virtual string _getTypeName() const {return _TName("Library");};
public: virtual string _getString() const;
public: virtual Record* _getRecord() const;
public: LibraryMap& _getLibraryMap() {return _libraryMap;};
public: CellMap& _getCellMap() {return _cellMap;};
public: Library* _getNextOfLibraryLibraryMap() const {return _nextOfLibraryLibraryMap;};
public: void _SetNextOfLibraryLibraryMap(Library* library) {_nextOfLibraryLibraryMap = library;};
public: void _SetNextOfLibraryLibraryMap(Library* library) {_nextOfLibraryLibraryMap = library;};
};

View File

@ -23,151 +23,151 @@ template<class Element> class ListCollection : public Collection<Element> {
// Types
// *****
public: typedef Collection<Element> Inherit;
public: typedef Collection<Element> Inherit;
public: typedef list<Element> ElementList;
public: typedef list<Element> ElementList;
public: class Locator : public Hurricane::Locator<Element> {
// *******************************************************
public: class Locator : public Hurricane::Locator<Element> {
// *******************************************************
public: typedef Hurricane::Locator<Element> Inherit;
public: typedef Hurricane::Locator<Element> Inherit;
private: const ElementList* _elementList;
private: typename ElementList::const_iterator _iterator; // AD
private: const ElementList* _elementList;
private: typename ElementList::const_iterator _iterator; // AD
public: Locator(const ElementList* elementList)
// ********************************************
: Inherit(),
_elementList(elementList),
_iterator()
{
if (_elementList) _iterator = _elementList->begin();
};
public: Locator(const ElementList* elementList)
// ********************************************
: Inherit(),
_elementList(elementList),
_iterator()
{
if (_elementList) _iterator = _elementList->begin();
};
public: virtual Element GetElement() const
// ***************************************
{
return (IsValid()) ? *_iterator : Element();
};
public: virtual Element getElement() const
// ***************************************
{
return (IsValid()) ? *_iterator : Element();
};
public: virtual Hurricane::Locator<Element>* GetClone() const
// **********************************************************
{
return new Locator(_elementList);
};
public: virtual Hurricane::Locator<Element>* getClone() const
// **********************************************************
{
return new Locator(_elementList);
};
public: virtual bool IsValid() const
// *********************************
{
return (_elementList && (_iterator != _elementList->end()));
};
public: virtual bool IsValid() const
// *********************************
{
return (_elementList && (_iterator != _elementList->end()));
};
public: virtual void Progress()
// ****************************
{
++_iterator;
};
public: virtual void Progress()
// ****************************
{
++_iterator;
};
};
};
// Attributes
// **********
private: const ElementList* _elementList;
private: const ElementList* _elementList;
// Constructors
// ************
public: ListCollection(const ElementList* elementList = NULL)
// **********************************************************
: Inherit(),
_elementList(elementList)
{
};
public: ListCollection(const ElementList* elementList = NULL)
// **********************************************************
: Inherit(),
_elementList(elementList)
{
};
public: ListCollection(const ElementList& elementList)
// ***************************************************
: Inherit(),
_elementList(&elementList)
{
};
public: ListCollection(const ElementList& elementList)
// ***************************************************
: Inherit(),
_elementList(&elementList)
{
};
public: ListCollection(const ListCollection& listCollection)
// *********************************************************
: Inherit(),
_elementList(listCollection._elementList)
{
};
public: ListCollection(const ListCollection& listCollection)
// *********************************************************
: Inherit(),
_elementList(listCollection._elementList)
{
};
// Operators
// *********
public: ListCollection& operator=(const ListCollection& listCollection)
// ********************************************************************
{
_elementList = listCollection._elementList;
return *this;
};
public: ListCollection& operator=(const ListCollection& listCollection)
// ********************************************************************
{
_elementList = listCollection._elementList;
return *this;
};
// Accessors
// *********
public: virtual Collection<Element>* GetClone() const
// **************************************************
{
return new ListCollection(*this);
}
public: virtual Collection<Element>* getClone() const
// **************************************************
{
return new ListCollection(*this);
}
public: virtual Hurricane::Locator<Element>* GetLocator() const
// ************************************************************
{
// return (_elementList) ? new Locator<Element>(_elementList) : NULL;
// V3
return (_elementList) ? new Locator(_elementList) : NULL;
}
public: virtual Hurricane::Locator<Element>* getLocator() const
// ************************************************************
{
// return (_elementList) ? new Locator<Element>(_elementList) : NULL;
// V3
return (_elementList) ? new Locator(_elementList) : NULL;
}
public: virtual unsigned GetSize() const
// *************************************
{
return (_elementList) ? _elementList->size() : 0;
};
public: virtual unsigned getSize() const
// *************************************
{
return (_elementList) ? _elementList->size() : 0;
};
// Others
// ******
public: virtual string _GetTypeName() const
// **************************************
public: virtual string _getTypeName() const
// **************************************
{
return _TName("ListCollection");
};
public: virtual string _GetString() const
// **************************************
{
if (!_elementList)
return "<" + _GetTypeName() + " unbound>";
else {
if (_elementList->empty())
return "<" + _GetTypeName() + " empty>";
else
return "<" + _GetTypeName() + " " + GetString(_elementList->size()) + ">";
}
};
public: virtual string _getString() const
// **************************************
{
if (!_elementList)
return "<" + _getTypeName() + " unbound>";
else {
if (_elementList->empty())
return "<" + _getTypeName() + " empty>";
else
return "<" + _getTypeName() + " " + getString(_elementList->size()) + ">";
}
};
public: Record* _GetRecord() const
public: Record* _getRecord() const
// *************************
{
Record* record = NULL;
if (!_elementList->empty()) {
record = new Record(_GetString());
unsigned n = 1;
typename list<Element>::const_iterator iterator = _elementList->begin(); // AD
while (iterator != _elementList->end()) {
string slotName = GetString(n++);
record = new Record(_getString());
unsigned n = 1;
typename list<Element>::const_iterator iterator = _elementList->begin(); // AD
while (iterator != _elementList->end()) {
string slotName = getString(n++);
Element slotObject = *iterator;
record->Add(GetSlot(slotName, slotObject));
record->Add(getSlot(slotName, slotObject));
++iterator;
}
}
}
return record;
}
@ -181,17 +181,17 @@ template<class Element> class ListCollection : public Collection<Element> {
// ****************************************************************************************************
template<class Element>
inline GenericCollection<Element> GetCollection(const list<Element>& elementList)
inline GenericCollection<Element> getCollection(const list<Element>& elementList)
// *********************************************************************************
{
return ListCollection<Element>(elementList);
return ListCollection<Element>(elementList);
}
template<class Element>
inline GenericCollection<Element> GetCollection(const list<Element>* elementList)
inline GenericCollection<Element> getCollection(const list<Element>* elementList)
// *********************************************************************************
{
return ListCollection<Element>(elementList);
return ListCollection<Element>(elementList);
}

View File

@ -24,71 +24,71 @@ template<class Type> class Locator : public NestedSlotAdapter {
// Constructors
// ************
protected: Locator()
// *****************
{
};
protected: Locator()
// *****************
{
};
private: Locator(const Locator& locator);
// *******************************************
// not implemented to forbid copy construction
// *******************************************
private: Locator(const Locator& locator);
// *******************************************
// not implemented to forbid copy construction
// *******************************************
// Destructor
// **********
public: virtual ~Locator()
// ***********************
{
};
public: virtual ~Locator()
// ***********************
{
};
// Operators
// *********
private: Locator& operator=(const Locator& locator);
// *************************************************
// not implemented to forbid assignment
// *************************************************
private: Locator& operator=(const Locator& locator);
// *************************************************
// not implemented to forbid assignment
// *************************************************
// Accessors
// *********
public: virtual Type GetElement() const = 0;
public: virtual Locator<Type>* GetClone() const = 0;
public: virtual Type getElement() const = 0;
public: virtual Locator<Type>* getClone() const = 0;
public: virtual Locator<Type>* GetLocator() // 21-10-2003
// ****************************************
{
return ( this );
}
public: virtual Locator<Type>* getLocator() // 21-10-2003
// ****************************************
{
return ( this );
}
// Predicates
// **********
public: virtual bool IsValid() const = 0;
public: virtual bool IsValid() const = 0;
// Updators
// ********
public: virtual void Progress() = 0;
public: virtual void Progress() = 0;
// Others
// ******
public: virtual string _GetTypeName() const
// **************************************
public: virtual string _getTypeName() const
// **************************************
{
return _TName("Locator");
};
public: virtual string _GetString() const
// **************************************
{
if (!IsValid())
return "<" + _GetTypeName() + " invalid>";
else
return "<" + _GetTypeName() + " " + GetString(GetElement()) + ">";
};
public: virtual string _getString() const
// **************************************
{
if (!IsValid())
return "<" + _getTypeName() + " invalid>";
else
return "<" + _getTypeName() + " " + getString(getElement()) + ">";
};
};
@ -104,141 +104,141 @@ template<class Type> class GenericLocator : public Locator<Type> {
// Types
// *****
public: typedef Locator<Type> Inherit;
public: typedef Locator<Type> Inherit;
// Attributes
// **********
private: Locator<Type>* _locator;
private: Locator<Type>* _locator;
// Constructors
// ************
public: GenericLocator()
// *********************
: Inherit(),
_locator(NULL)
{
};
public: GenericLocator()
// *********************
: Inherit(),
_locator(NULL)
{
};
public: GenericLocator(const Locator<Type>& locator)
// *************************************************
: Inherit(),
_locator(locator.GetClone())
{
};
public: GenericLocator(const Locator<Type>& locator)
// *************************************************
: Inherit(),
_locator(locator.getClone())
{
};
public: GenericLocator(const GenericLocator& genericLocator)
// *********************************************************
: Inherit(),
_locator(genericLocator.GetClone())
{
};
public: GenericLocator(const GenericLocator& genericLocator)
// *********************************************************
: Inherit(),
_locator(genericLocator.getClone())
{
};
public: GenericLocator(Locator<Type>* locator)
// *******************************************************
// CAUTION : locator will be deleted by the GenericLocator
// *******************************************************
: Inherit(),
_locator(locator)
{
};
public: GenericLocator(Locator<Type>* locator)
// *******************************************************
// CAUTION : locator will be deleted by the GenericLocator
// *******************************************************
: Inherit(),
_locator(locator)
{
};
// Destructor
// **********
public: virtual ~GenericLocator()
// ******************************
{
if (_locator) delete _locator;
};
public: virtual ~GenericLocator()
// ******************************
{
if (_locator) delete _locator;
};
// Operators
// *********
public: GenericLocator& operator=(const Locator<Type>& locator)
// ************************************************************
{
if (_locator) delete _locator;
_locator = locator.GetClone();
return *this;
};
public: GenericLocator& operator=(const Locator<Type>& locator)
// ************************************************************
{
if (_locator) delete _locator;
_locator = locator.getClone();
return *this;
};
public: GenericLocator& operator=(const GenericLocator& genericLocator)
// ********************************************************************
{
if (_locator) delete _locator;
_locator = genericLocator.GetClone();
return *this;
};
public: GenericLocator& operator=(const GenericLocator& genericLocator)
// ********************************************************************
{
if (_locator) delete _locator;
_locator = genericLocator.getClone();
return *this;
};
public: GenericLocator& operator=(Locator<Type>* locator)
// *******************************************************
// CAUTION : locator will be deleted by the GenericLocator
// *******************************************************
{
if (_locator) delete _locator;
_locator = locator;
return *this;
};
public: GenericLocator& operator=(Locator<Type>* locator)
// *******************************************************
// CAUTION : locator will be deleted by the GenericLocator
// *******************************************************
{
if (_locator) delete _locator;
_locator = locator;
return *this;
};
// Accessors
// *********
public: virtual Type GetElement() const
// ************************************
{
return ((_locator) ? _locator->GetElement() : Type());
};
public: virtual Type getElement() const
// ************************************
{
return ((_locator) ? _locator->getElement() : Type());
};
public: virtual Locator<Type>* GetClone() const
// ********************************************
{
return ((_locator) ? _locator->GetClone() : NULL);
};
public: virtual Locator<Type>* getClone() const
// ********************************************
{
return ((_locator) ? _locator->getClone() : NULL);
};
public: virtual Locator<Type>* GetLocator() // 21-10-2003
// ****************************************
{
return ( _locator->GetLocator () );
}
public: virtual Locator<Type>* getLocator() // 21-10-2003
// ****************************************
{
return ( _locator->getLocator () );
}
// Predicates
// **********
public: virtual bool IsValid() const
// *********************************
{
return (_locator && _locator->IsValid());
};
public: virtual bool IsValid() const
// *********************************
{
return (_locator && _locator->IsValid());
};
// Updators
// ********
public: virtual void Progress()
// ****************************
{
if (_locator) _locator->Progress();
};
public: virtual void Progress()
// ****************************
{
if (_locator) _locator->Progress();
};
// Others
// ******
public: virtual string _GetTypeName() const
// **************************************
public: virtual string _getTypeName() const
// **************************************
{
return _TName("GenericLocator");
};
public: virtual string _GetString() const
// **************************************
{
if (!_locator)
return "<" + _GetTypeName() + " unbound>";
else
return "<" + _GetTypeName() + " " + GetString(_locator) + ">";
};
public: virtual string _getString() const
// **************************************
{
if (!_locator)
return "<" + _getTypeName() + " unbound>";
else
return "<" + _getTypeName() + " " + getString(_locator) + ">";
};
};

View File

@ -20,66 +20,66 @@ namespace Hurricane {
Marker::Marker(Cell* cell)
// ***********************
: Inherit(),
_cell(cell),
_nextOfCellMarkerSet(NULL)
_cell(cell),
_nextOfCellMarkerSet(NULL)
{
if (!_cell)
throw Error("Can't create " + _TName("Marker") + " : null cell");
if (!_cell)
throw Error("Can't create " + _TName("Marker") + " : null cell");
}
void Marker::Materialize()
// ***********************
{
if (!IsMaterialized()) {
Cell* cell = GetCell();
QuadTree* quadTree = cell->_GetQuadTree();
quadTree->Insert(this);
cell->_Fit(quadTree->GetBoundingBox());
}
if (!IsMaterialized()) {
Cell* cell = getCell();
QuadTree* quadTree = cell->_getQuadTree();
quadTree->Insert(this);
cell->_Fit(quadTree->getBoundingBox());
}
}
void Marker::Unmaterialize()
// *************************
{
if (IsMaterialized()) {
Cell* cell = GetCell();
cell->_Unfit(GetBoundingBox());
cell->_GetQuadTree()->Remove(this);
}
if (IsMaterialized()) {
Cell* cell = getCell();
cell->_Unfit(getBoundingBox());
cell->_getQuadTree()->Remove(this);
}
}
void Marker::_PostCreate()
void Marker::_postCreate()
// ***********************
{
_cell->_GetMarkerSet()._Insert(this);
_cell->_getMarkerSet()._Insert(this);
Inherit::_PostCreate();
Inherit::_postCreate();
}
void Marker::_PreDelete()
void Marker::_preDestroy()
// **********************
{
Inherit::_PreDelete();
Inherit::_preDestroy();
_cell->_GetMarkerSet()._Remove(this);
_cell->_getMarkerSet()._Remove(this);
}
string Marker::_GetString() const
string Marker::_getString() const
// ******************************
{
string s = Inherit::_GetString();
s.insert(s.length() - 1, " " + GetString(_cell->GetName()));
return s;
string s = Inherit::_getString();
s.insert(s.length() - 1, " " + getString(_cell->getName()));
return s;
}
Record* Marker::_GetRecord() const
Record* Marker::_getRecord() const
// *************************
{
Record* record = Inherit::_GetRecord();
if (record) {
record->Add(GetSlot("Cell", _cell));
}
return record;
Record* record = Inherit::_getRecord();
if (record) {
record->Add(getSlot("Cell", _cell));
}
return record;
}

View File

@ -23,44 +23,44 @@ class Marker : public Go {
// Types
// *****
public: typedef Go Inherit;
public: typedef Go Inherit;
// Attributes
// **********
private: Cell* _cell;
private: Marker* _nextOfCellMarkerSet;
private: Cell* _cell;
private: Marker* _nextOfCellMarkerSet;
// Constructors
// ************
protected: Marker(Cell* cell);
protected: Marker(Cell* cell);
// Accessors
// *********
public: virtual Cell* GetCell() const {return _cell;};
public: virtual Box GetBoundingBox() const = 0;
public: virtual Cell* getCell() const {return _cell;};
public: virtual Box getBoundingBox() const = 0;
// Updators
// ********
public: virtual void Materialize();
public: virtual void Unmaterialize();
public: virtual void Materialize();
public: virtual void Unmaterialize();
// Others
// ******
protected: virtual void _PostCreate();
protected: virtual void _postCreate();
protected: virtual void _PreDelete();
protected: virtual void _preDestroy();
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: virtual string _getString() const;
public: virtual Record* _getRecord() const;
public: Marker* _GetNextOfCellMarkerSet() const {return _nextOfCellMarkerSet;};
public: Marker* _getNextOfCellMarkerSet() const {return _nextOfCellMarkerSet;};
public: void _SetNextOfCellMarkerSet(Marker* marker) {_nextOfCellMarkerSet = marker;};
public: void _SetNextOfCellMarkerSet(Marker* marker) {_nextOfCellMarkerSet = marker;};
};

View File

@ -46,10 +46,10 @@ typedef GenericFilter<Marker*> MarkerFilter;
#define for_each_marker(marker, markers)\
/***************************************/\
{\
MarkerLocator _locator = markers.GetLocator();\
while (_locator.IsValid()) {\
Marker* marker = _locator.GetElement();\
_locator.Progress();
MarkerLocator _locator = markers.getLocator();\
while (_locator.IsValid()) {\
Marker* marker = _locator.getElement();\
_locator.Progress();

View File

@ -23,149 +23,149 @@ namespace Hurricane {
// ****************************************************************************************************
template<class Element, class Compare = less<Element> >
class MultisetCollection : public Collection<Element> {
class MultisetCollection : public Collection<Element> {
// ************************************************
// Types
// *****
public: typedef Collection<Element> Inherit;
public: typedef Collection<Element> Inherit;
public: typedef multiset<Element, Compare> ElementMultiset;
public: typedef multiset<Element, Compare> ElementMultiset;
public: class Locator : public Hurricane::Locator<Element> {
// *******************************************************
public: class Locator : public Hurricane::Locator<Element> {
// *******************************************************
public: typedef Hurricane::Locator<Element> Inherit;
public: typedef Hurricane::Locator<Element> Inherit;
private: const ElementMultiset* _elementMultiset;
private: typename ElementMultiset::const_iterator _iterator; // AD
private: const ElementMultiset* _elementMultiset;
private: typename ElementMultiset::const_iterator _iterator; // AD
public: Locator(const ElementMultiset* elementMultiset)
// ******************************************
: Inherit(),
_elementMultiset(elementMultiset),
_iterator()
{
if (_elementMultiset) _iterator = _elementMultiset->begin();
};
public: Locator(const ElementMultiset* elementMultiset)
// ******************************************
: Inherit(),
_elementMultiset(elementMultiset),
_iterator()
{
if (_elementMultiset) _iterator = _elementMultiset->begin();
};
public: virtual Element GetElement() const
// ***************************************
{
return (IsValid()) ? *_iterator : Element();
};
public: virtual Element getElement() const
// ***************************************
{
return (IsValid()) ? *_iterator : Element();
};
public: virtual Hurricane::Locator<Element>* GetClone() const
// **********************************************************
{
return new Locator(_elementMultiset);
};
public: virtual Hurricane::Locator<Element>* getClone() const
// **********************************************************
{
return new Locator(_elementMultiset);
};
public: virtual bool IsValid() const
// *********************************
{
return (_elementMultiset && (_iterator != _elementMultiset->end()));
};
public: virtual bool IsValid() const
// *********************************
{
return (_elementMultiset && (_iterator != _elementMultiset->end()));
};
public: virtual void Progress()
// ****************************
{
++_iterator;
};
public: virtual void Progress()
// ****************************
{
++_iterator;
};
};
};
// Attributes
// **********
private: const ElementMultiset* _elementMultiset;
private: const ElementMultiset* _elementMultiset;
// Constructors
// ************
public: MultisetCollection(const ElementMultiset* elementMultiset = NULL)
// *******************************************************
: Inherit(),
_elementMultiset(elementMultiset)
{
};
public: MultisetCollection(const ElementMultiset* elementMultiset = NULL)
// *******************************************************
: Inherit(),
_elementMultiset(elementMultiset)
{
};
public: MultisetCollection(const ElementMultiset& elementMultiset)
// ************************************************
: Inherit(),
_elementMultiset(&elementMultiset)
{
};
public: MultisetCollection(const ElementMultiset& elementMultiset)
// ************************************************
: Inherit(),
_elementMultiset(&elementMultiset)
{
};
public: MultisetCollection(const MultisetCollection& multisetCollection)
// ******************************************************
: Inherit(),
_elementMultiset(multisetCollection._elementMultiset)
{
};
public: MultisetCollection(const MultisetCollection& multisetCollection)
// ******************************************************
: Inherit(),
_elementMultiset(multisetCollection._elementMultiset)
{
};
// Operators
// *********
public: MultisetCollection& operator=(const MultisetCollection& multisetCollection)
// *****************************************************************
{
_elementMultiset = multisetCollection._elementMultiset;
return *this;
};
public: MultisetCollection& operator=(const MultisetCollection& multisetCollection)
// *****************************************************************
{
_elementMultiset = multisetCollection._elementMultiset;
return *this;
};
// Accessors
// *********
public: virtual Collection<Element>* GetClone() const
// **************************************************
{
return new MultisetCollection(*this);
}
public: virtual Collection<Element>* getClone() const
// **************************************************
{
return new MultisetCollection(*this);
}
public: virtual Hurricane::Locator<Element>* GetLocator() const
// ************************************************************
{
// return (_elementMultiset) ? new Locator<Element, Compare>(_elementMultiset) : NULL;
// V3
return (_elementMultiset) ? new Locator(_elementMultiset) : NULL;
}
public: virtual Hurricane::Locator<Element>* getLocator() const
// ************************************************************
{
// return (_elementMultiset) ? new Locator<Element, Compare>(_elementMultiset) : NULL;
// V3
return (_elementMultiset) ? new Locator(_elementMultiset) : NULL;
}
public: virtual unsigned GetSize() const
// *************************************
{
return (_elementMultiset) ? _elementMultiset->size() : 0;
};
public: virtual unsigned getSize() const
// *************************************
{
return (_elementMultiset) ? _elementMultiset->size() : 0;
};
// Others
// ******
public: virtual string _GetString() const
// **************************************
{
if (!_elementMultiset)
return "<" + _TName("MultisetCollection") + " unbounnd>";
else {
if (_elementMultiset->empty())
return "<" + _TName("MultisetCollection") + " empty>";
else
return "<" + _TName("MultisetCollection") + " " + GetString(_elementMultiset->size()) + ">";
}
};
public: virtual string _getString() const
// **************************************
{
if (!_elementMultiset)
return "<" + _TName("MultisetCollection") + " unbounnd>";
else {
if (_elementMultiset->empty())
return "<" + _TName("MultisetCollection") + " empty>";
else
return "<" + _TName("MultisetCollection") + " " + getString(_elementMultiset->size()) + ">";
}
};
Record* _GetRecord() const
Record* _getRecord() const
// *****************
{
Record* record = NULL;
if (!_elementMultiset->empty()) {
record = new Record(_GetString());
unsigned n = 1;
typename multiset<Element, Compare>::const_iterator iterator = _elementMultiset->begin(); // AD
while (iterator != _elementMultiset->end()) {
record->Add(GetSlot(GetString(n++), *iterator));
record = new Record(_getString());
unsigned n = 1;
typename multiset<Element, Compare>::const_iterator iterator = _elementMultiset->begin(); // AD
while (iterator != _elementMultiset->end()) {
record->Add(getSlot(getString(n++), *iterator));
++iterator;
}
}
}
return record;
}
@ -179,17 +179,17 @@ template<class Element, class Compare = less<Element> >
// ****************************************************************************************************
template<class Element, class Compare>
inline GenericCollection<Element> GetCollection(const multiset<Element, Compare>& elementMultiset)
inline GenericCollection<Element> getCollection(const multiset<Element, Compare>& elementMultiset)
// ****************************************************************************************
{
return MultisetCollection<Element, Compare>(elementMultiset);
return MultisetCollection<Element, Compare>(elementMultiset);
}
template<class Element, class Compare>
inline GenericCollection<Element> GetCollection(const multiset<Element, Compare>* elementMultiset)
inline GenericCollection<Element> getCollection(const multiset<Element, Compare>* elementMultiset)
// ****************************************************************************************
{
return MultisetCollection<Element, Compare>(elementMultiset);
return MultisetCollection<Element, Compare>(elementMultiset);
}

View File

@ -19,153 +19,153 @@ Name::Name()
// *********
: _sharedName(NULL)
{
string s = "";
if (!SharedName::_SHARED_NAME_MAP)
_sharedName = new SharedName(s);
else {
SharedName::SharedNameMap::iterator iterator =
SharedName::_SHARED_NAME_MAP->find(&(string&)s);
if (iterator != SharedName::_SHARED_NAME_MAP->end())
_sharedName = (*iterator).second;
else
_sharedName = new SharedName(s);
}
string s = "";
if (!SharedName::_SHARED_NAME_MAP)
_sharedName = new SharedName(s);
else {
SharedName::SharedNameMap::iterator iterator =
SharedName::_SHARED_NAME_MAP->find(&(string&)s);
if (iterator != SharedName::_SHARED_NAME_MAP->end())
_sharedName = (*iterator).second;
else
_sharedName = new SharedName(s);
}
assert(_sharedName);
assert(_sharedName);
_sharedName->Capture();
_sharedName->Capture();
}
Name::Name(const char* c)
// **********************
: _sharedName(NULL)
{
string s = c;
if (!SharedName::_SHARED_NAME_MAP)
_sharedName = new SharedName(s);
else {
SharedName::SharedNameMap::iterator iterator =
SharedName::_SHARED_NAME_MAP->find(&(string&)s);
if (iterator != SharedName::_SHARED_NAME_MAP->end())
_sharedName = (*iterator).second;
else
_sharedName = new SharedName(s);
}
string s = c;
if (!SharedName::_SHARED_NAME_MAP)
_sharedName = new SharedName(s);
else {
SharedName::SharedNameMap::iterator iterator =
SharedName::_SHARED_NAME_MAP->find(&(string&)s);
if (iterator != SharedName::_SHARED_NAME_MAP->end())
_sharedName = (*iterator).second;
else
_sharedName = new SharedName(s);
}
assert(_sharedName);
assert(_sharedName);
_sharedName->Capture();
_sharedName->Capture();
}
Name::Name(const string& s)
// ************************
: _sharedName(NULL)
{
if (!SharedName::_SHARED_NAME_MAP)
_sharedName = new SharedName(s);
else {
SharedName::SharedNameMap::iterator iterator =
SharedName::_SHARED_NAME_MAP->find(&(string&)s);
if (iterator != SharedName::_SHARED_NAME_MAP->end())
_sharedName = (*iterator).second;
else
_sharedName = new SharedName(s);
}
if (!SharedName::_SHARED_NAME_MAP)
_sharedName = new SharedName(s);
else {
SharedName::SharedNameMap::iterator iterator =
SharedName::_SHARED_NAME_MAP->find(&(string&)s);
if (iterator != SharedName::_SHARED_NAME_MAP->end())
_sharedName = (*iterator).second;
else
_sharedName = new SharedName(s);
}
assert(_sharedName);
assert(_sharedName);
_sharedName->Capture();
_sharedName->Capture();
}
Name::Name(const Name& name)
// *************************
: _sharedName(name._sharedName)
{
_sharedName->Capture();
_sharedName->Capture();
}
Name::~Name()
// **********
{
_sharedName->Release();
_sharedName->Release();
}
Name& Name::operator=(const Name& name)
// ************************************
{
SharedName* sharedName = name._sharedName;
if (sharedName != _sharedName) {
_sharedName->Release();
_sharedName = sharedName;
_sharedName->Capture();
}
return *this;
SharedName* sharedName = name._sharedName;
if (sharedName != _sharedName) {
_sharedName->Release();
_sharedName = sharedName;
_sharedName->Capture();
}
return *this;
}
bool Name::operator==(const Name& name) const
// ******************************************
{
return (_sharedName == name._sharedName);
return (_sharedName == name._sharedName);
}
bool Name::operator!=(const Name& name) const
// ******************************************
{
return (_sharedName != name._sharedName);
return (_sharedName != name._sharedName);
}
bool Name::operator<(const Name& name) const
// *****************************************
{
return ((_sharedName != name._sharedName) &&
(_sharedName->_string < name._sharedName->_string));
return ((_sharedName != name._sharedName) &&
(_sharedName->_string < name._sharedName->_string));
}
bool Name::operator<=(const Name& name) const
// ******************************************
{
return ((_sharedName == name._sharedName) ||
(_sharedName->_string < name._sharedName->_string));
return ((_sharedName == name._sharedName) ||
(_sharedName->_string < name._sharedName->_string));
}
bool Name::operator>(const Name& name) const
// *****************************************
{
return ((_sharedName != name._sharedName) &&
(_sharedName->_string > name._sharedName->_string));
return ((_sharedName != name._sharedName) &&
(_sharedName->_string > name._sharedName->_string));
}
bool Name::operator>=(const Name& name) const
// ******************************************
{
return ((_sharedName == name._sharedName) ||
(_sharedName->_string >= name._sharedName->_string));
return ((_sharedName == name._sharedName) ||
(_sharedName->_string >= name._sharedName->_string));
}
char Name::operator[](unsigned index) const
// ****************************************
{
return _sharedName->_string[index];
return _sharedName->_string[index];
}
bool Name::IsEmpty() const
// ***********************
{
return _sharedName->_string.empty();
return _sharedName->_string.empty();
}
string Name::_GetString() const
string Name::_getString() const
// ****************************
{
return _sharedName->_string;
return _sharedName->_string;
}
Record* Name::_GetRecord() const
Record* Name::_getRecord() const
// ***********************
{
Record* record = new Record(GetString(this));
record->Add(GetSlot("SharedName", _sharedName));
return record;
Record* record = new Record(getString(this));
record->Add(getSlot("SharedName", _sharedName));
return record;
}

View File

@ -26,49 +26,49 @@ class Name {
// Attributes
// **********
private: SharedName* _sharedName;
private: SharedName* _sharedName;
// Constructors
// ************
public: Name();
public: Name();
public: Name(const char* c);
public: Name(const string& s);
public: Name(const char* c);
public: Name(const string& s);
public: Name(const Name& name);
public: Name(const Name& name);
// Destructor
// **********
public: ~Name();
public: ~Name();
// Operators
// *********
public: Name& operator=(const Name& name);
public: Name& operator=(const Name& name);
public: bool operator==(const Name& name) const;
public: bool operator!=(const Name& name) const;
public: bool operator<(const Name& name) const;
public: bool operator<=(const Name& name) const;
public: bool operator>(const Name& name) const;
public: bool operator>=(const Name& name) const;
public: bool operator==(const Name& name) const;
public: bool operator!=(const Name& name) const;
public: bool operator<(const Name& name) const;
public: bool operator<=(const Name& name) const;
public: bool operator>(const Name& name) const;
public: bool operator>=(const Name& name) const;
public: char operator[](unsigned index) const;
public: char operator[](unsigned index) const;
// Predicates
// **********
public: bool IsEmpty() const;
public: bool IsEmpty() const;
// Others
// ******
public: string _GetTypeName() const { return _TName("Name"); };
public: string _GetString() const;
public: Record* _GetRecord() const;
public: SharedName* _GetSharedName() const {return _sharedName;};
public: string _getTypeName() const { return _TName("Name"); };
public: string _getString() const;
public: Record* _getRecord() const;
public: SharedName* _getSharedName() const {return _sharedName;};
};

View File

@ -45,9 +45,9 @@ typedef GenericFilter<Name*> NameFilter;
#define for_each_name(name, names)\
/****************************************************/\
{\
NameLocator _locator = names.GetLocator();\
NameLocator _locator = names.getLocator();\
while (_locator.IsValid()) {\
Name* name = _locator.GetElement();\
Name* name = _locator.getElement();\
_locator.Progress();
} // End of Hurricane namespace.

View File

@ -35,11 +35,11 @@ class Net_IsCellNetFilter : public Filter<Net*> {
public: Net_IsCellNetFilter& operator=(const Net_IsCellNetFilter& filter) {return *this;};
public: virtual Filter<Net*>* GetClone() const {return new Net_IsCellNetFilter(*this);};
public: virtual Filter<Net*>* getClone() const {return new Net_IsCellNetFilter(*this);};
public: virtual bool Accept(Net* net) const {return !net->IsDeepNet();};
public: virtual string _GetString() const {return "<" + _TName("Net::IsCellNetFilter>");};
public: virtual string _getString() const {return "<" + _TName("Net::IsCellNetFilter>");};
};
@ -52,11 +52,11 @@ class Net_IsDeepNetFilter : public Filter<Net*> {
public: Net_IsDeepNetFilter& operator=(const Net_IsDeepNetFilter& filter) {return *this;};
public: virtual Filter<Net*>* GetClone() const {return new Net_IsDeepNetFilter(*this);};
public: virtual Filter<Net*>* getClone() const {return new Net_IsDeepNetFilter(*this);};
public: virtual bool Accept(Net* net) const {return net->IsDeepNet();};
public: virtual string _GetString() const {return "<" + _TName("Net::IsDeepNetFilter>");};
public: virtual string _getString() const {return "<" + _TName("Net::IsDeepNetFilter>");};
};
@ -69,11 +69,11 @@ class Net_IsGlobalFilter : public Filter<Net*> {
public: Net_IsGlobalFilter& operator=(const Net_IsGlobalFilter& filter) {return *this;};
public: virtual Filter<Net*>* GetClone() const {return new Net_IsGlobalFilter(*this);};
public: virtual Filter<Net*>* getClone() const {return new Net_IsGlobalFilter(*this);};
public: virtual bool Accept(Net* net) const {return net->IsGlobal();};
public: virtual string _GetString() const {return "<" + _TName("Net::IsGlobalFilter>");};
public: virtual string _getString() const {return "<" + _TName("Net::IsGlobalFilter>");};
};
@ -86,11 +86,11 @@ class Net_IsExternalFilter : public Filter<Net*> {
public: Net_IsExternalFilter& operator=(const Net_IsExternalFilter& filter) {return *this;};
public: virtual Filter<Net*>* GetClone() const {return new Net_IsExternalFilter(*this);};
public: virtual Filter<Net*>* getClone() const {return new Net_IsExternalFilter(*this);};
public: virtual bool Accept(Net* net) const {return net->IsExternal();};
public: virtual string _GetString() const {return "<" + _TName("Net::IsExternalFilter>");};
public: virtual string _getString() const {return "<" + _TName("Net::IsExternalFilter>");};
};
@ -103,11 +103,11 @@ class Net_IsClockFilter : public Filter<Net*> {
public: Net_IsClockFilter& operator=(const Net_IsClockFilter& filter) {return *this;};
public: virtual Filter<Net*>* GetClone() const {return new Net_IsClockFilter(*this);};
public: virtual Filter<Net*>* getClone() const {return new Net_IsClockFilter(*this);};
public: virtual bool Accept(Net* net) const {return net->IsClock();};
public: virtual string _GetString() const {return "<" + _TName("Net::IsClockFilter>");};
public: virtual string _getString() const {return "<" + _TName("Net::IsClockFilter>");};
};
@ -120,11 +120,11 @@ class Net_IsSupplyFilter : public Filter<Net*> {
public: Net_IsSupplyFilter& operator=(const Net_IsSupplyFilter& filter) {return *this;};
public: virtual Filter<Net*>* GetClone() const {return new Net_IsSupplyFilter(*this);};
public: virtual Filter<Net*>* getClone() const {return new Net_IsSupplyFilter(*this);};
public: virtual bool Accept(Net* net) const {return net->IsSupply();};
public: virtual string _GetString() const {return "<" + _TName("Net::IsSupplyFilter>");};
public: virtual string _getString() const {return "<" + _TName("Net::IsSupplyFilter>");};
};
@ -137,11 +137,11 @@ class Net_IsPowerFilter : public Filter<Net*> {
public: Net_IsPowerFilter& operator=(const Net_IsPowerFilter& filter) {return *this;};
public: virtual Filter<Net*>* GetClone() const {return new Net_IsPowerFilter(*this);};
public: virtual Filter<Net*>* getClone() const {return new Net_IsPowerFilter(*this);};
public: virtual bool Accept(Net* net) const {return net->IsPower();};
public: virtual string _GetString() const {return "<" + _TName("Net::IsPowerFilter>");};
public: virtual string _getString() const {return "<" + _TName("Net::IsPowerFilter>");};
};
@ -154,11 +154,11 @@ class Net_IsGroundFilter : public Filter<Net*> {
public: Net_IsGroundFilter& operator=(const Net_IsGroundFilter& filter) {return *this;};
public: virtual Filter<Net*>* GetClone() const {return new Net_IsGroundFilter(*this);};
public: virtual Filter<Net*>* getClone() const {return new Net_IsGroundFilter(*this);};
public: virtual bool Accept(Net* net) const {return net->IsGround();};
public: virtual string _GetString() const {return "<" + _TName("Net::IsGroundFilter>");};
public: virtual string _getString() const {return "<" + _TName("Net::IsGroundFilter>");};
};
@ -190,14 +190,14 @@ class Net_SlavePlugs : public Collection<Plug*> {
public: Locator& operator=(const Locator& locator);
public: virtual Plug* GetElement() const;
public: virtual Hurricane::Locator<Plug*>* GetClone() const;
public: virtual Plug* getElement() const;
public: virtual Hurricane::Locator<Plug*>* getClone() const;
public: virtual bool IsValid() const;
public: virtual void Progress();
public: virtual string _GetString() const;
public: virtual string _getString() const;
};
@ -220,13 +220,13 @@ class Net_SlavePlugs : public Collection<Plug*> {
// Accessors
// *********
public: virtual Collection<Plug*>* GetClone() const;
public: virtual Hurricane::Locator<Plug*>* GetLocator() const;
public: virtual Collection<Plug*>* getClone() const;
public: virtual Hurricane::Locator<Plug*>* getLocator() const;
// Others
// ******
public: virtual string _GetString() const;
public: virtual string _getString() const;
};
@ -257,8 +257,8 @@ Net::Net(Cell* cell, const Name& name)
if (name.IsEmpty())
throw Error("Can't create " + _TName("Net") + " : empty name");
if (_cell->GetNet(_name))
throw Error("Can't create " + _TName("Net ") + GetString(_name) + " : already exists");
if (_cell->getNet(_name))
throw Error("Can't create " + _TName("Net ") + getString(_name) + " : already exists");
}
Net* Net::Create(Cell* cell, const Name& name)
@ -266,145 +266,145 @@ Net* Net::Create(Cell* cell, const Name& name)
{
Net* net = new Net(cell, name);
net->_PostCreate();
net->_postCreate();
return net;
}
Box Net::GetBoundingBox() const
Box Net::getBoundingBox() const
// ****************************
{
Box boundingBox;
for_each_component(component, GetComponents()) {
boundingBox.merge(component->GetBoundingBox());
for_each_component(component, getComponents()) {
boundingBox.merge(component->getBoundingBox());
end_for;
}
return boundingBox;
}
RoutingPads Net::GetRoutingPads() const
RoutingPads Net::getRoutingPads() const
// ************************
{
// return GetComponents().GetSubSet<RoutingPad*>();
return SubTypeCollection<Component*, RoutingPad*>(GetComponents());
// return getComponents().getSubSet<RoutingPad*>();
return SubTypeCollection<Component*, RoutingPad*>(getComponents());
}
Plugs Net::GetPlugs() const
Plugs Net::getPlugs() const
// ************************
{
// return GetComponents().GetSubSet<Plug*>();
return SubTypeCollection<Component*, Plug*>(GetComponents());
// return getComponents().getSubSet<Plug*>();
return SubTypeCollection<Component*, Plug*>(getComponents());
}
Pins Net::GetPins() const
Pins Net::getPins() const
// **********************
{
// return GetComponents().GetSubSet<Pin*>();
return SubTypeCollection<Component*, Pin*>(GetComponents());
// return getComponents().getSubSet<Pin*>();
return SubTypeCollection<Component*, Pin*>(getComponents());
}
Contacts Net::GetContacts() const
Contacts Net::getContacts() const
// ******************************
{
// return GetComponents().GetSubSet<Contact*>();
return SubTypeCollection<Component*, Contact*>(GetComponents());
// return getComponents().getSubSet<Contact*>();
return SubTypeCollection<Component*, Contact*>(getComponents());
}
Segments Net::GetSegments() const
Segments Net::getSegments() const
// ******************************
{
// return GetComponents().GetSubSet<Segment*>();
return SubTypeCollection<Component*, Segment*>(GetComponents());
// return getComponents().getSubSet<Segment*>();
return SubTypeCollection<Component*, Segment*>(getComponents());
}
Verticals Net::GetVerticals() const
Verticals Net::getVerticals() const
// ********************************
{
// return GetComponents().GetSubSet<Vertical*>();
return SubTypeCollection<Component*, Vertical*>(GetComponents());
// return getComponents().getSubSet<Vertical*>();
return SubTypeCollection<Component*, Vertical*>(getComponents());
}
Horizontals Net::GetHorizontals() const
Horizontals Net::getHorizontals() const
// ************************************
{
// return GetComponents().GetSubSet<Horizontal*>();
return SubTypeCollection<Component*, Horizontal*>(GetComponents());
// return getComponents().getSubSet<Horizontal*>();
return SubTypeCollection<Component*, Horizontal*>(getComponents());
}
Pads Net::GetPads() const
Pads Net::getPads() const
// **********************
{
// return GetComponents().GetSubSet<Pad*>();
return SubTypeCollection<Component*, Pad*>(GetComponents());
// return getComponents().getSubSet<Pad*>();
return SubTypeCollection<Component*, Pad*>(getComponents());
}
Plugs Net::GetSlavePlugs() const
Plugs Net::getSlavePlugs() const
// *****************************
{
return Net_SlavePlugs(this);
}
Plugs Net::GetConnectedSlavePlugs() const
Plugs Net::getConnectedSlavePlugs() const
// **************************************
{
return GetSlavePlugs().GetSubSet(Plug::GetIsConnectedFilter());
return getSlavePlugs().getSubSet(Plug::getIsConnectedFilter());
}
Plugs Net::GetUnconnectedSlavePlugs() const
Plugs Net::getUnconnectedSlavePlugs() const
// ****************************************
{
return GetSlavePlugs().GetSubSet(Plug::GetIsUnconnectedFilter());
return getSlavePlugs().getSubSet(Plug::getIsUnconnectedFilter());
}
NetFilter Net::GetIsCellNetFilter()
NetFilter Net::getIsCellNetFilter()
// *******************************
{
return Net_IsCellNetFilter();
}
NetFilter Net::GetIsDeepNetFilter()
NetFilter Net::getIsDeepNetFilter()
// *******************************
{
return Net_IsDeepNetFilter();
}
NetFilter Net::GetIsGlobalFilter()
NetFilter Net::getIsGlobalFilter()
// *******************************
{
return Net_IsGlobalFilter();
}
NetFilter Net::GetIsExternalFilter()
NetFilter Net::getIsExternalFilter()
// *********************************
{
return Net_IsExternalFilter();
}
NetFilter Net::GetIsInternalFilter()
NetFilter Net::getIsInternalFilter()
// *********************************
{
return !Net_IsExternalFilter();
}
NetFilter Net::GetIsClockFilter()
NetFilter Net::getIsClockFilter()
// ******************************
{
return Net_IsClockFilter();
}
NetFilter Net::GetIsSupplyFilter()
NetFilter Net::getIsSupplyFilter()
// *******************************
{
return Net_IsSupplyFilter();
}
NetFilter Net::GetIsPowerFilter()
NetFilter Net::getIsPowerFilter()
// *******************************
{
return Net_IsPowerFilter();
}
NetFilter Net::GetIsGroundFilter()
NetFilter Net::getIsGroundFilter()
// *******************************
{
return Net_IsGroundFilter();
@ -417,12 +417,12 @@ void Net::SetName(const Name& name)
if (name.IsEmpty())
throw Error("Can't change net name : empty name");
if (_cell->GetNet(name))
if (_cell->getNet(name))
throw Error("Can't change net name : already exists");
_cell->_GetNetMap()._Remove(this);
_cell->_getNetMap()._Remove(this);
_name = name;
_cell->_GetNetMap()._Insert(this);
_cell->_getNetMap()._Insert(this);
}
}
@ -443,7 +443,7 @@ void Net::SetExternal(bool isExternal)
{
if (isExternal != _isExternal) {
if (!isExternal) {
if (!GetConnectedSlavePlugs().IsEmpty())
if (!getConnectedSlavePlugs().IsEmpty())
throw Error("Can't set internal : has connected slave plugs");
_direction = Direction::UNDEFINED;
}
@ -451,7 +451,7 @@ void Net::SetExternal(bool isExternal)
if (_isExternal) {
OpenUpdateSession();
SetPosition(Point(0, 0));
for_each_instance(instance, _cell->GetSlaveInstances()) {
for_each_instance(instance, _cell->getSlaveInstances()) {
Plug::_Create(instance, this);
end_for;
}
@ -470,7 +470,7 @@ void Net::SetPosition(const Point& position)
// *****************************************
{
if (_position != position) {
for_each_plug(plug, GetSlavePlugs()) {
for_each_plug(plug, getSlavePlugs()) {
plug->Invalidate(true);
end_for;
}
@ -487,11 +487,11 @@ void Net::SetDirection(const Direction& direction)
void Net::Materialize()
// ********************
{
for_each_component(component, GetComponents()) {
for_each_component(component, getComponents()) {
component->Materialize();
end_for;
}
for_each_rubber(rubber, GetRubbers()) {
for_each_rubber(rubber, getRubbers()) {
rubber->Materialize();
end_for;
}
@ -500,11 +500,11 @@ void Net::Materialize()
void Net::Unmaterialize()
// **********************
{
for_each_rubber(rubber, GetRubbers()) {
for_each_rubber(rubber, getRubbers()) {
rubber->Unmaterialize();
end_for;
}
for_each_component(component, GetComponents()) {
for_each_component(component, getComponents()) {
component->Unmaterialize();
end_for;
}
@ -516,8 +516,8 @@ static void MergeNets(Net* net1, Net* net2)
assert(net1);
assert(net2);
if (net2->GetName()[0] != '~') {
if ((net1->GetName()[0] == '~') ||
if (net2->getName()[0] != '~') {
if ((net1->getName()[0] == '~') ||
(net2->IsGlobal() && !net1->IsGlobal()) ||
(net2->IsExternal() && !net1->IsExternal())) {
Net* tmpNet = net1;
@ -544,73 +544,73 @@ void Net::Merge(Net* net)
if (net == this)
throw Error("Can't merge net : itself");
if (net->GetCell() != _cell)
if (net->getCell() != _cell)
throw Error("Can't merge net : incompatible net");
if (!IsExternal() && net->IsExternal() && !net->GetConnectedSlavePlugs().IsEmpty())
if (!IsExternal() && net->IsExternal() && !net->getConnectedSlavePlugs().IsEmpty())
throw Error("Can't merge net : incompatible net");
for_each_rubber(rubber, net->GetRubbers()) rubber->_SetNet(this); end_for;
for_each_component(component, net->GetComponents()) component->_SetNet(this); end_for;
for_each_rubber(rubber, net->getRubbers()) rubber->_SetNet(this); end_for;
for_each_component(component, net->getComponents()) component->_SetNet(this); end_for;
if (IsExternal() && net->IsExternal()) {
for_each_plug(plug, net->GetConnectedSlavePlugs()) {
Plug* mainPlug = plug->GetInstance()->GetPlug(this);
if (mainPlug->IsConnected() && (mainPlug->GetNet() != plug->GetNet()))
MergeNets(mainPlug->GetNet(), plug->GetNet());
for_each_plug(plug, net->getConnectedSlavePlugs()) {
Plug* mainPlug = plug->getInstance()->getPlug(this);
if (mainPlug->IsConnected() && (mainPlug->getNet() != plug->getNet()))
MergeNets(mainPlug->getNet(), plug->getNet());
end_for;
}
for_each_plug(plug, net->GetConnectedSlavePlugs()) {
Plug* mainPlug = plug->GetInstance()->GetPlug(this);
if (!mainPlug->IsConnected()) mainPlug->SetNet(plug->GetNet());
Hook* masterHook = plug->GetBodyHook();
Hook* nextMasterHook = masterHook->GetNextMasterHook();
for_each_plug(plug, net->getConnectedSlavePlugs()) {
Plug* mainPlug = plug->getInstance()->getPlug(this);
if (!mainPlug->IsConnected()) mainPlug->SetNet(plug->getNet());
Hook* masterHook = plug->getBodyHook();
Hook* nextMasterHook = masterHook->getNextMasterHook();
if (nextMasterHook != masterHook) {
masterHook->Detach();
mainPlug->GetBodyHook()->Merge(nextMasterHook);
mainPlug->getBodyHook()->Merge(nextMasterHook);
}
Hooks slaveHooks = masterHook->GetSlaveHooks();
Hooks slaveHooks = masterHook->getSlaveHooks();
while (!slaveHooks.IsEmpty()) {
Hook* slaveHook = slaveHooks.GetFirst();
Hook* slaveHook = slaveHooks.getFirst();
slaveHook->Detach();
slaveHook->Attach(mainPlug->GetBodyHook());
slaveHook->Attach(mainPlug->getBodyHook());
}
plug->_Delete();
plug->_destroy();
end_for;
}
}
net->Delete();
net->destroy();
}
void Net::_PostCreate()
void Net::_postCreate()
// ********************
{
_cell->_GetNetMap()._Insert(this);
_cell->_getNetMap()._Insert(this);
if (_isExternal) {
for_each_instance(instance, _cell->GetSlaveInstances()) {
for_each_instance(instance, _cell->getSlaveInstances()) {
Plug::_Create(instance, this);
end_for;
}
}
Inherit::_PostCreate();
Inherit::_postCreate();
}
void Net::_PreDelete()
void Net::_preDestroy()
// *******************
{
Inherit::_PreDelete();
Inherit::_preDestroy();
for_each_plug(slavePlug, GetSlavePlugs()) slavePlug->_Delete(); end_for;
for_each_plug(slavePlug, getSlavePlugs()) slavePlug->_destroy(); end_for;
Unmaterialize();
for_each_rubber(rubber, GetRubbers()) rubber->_Delete(); end_for;
for_each_rubber(rubber, getRubbers()) rubber->_destroy(); end_for;
for_each_component(component, GetComponents()) {
for_each_hook(hook, component->GetHooks()) {
for_each_component(component, getComponents()) {
for_each_hook(hook, component->getHooks()) {
// 15 05 2006 xtof : detach all hooks in rings when
// a net deletion occurs, can't see why master hooks were not detached.
//if (!hook->IsMaster()) hook->Detach();
@ -620,41 +620,41 @@ void Net::_PreDelete()
end_for;
}
for_each_component(component, GetComponents()) {
for_each_component(component, getComponents()) {
if (!is_a<Plug*>(component))
component->Delete();
component->destroy();
else
((Plug*)component)->SetNet(NULL);
end_for;
}
_cell->_GetNetMap()._Remove(this);
_cell->_getNetMap()._Remove(this);
}
string Net::_GetString() const
string Net::_getString() const
// ***************************
{
string s = Inherit::_GetString();
s.insert(s.length() - 1, " " + GetString(_name));
string s = Inherit::_getString();
s.insert(s.length() - 1, " " + getString(_name));
return s;
}
Record* Net::_GetRecord() const
Record* Net::_getRecord() const
// **********************
{
Record* record = Inherit::_GetRecord();
Record* record = Inherit::_getRecord();
if (record) {
record->Add(GetSlot("Cell", _cell));
record->Add(GetSlot("Name", &_name));
record->Add(GetSlot("Arity", &_arity));
record->Add(GetSlot("Global", &_isGlobal));
record->Add(GetSlot("External", &_isExternal));
record->Add(GetSlot("Type", _type));
record->Add(GetSlot("Direction", _direction));
record->Add(GetSlot("Position", &_position));
record->Add(GetSlot("Components", &_componentSet));
record->Add(GetSlot("Rubbers", &_rubberSet));
record->Add(GetSlot("External", &_isExternal));
record->Add(getSlot("Cell", _cell));
record->Add(getSlot("Name", &_name));
record->Add(getSlot("Arity", &_arity));
record->Add(getSlot("Global", &_isGlobal));
record->Add(getSlot("External", &_isExternal));
record->Add(getSlot("Type", _type));
record->Add(getSlot("Direction", _direction));
record->Add(getSlot("Position", &_position));
record->Add(getSlot("Components", &_componentSet));
record->Add(getSlot("Rubbers", &_rubberSet));
record->Add(getSlot("External", &_isExternal));
}
return record;
}
@ -682,17 +682,17 @@ Net::Type& Net::Type::operator=(const Type& type)
return *this;
}
string Net::Type::_GetString() const
string Net::Type::_getString() const
// *********************************
{
return GetString(&_code);
return getString(&_code);
}
Record* Net::Type::_GetRecord() const
Record* Net::Type::_getRecord() const
// ****************************
{
Record* record = new Record(GetString(this));
record->Add(GetSlot("Code", &_code));
Record* record = new Record(getString(this));
record->Add(getSlot("Code", &_code));
return record;
}
@ -721,17 +721,17 @@ Net::Direction& Net::Direction::operator=(const Direction& direction)
return *this;
}
string Net::Direction::_GetString() const
string Net::Direction::_getString() const
// **************************************
{
return GetString(&_code);
return getString(&_code);
}
Record* Net::Direction::_GetRecord() const
Record* Net::Direction::_getRecord() const
// *********************************
{
Record* record = new Record(GetString(this));
record->Add(GetSlot("Code", &_code));
Record* record = new Record(getString(this));
record->Add(getSlot("Code", &_code));
return record;
}
@ -747,16 +747,16 @@ Net::ComponentSet::ComponentSet()
{
}
unsigned Net::ComponentSet::_GetHashValue(Component* component) const
unsigned Net::ComponentSet::_getHashValue(Component* component) const
// ******************************************************************
{
return ( (unsigned int)( (unsigned long)component ) ) / 8;
}
Component* Net::ComponentSet::_GetNextElement(Component* component) const
Component* Net::ComponentSet::_getNextElement(Component* component) const
// **********************************************************************
{
return component->_GetNextOfNetComponentSet();
return component->_getNextOfNetComponentSet();
}
void Net::ComponentSet::_SetNextElement(Component* component, Component* nextComponent) const
@ -777,16 +777,16 @@ Net::RubberSet::RubberSet()
{
}
unsigned Net::RubberSet::_GetHashValue(Rubber* rubber) const
unsigned Net::RubberSet::_getHashValue(Rubber* rubber) const
// *********************************************************
{
return ( (unsigned int)( (unsigned long)rubber ) ) / 8;
}
Rubber* Net::RubberSet::_GetNextElement(Rubber* rubber) const
Rubber* Net::RubberSet::_getNextElement(Rubber* rubber) const
// **********************************************************
{
return rubber->_GetNextOfNetRubberSet();
return rubber->_getNextOfNetRubberSet();
}
void Net::RubberSet::_SetNextElement(Rubber* rubber, Rubber* nextRubber) const
@ -822,23 +822,23 @@ Net_SlavePlugs& Net_SlavePlugs::operator=(const Net_SlavePlugs& slavePlugs)
return *this;
}
Collection<Plug*>* Net_SlavePlugs::GetClone() const
Collection<Plug*>* Net_SlavePlugs::getClone() const
// ************************************************
{
return new Net_SlavePlugs(*this);
}
Locator<Plug*>* Net_SlavePlugs::GetLocator() const
Locator<Plug*>* Net_SlavePlugs::getLocator() const
// ***********************************************
{
return new Locator(_net);
}
string Net_SlavePlugs::_GetString() const
string Net_SlavePlugs::_getString() const
// **************************************
{
string s = "<" + _TName("Net::SlavePlugs");
if (_net) s += " " + GetString(_net);
if (_net) s += " " + getString(_net);
s += ">";
return s;
}
@ -857,9 +857,9 @@ Net_SlavePlugs::Locator::Locator(const Net* net)
_instanceLocator()
{
if (_net) {
_instanceLocator = _net->GetCell()->GetSlaveInstances().GetLocator();
_instanceLocator = _net->getCell()->getSlaveInstances().getLocator();
while (!_plug && _instanceLocator.IsValid()) {
_plug = _instanceLocator.GetElement()->GetPlug(_net);
_plug = _instanceLocator.getElement()->getPlug(_net);
_instanceLocator.Progress();
}
}
@ -883,13 +883,13 @@ Net_SlavePlugs::Locator& Net_SlavePlugs::Locator::operator=(const Locator& locat
return *this;
}
Plug* Net_SlavePlugs::Locator::GetElement() const
Plug* Net_SlavePlugs::Locator::getElement() const
// **********************************************
{
return _plug;
}
Locator<Plug*>* Net_SlavePlugs::Locator::GetClone() const
Locator<Plug*>* Net_SlavePlugs::Locator::getClone() const
// ******************************************************
{
return new Locator(*this);
@ -907,17 +907,17 @@ void Net_SlavePlugs::Locator::Progress()
if (IsValid()) {
_plug = NULL;
while (!_plug && _instanceLocator.IsValid()) {
_plug = _instanceLocator.GetElement()->GetPlug(_net);
_plug = _instanceLocator.getElement()->getPlug(_net);
_instanceLocator.Progress();
}
}
}
string Net_SlavePlugs::Locator::_GetString() const
string Net_SlavePlugs::Locator::_getString() const
// ***********************************************
{
string s = "<" + _TName("Net::SlavePlugs::Locator");
if (_net) s += " " + GetString(_net);
if (_net) s += " " + getString(_net);
s += ">";
return s;
}

View File

@ -37,182 +37,182 @@ class Net : public Entity {
// Types
// *****
public: typedef Entity Inherit;
public: typedef Entity Inherit;
public: typedef unsigned Arity;
public: typedef unsigned Arity;
public: class Type {
// ***************
// ***************
public: enum Code {UNDEFINED=0, LOGICAL=1, CLOCK=2, POWER=3, GROUND=4};
public: enum Code {UNDEFINED=0, LOGICAL=1, CLOCK=2, POWER=3, GROUND=4};
private: Code _code;
private: Code _code;
public: Type(const Code& code = UNDEFINED);
public: Type(const Type& type);
public: Type(const Code& code = UNDEFINED);
public: Type(const Type& type);
public: Type& operator=(const Type& type);
public: Type& operator=(const Type& type);
public: operator const Code&() const {return _code;};
public: operator const Code&() const {return _code;};
public: const Code& GetCode() const {return _code;};
public: const Code& getCode() const {return _code;};
public: string _GetTypeName() const { return _TName("Net::type"); };
public: string _GetString() const;
public: Record* _GetRecord() const;
public: string _getTypeName() const { return _TName("Net::type"); };
public: string _getString() const;
public: Record* _getRecord() const;
};
};
public: class Direction {
// ********************
// ********************
public: enum Code {UNDEFINED=0, IN=1, OUT=2, INOUT=3, TRISTATE=4};
public: enum Code {UNDEFINED=0, IN=1, OUT=2, INOUT=3, TRISTATE=4};
private: Code _code;
private: Code _code;
public: Direction(const Code& code = UNDEFINED);
public: Direction(const Direction& direction);
public: Direction(const Code& code = UNDEFINED);
public: Direction(const Direction& direction);
public: Direction& operator=(const Direction& direction);
public: Direction& operator=(const Direction& direction);
public: operator const Code&() const {return _code;};
public: operator const Code&() const {return _code;};
public: const Code& GetCode() const {return _code;};
public: const Code& getCode() const {return _code;};
public: string _GetTypeName() const { return _TName("Net::Direction"); };
public: string _GetString() const;
public: Record* _GetRecord() const;
public: string _getTypeName() const { return _TName("Net::Direction"); };
public: string _getString() const;
public: Record* _getRecord() const;
};
};
class ComponentSet : public IntrusiveSet<Component> {
// ************************************************
class ComponentSet : public IntrusiveSet<Component> {
// ************************************************
public: typedef IntrusiveSet<Component> Inherit;
public: ComponentSet();
public: typedef IntrusiveSet<Component> Inherit;
public: ComponentSet();
public: virtual unsigned _GetHashValue(Component* component) const;
public: virtual Component* _GetNextElement(Component* component) const;
public: virtual void _SetNextElement(Component* component, Component* nextComponent) const;
public: virtual unsigned _getHashValue(Component* component) const;
public: virtual Component* _getNextElement(Component* component) const;
public: virtual void _SetNextElement(Component* component, Component* nextComponent) const;
};
};
class RubberSet : public IntrusiveSet<Rubber> {
// ******************************************
class RubberSet : public IntrusiveSet<Rubber> {
// ******************************************
public: typedef IntrusiveSet<Rubber> Inherit;
public: RubberSet();
public: typedef IntrusiveSet<Rubber> Inherit;
public: RubberSet();
public: virtual unsigned _GetHashValue(Rubber* rubber) const;
public: virtual Rubber* _GetNextElement(Rubber* rubber) const;
public: virtual void _SetNextElement(Rubber* rubber, Rubber* nextRubber) const;
public: virtual unsigned _getHashValue(Rubber* rubber) const;
public: virtual Rubber* _getNextElement(Rubber* rubber) const;
public: virtual void _SetNextElement(Rubber* rubber, Rubber* nextRubber) const;
};
};
// Attributes
// **********
private: Cell* _cell;
private: Name _name;
private: Arity _arity;
private: bool _isGlobal;
private: bool _isExternal;
private: Type _type;
private: Direction _direction;
private: Point _position;
private: ComponentSet _componentSet;
private: RubberSet _rubberSet;
private: Net* _nextOfCellNetMap;
private: Cell* _cell;
private: Name _name;
private: Arity _arity;
private: bool _isGlobal;
private: bool _isExternal;
private: Type _type;
private: Direction _direction;
private: Point _position;
private: ComponentSet _componentSet;
private: RubberSet _rubberSet;
private: Net* _nextOfCellNetMap;
// Constructors
// ************
protected: Net(Cell* cell, const Name& name);
protected: Net(Cell* cell, const Name& name);
public: static Net* Create(Cell* cell, const Name& name);
public: static Net* Create(Cell* cell, const Name& name);
// Accessors
// *********
public: virtual Cell* GetCell() const {return _cell;};
public: virtual Box GetBoundingBox() const;
public: const Name& GetName() const {return _name;};
public: const Arity& GetArity() const {return _arity;};
public: const Type& GetType() const {return _type;};
public: const Direction& GetDirection() const {return _direction;};
public: const Point& GetPosition() const {return _position;};
public: const Unit& GetX() const {return _position.getX();};
public: const Unit& GetY() const {return _position.getY();};
public: Components GetComponents() const {return _componentSet.GetElements();};
public: Rubbers GetRubbers() const {return _rubberSet.GetElements();};
public: RoutingPads GetRoutingPads() const;
public: Plugs GetPlugs() const;
public: Pins GetPins() const;
public: Contacts GetContacts() const;
public: Segments GetSegments() const;
public: Verticals GetVerticals() const;
public: Horizontals GetHorizontals() const;
public: Pads GetPads() const;
public: Plugs GetSlavePlugs() const;
public: Plugs GetConnectedSlavePlugs() const;
public: Plugs GetUnconnectedSlavePlugs() const;
public: virtual Cell* getCell() const {return _cell;};
public: virtual Box getBoundingBox() const;
public: const Name& getName() const {return _name;};
public: const Arity& getArity() const {return _arity;};
public: const Type& getType() const {return _type;};
public: const Direction& getDirection() const {return _direction;};
public: const Point& getPosition() const {return _position;};
public: const Unit& getX() const {return _position.getX();};
public: const Unit& getY() const {return _position.getY();};
public: Components getComponents() const {return _componentSet.getElements();};
public: Rubbers getRubbers() const {return _rubberSet.getElements();};
public: RoutingPads getRoutingPads() const;
public: Plugs getPlugs() const;
public: Pins getPins() const;
public: Contacts getContacts() const;
public: Segments getSegments() const;
public: Verticals getVerticals() const;
public: Horizontals getHorizontals() const;
public: Pads getPads() const;
public: Plugs getSlavePlugs() const;
public: Plugs getConnectedSlavePlugs() const;
public: Plugs getUnconnectedSlavePlugs() const;
// Filters
// *******
public: static NetFilter GetIsCellNetFilter();
public: static NetFilter GetIsDeepNetFilter();
public: static NetFilter GetIsGlobalFilter();
public: static NetFilter GetIsExternalFilter();
public: static NetFilter GetIsInternalFilter();
public: static NetFilter GetIsClockFilter();
public: static NetFilter GetIsSupplyFilter();
public: static NetFilter GetIsPowerFilter();
public: static NetFilter GetIsGroundFilter();
public: static NetFilter getIsCellNetFilter();
public: static NetFilter getIsDeepNetFilter();
public: static NetFilter getIsGlobalFilter();
public: static NetFilter getIsExternalFilter();
public: static NetFilter getIsInternalFilter();
public: static NetFilter getIsClockFilter();
public: static NetFilter getIsSupplyFilter();
public: static NetFilter getIsPowerFilter();
public: static NetFilter getIsGroundFilter();
// Predicates
// **********
public: virtual bool IsDeepNet () const {return false;};
public: bool IsGlobal () const {return _isGlobal;};
public: bool IsExternal() const {return _isExternal;};
public: bool IsLogical () const {return (_type == Type::LOGICAL);};
public: bool IsClock () const {return (_type == Type::CLOCK);};
public: bool IsPower () const {return (_type == Type::POWER);};
public: bool IsGround () const {return (_type == Type::GROUND);};
public: bool IsSupply () const {return (IsPower() || IsGround());};
public: virtual bool IsDeepNet () const {return false;};
public: bool IsGlobal () const {return _isGlobal;};
public: bool IsExternal() const {return _isExternal;};
public: bool IsLogical () const {return (_type == Type::LOGICAL);};
public: bool IsClock () const {return (_type == Type::CLOCK);};
public: bool IsPower () const {return (_type == Type::POWER);};
public: bool IsGround () const {return (_type == Type::GROUND);};
public: bool IsSupply () const {return (IsPower() || IsGround());};
// Updators
// ********
public: void SetName(const Name& name);
public: void SetArity(const Arity& arity);
public: void SetGlobal(bool isGlobal);
public: void SetExternal(bool isExternal);
public: void SetType(const Type& type);
public: void SetDirection(const Direction& direction);
public: void SetPosition(const Point& position);
public: void Materialize();
public: void Unmaterialize();
public: void Merge(Net* net);
public: void SetName(const Name& name);
public: void SetArity(const Arity& arity);
public: void SetGlobal(bool isGlobal);
public: void SetExternal(bool isExternal);
public: void SetType(const Type& type);
public: void SetDirection(const Direction& direction);
public: void SetPosition(const Point& position);
public: void Materialize();
public: void Unmaterialize();
public: void Merge(Net* net);
// Others
// ******
protected: virtual void _PostCreate();
protected: virtual void _postCreate();
protected: virtual void _PreDelete();
protected: virtual void _preDestroy();
public: virtual string _GetTypeName() const {return _TName("Net");};
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: ComponentSet& _GetComponentSet() {return _componentSet;};
public: RubberSet& _GetRubberSet() {return _rubberSet;};
public: Net* _GetNextOfCellNetMap() const {return _nextOfCellNetMap;};
public: virtual string _getTypeName() const {return _TName("Net");};
public: virtual string _getString() const;
public: virtual Record* _getRecord() const;
public: ComponentSet& _getComponentSet() {return _componentSet;};
public: RubberSet& _getRubberSet() {return _rubberSet;};
public: Net* _getNextOfCellNetMap() const {return _nextOfCellNetMap;};
public: void _SetNextOfCellNetMap(Net* net) {_nextOfCellNetMap = net;};
public: void _SetNextOfCellNetMap(Net* net) {_nextOfCellNetMap = net;};
};
@ -245,8 +245,8 @@ template<>
inline Record* ProxyRecord <Net::Type::Code>
( const Net::Type::Code* object )
{
Record* record = new Record(GetString(object));
record->Add(GetSlot("Code", (unsigned int*)object));
Record* record = new Record(getString(object));
record->Add(getSlot("Code", (unsigned int*)object));
return record;
}
@ -279,8 +279,8 @@ template<>
inline Record* ProxyRecord <Net::Direction::Code>
( const Net::Direction::Code* object )
{
Record* record = new Record(GetString(object));
record->Add(GetSlot("Code", (unsigned int*)object));
Record* record = new Record(getString(object));
record->Add(getSlot("Code", (unsigned int*)object));
return record;
}

View File

@ -18,43 +18,38 @@ namespace Hurricane {
static Name ExternalComponentsRelationName("ExternalComponentsRelation");
static StandardRelation* GetExternalComponentsRelation(const Net* net)
{
Property* property = net->GetProperty(ExternalComponentsRelationName);
if (!property)
return NULL;
else
{
StandardRelation* relation = dynamic_cast<StandardRelation*>(property);
if (!relation)
throw Error("Bad Property type: Must be a Standard Relation");
return relation;
}
static StandardRelation* getExternalComponentsRelation(const Net* net) {
Property* property = net->getProperty(ExternalComponentsRelationName);
if (!property) {
return NULL;
} else {
StandardRelation* relation = dynamic_cast<StandardRelation*>(property);
if (!relation)
throw Error("Bad Property type: Must be a Standard Relation");
return relation;
}
}
Components GetExternalComponents(const Net* net)
{
Components getExternalComponents(const Net* net) {
if (!net->IsExternal())
throw Error("Impossible to retrieve external components on non external net "
+ net->GetName()._GetString());
+ net->getName()._getString());
StandardRelation* externalComponentsRelation = GetExternalComponentsRelation(net);
StandardRelation* externalComponentsRelation = getExternalComponentsRelation(net);
if (!externalComponentsRelation)
return Components();
return externalComponentsRelation->GetSlaveOwners().GetSubSet<Component*>();
return externalComponentsRelation->getSlaveOwners().getSubSet<Component*>();
}
void SetExternal(Component* component)
{
Net* net = component->GetNet();
void setExternal(Component* component) {
Net* net = component->getNet();
if (!net->IsExternal())
throw Error("Impossible to set as external a component member of non external net "
+ net->GetName()._GetString());
StandardRelation* externalComponentsRelation = GetExternalComponentsRelation(net);
+ net->getName()._getString());
StandardRelation* externalComponentsRelation = getExternalComponentsRelation(net);
if (!externalComponentsRelation)
externalComponentsRelation = StandardRelation::Create(net, ExternalComponentsRelationName);
component->Put(externalComponentsRelation);
externalComponentsRelation = StandardRelation::create(net, ExternalComponentsRelationName);
component->put(externalComponentsRelation);
}
} // End of Hurricane namespace.

View File

@ -15,9 +15,9 @@
namespace Hurricane {
Components GetExternalComponents(const Net* net);
Components getExternalComponents(const Net* net);
void SetExternal(Component* component);
void setExternal(Component* component);
} // End of Hurricane namespace.

View File

@ -46,10 +46,10 @@ typedef GenericFilter<Net*> NetFilter;
#define for_each_net(net, nets)\
/******************************/\
{\
NetLocator _locator = nets.GetLocator();\
while (_locator.IsValid()) {\
Net* net = _locator.GetElement();\
_locator.Progress();
NetLocator _locator = nets.getLocator();\
while (_locator.IsValid()) {\
Net* net = _locator.getElement();\
_locator.Progress();

View File

@ -22,219 +22,219 @@ namespace Hurricane {
Occurrence::Occurrence(const Entity* entity)
// *********************************
: _entity(const_cast<Entity*>(entity)),
_sharedPath(NULL)
: _entity(const_cast<Entity*>(entity)),
_sharedPath(NULL)
{
}
Occurrence::Occurrence(const Entity* entity, const Path& path)
// ***************************************************
: _entity(const_cast<Entity*>(entity)),
_sharedPath(path._GetSharedPath())
: _entity(const_cast<Entity*>(entity)),
_sharedPath(path._getSharedPath())
{
if (!_entity) {
throw Error("Can't create " + _TName("Occurrence") + " : null entity");
}
if (_sharedPath)
if (_entity->GetCell() != _sharedPath->GetMasterCell())
throw Error("Can't create " + _TName("Occurrence") + " : incompatible path");
if (!_entity) {
throw Error("Can't create " + _TName("Occurrence") + " : null entity");
}
if (_sharedPath)
if (_entity->getCell() != _sharedPath->getMasterCell())
throw Error("Can't create " + _TName("Occurrence") + " : incompatible path");
}
Occurrence::Occurrence(const Occurrence& occurrence)
// *********************************************
: _entity(occurrence._entity),
_sharedPath(occurrence._sharedPath)
: _entity(occurrence._entity),
_sharedPath(occurrence._sharedPath)
{
}
Occurrence& Occurrence::operator=(const Occurrence& occurrence)
// ********************************************************
{
_entity = occurrence._entity;
_sharedPath = occurrence._sharedPath;
return *this;
_entity = occurrence._entity;
_sharedPath = occurrence._sharedPath;
return *this;
}
bool Occurrence::operator==(const Occurrence& occurrence) const
// *********************************************************
{
return _entity && occurrence._entity &&
(_entity == occurrence._entity) &&
(_sharedPath == occurrence._sharedPath);
return _entity && occurrence._entity &&
(_entity == occurrence._entity) &&
(_sharedPath == occurrence._sharedPath);
}
bool Occurrence::operator!=(const Occurrence& occurrence) const
// *********************************************************
{
return !_entity ||
!occurrence._entity ||
(_entity != occurrence._entity) ||
(_sharedPath != occurrence._sharedPath);
return !_entity ||
!occurrence._entity ||
(_entity != occurrence._entity) ||
(_sharedPath != occurrence._sharedPath);
}
bool Occurrence::operator<(const Occurrence& occurrence) const
// ********************************************************
{
return ((_entity < occurrence._entity) ||
((_entity == occurrence._entity) && (_sharedPath < occurrence._sharedPath)));
return ((_entity < occurrence._entity) ||
((_entity == occurrence._entity) && (_sharedPath < occurrence._sharedPath)));
}
Cell* Occurrence::GetOwnerCell() const
Cell* Occurrence::getOwnerCell() const
// **********************************
{
if (!_entity) return NULL;
return (_sharedPath) ? _sharedPath->GetOwnerCell() : _entity->GetCell();
if (!_entity) return NULL;
return (_sharedPath) ? _sharedPath->getOwnerCell() : _entity->getCell();
}
Cell* Occurrence::GetMasterCell() const
Cell* Occurrence::getMasterCell() const
// ***********************************
{
return (_entity) ? _entity->GetCell() : NULL;
return (_entity) ? _entity->getCell() : NULL;
}
Property* Occurrence::GetProperty(const Name& name) const
Property* Occurrence::getProperty(const Name& name) const
// *****************************************************
{
if (_entity) {
//DBo* quark = _GetQuark();
Quark* quark = _GetQuark();
if (quark) return quark->GetProperty(name);
}
return NULL;
if (_entity) {
//DBo* quark = _getQuark();
Quark* quark = _getQuark();
if (quark) return quark->getProperty(name);
}
return NULL;
}
Properties Occurrence::GetProperties() const
Properties Occurrence::getProperties() const
// ****************************************
{
if (_entity) {
Quark* quark = _GetQuark();
if (quark) return quark->GetProperties();
}
return Properties();
if (_entity) {
Quark* quark = _getQuark();
if (quark) return quark->getProperties();
}
return Properties();
}
Box Occurrence::GetBoundingBox() const
Box Occurrence::getBoundingBox() const
// **********************************
{
if (!_entity) return Box();
if (!_sharedPath) return _entity->GetBoundingBox();
return _sharedPath->GetTransformation().getBox(_entity->GetBoundingBox());
if (!_entity) return Box();
if (!_sharedPath) return _entity->getBoundingBox();
return _sharedPath->getTransformation().getBox(_entity->getBoundingBox());
}
bool Occurrence::HasProperty() const
// ********************************
{
return (_GetQuark() != NULL);
return (_getQuark() != NULL);
}
void Occurrence::MakeInvalid()
// **************************
{
_entity = NULL;
_sharedPath = NULL;
_entity = NULL;
_sharedPath = NULL;
}
void Occurrence::Put(Property* property)
// ************************************
{
if (!_entity)
throw Error("Can't put property : invalid occurrence");
if (!_entity)
throw Error("Can't put property : invalid occurrence");
if (!property)
throw Error("Can't put property : null property");
if (!property)
throw Error("Can't put property : null property");
Quark* quark = _GetQuark();
if (!quark) quark = Quark::_Create(*this);
quark->Put(property);
Quark* quark = _getQuark();
if (!quark) quark = Quark::_Create(*this);
quark->put(property);
}
void Occurrence::Remove(Property* property)
// ***************************************
{
if (!_entity)
throw Error("Can't remove property : invalid occurrence");
if (!_entity)
throw Error("Can't remove property : invalid occurrence");
if (!property)
throw Error("Can't remove property : null property");
if (!property)
throw Error("Can't remove property : null property");
Quark* quark = _GetQuark();
if (quark) quark->Remove(property);
Quark* quark = _getQuark();
if (quark) quark->remove(property);
}
void Occurrence::RemoveProperty(const Name& name)
// *********************************************
{
if (!_entity)
throw Error("Can't remove property : invalid occurrence");
if (!_entity)
throw Error("Can't remove property : invalid occurrence");
Quark* quark = _GetQuark();
if (quark) quark->RemoveProperty(name);
Quark* quark = _getQuark();
if (quark) quark->removeProperty(name);
}
void Occurrence::ClearProperties()
// ******************************
{
Quark* quark = _GetQuark();
if (quark) quark->Delete();
Quark* quark = _getQuark();
if (quark) quark->destroy();
}
string Occurrence::_GetString() const
string Occurrence::_getString() const
// *********************************
{
string s = "<" + _TName("Occurrence");
if (_entity) {
s += " ";
s += GetString(GetOwnerCell());
string s = "<" + _TName("Occurrence");
if (_entity) {
s += " ";
s += getString(getOwnerCell());
s += ":";
if (_sharedPath) s += GetString(_sharedPath->GetName()) + ":";
s += GetString(_entity);
}
s += ">";
return s;
if (_sharedPath) s += getString(_sharedPath->getName()) + ":";
s += getString(_entity);
}
s += ">";
return s;
}
Record* Occurrence::_GetRecord() const
Record* Occurrence::_getRecord() const
// ****************************
{
Record* record = NULL;
if (_entity) {
record = new Record(GetString(this));
record->Add(GetSlot("Entity", _entity));
record->Add(GetSlot("SharedPath", _sharedPath));
Quark* quark = _GetQuark();
if (quark) record->Add(GetSlot("Quark", quark));
}
return record;
Record* record = NULL;
if (_entity) {
record = new Record(getString(this));
record->Add(getSlot("Entity", _entity));
record->Add(getSlot("SharedPath", _sharedPath));
Quark* quark = _getQuark();
if (quark) record->Add(getSlot("Quark", quark));
}
return record;
}
//DBo* ...
Quark* Occurrence::_GetQuark() const
Quark* Occurrence::_getQuark() const
// ********************************
{
return (_entity) ? _entity->_GetQuark(_sharedPath) : NULL;
return (_entity) ? _entity->_getQuark(_sharedPath) : NULL;
}
string Occurrence::GetName() const
string Occurrence::getName() const
// *******************************
{
string description;
if (_sharedPath)
description=_sharedPath->GetName()+SharedPath::GetNameSeparator();
description=_sharedPath->getName()+SharedPath::getNameSeparator();
if (Plug* plug= dynamic_cast<Plug*>(_entity))
description += plug->GetName();
description += plug->getName();
else if (Pin* pin= dynamic_cast<Pin*>(_entity))
description += GetString(pin->GetName());
description += getString(pin->getName());
else if (Net* net= dynamic_cast<Net*>(_entity))
description += GetString(net->GetName());
description += getString(net->getName());
else if (Cell* cell= dynamic_cast<Cell*>(_entity))
description += GetString(cell->GetName());
description += getString(cell->getName());
else if (Instance* instance= dynamic_cast<Instance*>(_entity))
description += GetString(instance->GetName());
description += getString(instance->getName());
else
description+= GetString(_entity);
//throw Error("[Occurrence::GetName] No Name for "+GetString(_entity));
description+= getString(_entity);
//throw Error("[Occurrence::getName] No Name for "+getString(_entity));
return description;
}

View File

@ -29,61 +29,61 @@ class Occurrence {
// Attributes
// **********
private: Entity* _entity;
private: SharedPath* _sharedPath;
private: Entity* _entity;
private: SharedPath* _sharedPath;
// Constructors
// ************
public: Occurrence(const Entity* entity = NULL);
public: Occurrence(const Entity* entity, const Path& path);
public: Occurrence(const Occurrence& occurrence);
public: Occurrence(const Entity* entity = NULL);
public: Occurrence(const Entity* entity, const Path& path);
public: Occurrence(const Occurrence& occurrence);
// Operators
// *********
public: Occurrence& operator=(const Occurrence& occurrence);
public: Occurrence& operator=(const Occurrence& occurrence);
public: bool operator==(const Occurrence& occurrence) const;
public: bool operator!=(const Occurrence& occurrence) const;
public: bool operator==(const Occurrence& occurrence) const;
public: bool operator!=(const Occurrence& occurrence) const;
public: bool operator<(const Occurrence& occurrence) const; // for stl set -> less predicate
public: bool operator<(const Occurrence& occurrence) const; // for stl set -> less predicate
// Accessors
// *********
public: Entity* GetEntity() const {return _entity;};
public: Path GetPath() const {return Path(_sharedPath);};
public: Cell* GetOwnerCell() const;
public: Cell* GetMasterCell() const;
public: Property* GetProperty(const Name& name) const;
public: Properties GetProperties() const;
public: Box GetBoundingBox() const;
public: Entity* getEntity() const {return _entity;};
public: Path getPath() const {return Path(_sharedPath);};
public: Cell* getOwnerCell() const;
public: Cell* getMasterCell() const;
public: Property* getProperty(const Name& name) const;
public: Properties getProperties() const;
public: Box getBoundingBox() const;
// Predicates
// **********
public: bool IsValid() const {return (_entity != NULL);};
public: bool HasProperty() const;
public: bool IsValid() const {return (_entity != NULL);};
public: bool HasProperty() const;
// Updators
// ********
public: void MakeInvalid();
public: void Put(Property* property);
public: void Remove(Property* property);
public: void RemoveProperty(const Name& name);
public: void ClearProperties();
public: void MakeInvalid();
public: void Put(Property* property);
public: void Remove(Property* property);
public: void RemoveProperty(const Name& name);
public: void ClearProperties();
// Others
// ******
public: string GetName() const;
public: string _GetTypeName() const { return _TName("Occurrence"); };
public: string _GetString() const;
public: Record* _GetRecord() const;
public: SharedPath* _GetSharedPath() const {return _sharedPath;};
public: Quark* _GetQuark() const;
public: string getName() const;
public: string _getTypeName() const { return _TName("Occurrence"); };
public: string _getString() const;
public: Record* _getRecord() const;
public: SharedPath* _getSharedPath() const {return _sharedPath;};
public: Quark* _getQuark() const;
};

View File

@ -45,10 +45,10 @@ typedef GenericFilter<Occurrence> OccurrenceFilter;
#define for_each_occurrence(occurrence, occurrences)\
/************************************************/\
{\
OccurrenceLocator _locator = occurrences.GetLocator();\
while (_locator.IsValid()) {\
Occurrence occurrence = _locator.GetElement();\
_locator.Progress();
OccurrenceLocator _locator = occurrences.getLocator();\
while (_locator.IsValid()) {\
Occurrence occurrence = _locator.getElement();\
_locator.Progress();

View File

@ -37,24 +37,24 @@ Pad* Pad::Create(Net* net, Layer* layer, const Box& boundingBox)
{
Pad* pad = new Pad(net, layer, boundingBox);
pad->_PostCreate();
pad->_postCreate();
return pad;
}
Unit Pad::GetX() const
Unit Pad::getX() const
// *******************
{
return 0;
}
Unit Pad::GetY() const
Unit Pad::getY() const
// *******************
{
return 0;
}
Box Pad::GetBoundingBox() const
Box Pad::getBoundingBox() const
// ****************************
{
Box boundingBox = _boundingBox;
@ -65,7 +65,7 @@ Box Pad::GetBoundingBox() const
return boundingBox;
}
Box Pad::GetBoundingBox(const BasicLayer* basicLayer) const
Box Pad::getBoundingBox(const BasicLayer* basicLayer) const
// **************************************************
{
if (!_layer->contains(basicLayer)) return Box();
@ -99,48 +99,26 @@ void Pad::SetBoundingBox(const Box& boundingBox)
}
}
string Pad::_GetString() const
string Pad::_getString() const
// ***************************
{
string s = Inherit::_GetString();
s.insert(s.length() - 1, " " + GetString(_layer->getName()));
s.insert(s.length() - 1, " " + GetString(_boundingBox));
string s = Inherit::_getString();
s.insert(s.length() - 1, " " + getString(_layer->getName()));
s.insert(s.length() - 1, " " + getString(_boundingBox));
return s;
}
Record* Pad::_GetRecord() const
Record* Pad::_getRecord() const
// **********************
{
Record* record = Inherit::_GetRecord();
Record* record = Inherit::_getRecord();
if (record) {
record->Add(GetSlot("Layer", _layer));
record->Add(GetSlot("BoundingBox", &_boundingBox));
record->Add(getSlot("Layer", _layer));
record->Add(getSlot("BoundingBox", &_boundingBox));
}
return record;
}
//void Pad::_Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation)
//// ****************************************************************************************************
//{
// Unit width = _boundingBox.GetWidth();
// Unit height = _boundingBox.GetHeight();
// if (1 < view->GetScreenSize(max(width, height))) {
// basicLayer->_Fill(view, transformation.GetBox(GetBoundingBox(basicLayer)));
// view->DrawRectangle(transformation.GetBox(GetBoundingBox(basicLayer))); // PROVISOIREMENT
// }
//}
//
//void Pad::_Highlight(View* view, const Box& updateArea, const Transformation& transformation)
//// ******************************************************************************************
//{
// for_each_basic_layer(basicLayer, GetLayer()->GetBasicLayers()) {
// basicLayer->_Fill(view, transformation.GetBox(GetBoundingBox(basicLayer)));
// view->DrawRectangle(transformation.GetBox(GetBoundingBox(basicLayer))); // PROVISOIREMENT
// end_for;
// }
//}
//
} // End of Hurricane namespace.
// ****************************************************************************************************

View File

@ -3,7 +3,6 @@
// Authors: R. Escassut
// Copyright (c) BULL S.A. 2000-2004, All Rights Reserved
// ****************************************************************************************************
// 21-10-2003 Alignment BULL-LIP6
#ifndef HURRICANE_PAD
#define HURRICANE_PAD
@ -27,45 +26,42 @@ class Pad : public Component {
// Types
// *****
public: typedef Component Inherit;
public: typedef Component Inherit;
// Attributes
// **********
private: Layer* _layer;
private: Box _boundingBox;
private: Layer* _layer;
private: Box _boundingBox;
// Constructors
// ************
protected: Pad(Net* net, Layer* layer, const Box& boundingBox);
protected: Pad(Net* net, Layer* layer, const Box& boundingBox);
public: static Pad* Create(Net* net, Layer* layer, const Box& boundingBox);
public: static Pad* Create(Net* net, Layer* layer, const Box& boundingBox);
// Accessors
// *********
public: virtual Unit GetX() const;
public: virtual Unit GetY() const;
public: virtual Box GetBoundingBox() const;
public: virtual Box GetBoundingBox(const BasicLayer* basicLayer) const;
public: virtual Layer* GetLayer() const {return _layer;};
public: virtual Unit getX() const;
public: virtual Unit getY() const;
public: virtual Box getBoundingBox() const;
public: virtual Box getBoundingBox(const BasicLayer* basicLayer) const;
public: virtual Layer* getLayer() const {return _layer;};
// Updators
// ********
public: virtual void Translate(const Unit& dx, const Unit& dy);
public: void SetBoundingBox(const Box& boundingBox);
public: virtual void Translate(const Unit& dx, const Unit& dy);
public: void SetBoundingBox(const Box& boundingBox);
// Others
// ******
public: virtual string _GetTypeName() const {return _TName("Pad");};
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
// public: virtual void _Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation);
// public: virtual void _Highlight(View* view, const Box& updateArea, const Transformation& transformation);
public: virtual string _getTypeName() const {return _TName("Pad");};
public: virtual string _getString() const;
public: virtual Record* _getRecord() const;
};

View File

@ -46,9 +46,9 @@ typedef GenericFilter<Pad*> PadFilter;
#define for_each_pad(pad, pads)\
/******************************/\
{\
PadLocator _locator = pads.GetLocator();\
PadLocator _locator = pads.getLocator();\
while (_locator.IsValid()) {\
Pad* pad = _locator.GetElement();\
Pad* pad = _locator.getElement();\
_locator.Progress();

View File

@ -28,63 +28,63 @@ Path::Path(Instance* instance)
// ***************************
: _sharedPath(NULL)
{
if (instance) {
_sharedPath = instance->_GetSharedPath(NULL);
if (!_sharedPath) _sharedPath = new SharedPath(instance);
}
if (instance) {
_sharedPath = instance->_getSharedPath(NULL);
if (!_sharedPath) _sharedPath = new SharedPath(instance);
}
}
Path::Path(Instance* headInstance, const Path& tailPath)
// *****************************************************
: _sharedPath(NULL)
{
if (!headInstance)
throw Error("Cant't create " + _TName("Path") + " : null head instance");
if (!headInstance)
throw Error("Cant't create " + _TName("Path") + " : null head instance");
if (!tailPath._GetSharedPath()) {
_sharedPath = headInstance->_GetSharedPath(NULL);
if (!_sharedPath) _sharedPath = new SharedPath(headInstance);
}
else {
SharedPath* tailSharedPath = tailPath._GetSharedPath();
if (tailSharedPath->GetOwnerCell() != headInstance->GetMasterCell())
throw Error("Cant't create " + _TName("Path") + " : incompatible tail path");
if (!tailPath._getSharedPath()) {
_sharedPath = headInstance->_getSharedPath(NULL);
if (!_sharedPath) _sharedPath = new SharedPath(headInstance);
}
else {
SharedPath* tailSharedPath = tailPath._getSharedPath();
if (tailSharedPath->getOwnerCell() != headInstance->getMasterCell())
throw Error("Cant't create " + _TName("Path") + " : incompatible tail path");
_sharedPath = headInstance->_GetSharedPath(tailSharedPath);
if (!_sharedPath) _sharedPath = new SharedPath(headInstance, tailSharedPath);
}
_sharedPath = headInstance->_getSharedPath(tailSharedPath);
if (!_sharedPath) _sharedPath = new SharedPath(headInstance, tailSharedPath);
}
}
Path::Path(const Path& headPath, Instance* tailInstance)
// *****************************************************
: _sharedPath(NULL)
{
if (!tailInstance)
throw Error("Cant't create " + _TName("Path") + " : null tail instance");
if (!tailInstance)
throw Error("Cant't create " + _TName("Path") + " : null tail instance");
if (!headPath._GetSharedPath()) {
_sharedPath = tailInstance->_GetSharedPath(NULL);
if (!_sharedPath) _sharedPath = new SharedPath(tailInstance);
}
else {
Instance* headInstance = headPath.GetHeadInstance();
SharedPath* tailSharedPath = Path(headPath.GetTailPath(), tailInstance)._GetSharedPath();
_sharedPath = headInstance->_GetSharedPath(tailSharedPath);
if (!_sharedPath) _sharedPath = new SharedPath(headInstance, tailSharedPath);
}
if (!headPath._getSharedPath()) {
_sharedPath = tailInstance->_getSharedPath(NULL);
if (!_sharedPath) _sharedPath = new SharedPath(tailInstance);
}
else {
Instance* headInstance = headPath.getHeadInstance();
SharedPath* tailSharedPath = Path(headPath.getTailPath(), tailInstance)._getSharedPath();
_sharedPath = headInstance->_getSharedPath(tailSharedPath);
if (!_sharedPath) _sharedPath = new SharedPath(headInstance, tailSharedPath);
}
}
Path::Path(const Path& headPath, const Path& tailPath)
// *****************************************************
: _sharedPath(tailPath._GetSharedPath())
: _sharedPath(tailPath._getSharedPath())
{
vector<Instance*> instances;
headPath.GetInstances().Fill(instances);
headPath.getInstances().Fill(instances);
for (vector<Instance*>::reverse_iterator rit=instances.rbegin() ; rit != instances.rend() ; rit++)
{ Instance* instance=*rit;
SharedPath* sharedPath = _sharedPath;
_sharedPath = instance->_GetSharedPath(sharedPath);
_sharedPath = instance->_getSharedPath(sharedPath);
if (!_sharedPath) _sharedPath = new SharedPath(instance,sharedPath);
}
}
@ -93,29 +93,29 @@ Path::Path(Cell* cell, const string& pathName)
// *******************************************
: _sharedPath(NULL)
{
if (cell) {
list<Instance*> instanceList;
string restOfPathName = pathName;
char nameSeparator = GetNameSeparator();
while (!restOfPathName.empty()) {
size_t pos = restOfPathName.find(nameSeparator);
Instance* instance = cell->GetInstance(restOfPathName.substr(0, pos));
if (!instance) throw Error("Cant't create " + _TName("Path") + " : invalid path name");
cell = instance->GetMasterCell();
restOfPathName = (pos == string::npos) ? string("") : restOfPathName.substr(pos + 1);
instanceList.push_back(instance);
}
if (!instanceList.empty()) {
list<Instance*>::reverse_iterator instanceIterator = instanceList.rbegin();
while (instanceIterator != instanceList.rend()) {
Instance* headInstance = *instanceIterator;
SharedPath* tailSharedPath = _sharedPath;
_sharedPath = headInstance->_GetSharedPath(tailSharedPath);
if (!_sharedPath) _sharedPath = new SharedPath(headInstance, tailSharedPath);
++instanceIterator;
}
}
}
if (cell) {
list<Instance*> instanceList;
string restOfPathName = pathName;
char nameSeparator = getNameSeparator();
while (!restOfPathName.empty()) {
size_t pos = restOfPathName.find(nameSeparator);
Instance* instance = cell->getInstance(restOfPathName.substr(0, pos));
if (!instance) throw Error("Cant't create " + _TName("Path") + " : invalid path name");
cell = instance->getMasterCell();
restOfPathName = (pos == string::npos) ? string("") : restOfPathName.substr(pos + 1);
instanceList.push_back(instance);
}
if (!instanceList.empty()) {
list<Instance*>::reverse_iterator instanceIterator = instanceList.rbegin();
while (instanceIterator != instanceList.rend()) {
Instance* headInstance = *instanceIterator;
SharedPath* tailSharedPath = _sharedPath;
_sharedPath = headInstance->_getSharedPath(tailSharedPath);
if (!_sharedPath) _sharedPath = new SharedPath(headInstance, tailSharedPath);
++instanceIterator;
}
}
}
}
Path::Path(const Path& path)
@ -132,127 +132,127 @@ Path::~Path()
Path& Path::operator=(const Path& path)
// ************************************
{
_sharedPath = path._sharedPath;
return *this;
_sharedPath = path._sharedPath;
return *this;
}
bool Path::operator==(const Path& path) const
// ******************************************
{
return (_sharedPath == path._sharedPath);
return (_sharedPath == path._sharedPath);
}
bool Path::operator!=(const Path& path) const
// ******************************************
{
return (_sharedPath != path._sharedPath);
return (_sharedPath != path._sharedPath);
}
bool Path::operator<(const Path& path) const
// *****************************************
{
return (_sharedPath < path._sharedPath);
return (_sharedPath < path._sharedPath);
}
Instance* Path::GetHeadInstance() const
Instance* Path::getHeadInstance() const
// ************************************
{
return (_sharedPath) ? _sharedPath->GetHeadInstance() : NULL;
return (_sharedPath) ? _sharedPath->getHeadInstance() : NULL;
}
Path Path::GetTailPath() const
Path Path::getTailPath() const
// ***************************
{
return Path((_sharedPath) ? _sharedPath->GetTailSharedPath() : NULL);
return Path((_sharedPath) ? _sharedPath->getTailSharedPath() : NULL);
}
Path Path::GetHeadPath() const
Path Path::getHeadPath() const
// ***************************
{
return Path((_sharedPath) ? _sharedPath->GetHeadSharedPath() : NULL);
return Path((_sharedPath) ? _sharedPath->getHeadSharedPath() : NULL);
}
Instance* Path::GetTailInstance() const
Instance* Path::getTailInstance() const
// ************************************
{
return (_sharedPath) ? _sharedPath->GetTailInstance() : NULL;
return (_sharedPath) ? _sharedPath->getTailInstance() : NULL;
}
char Path::GetNameSeparator()
char Path::getNameSeparator()
// **************************
{
return SharedPath::GetNameSeparator();
return SharedPath::getNameSeparator();
}
string Path::GetName() const
string Path::getName() const
// *************************
{
return (_sharedPath) ? _sharedPath->GetName() : string("");
return (_sharedPath) ? _sharedPath->getName() : string("");
}
Cell* Path::GetOwnerCell() const
Cell* Path::getOwnerCell() const
// *****************************
{
return (_sharedPath) ? _sharedPath->GetOwnerCell() : NULL;
return (_sharedPath) ? _sharedPath->getOwnerCell() : NULL;
}
Cell* Path::GetMasterCell() const
Cell* Path::getMasterCell() const
// ******************************
{
return (_sharedPath) ? _sharedPath->GetMasterCell() : NULL;
return (_sharedPath) ? _sharedPath->getMasterCell() : NULL;
}
Instances Path::GetInstances() const
Instances Path::getInstances() const
// *********************************
{
return (_sharedPath) ? _sharedPath->GetInstances() : Instances();
return (_sharedPath) ? _sharedPath->getInstances() : Instances();
}
Transformation Path::GetTransformation(const Transformation& transformation) const
Transformation Path::getTransformation(const Transformation& transformation) const
// *******************************************************************************
{
return (_sharedPath) ? _sharedPath->GetTransformation(transformation) : transformation;
return (_sharedPath) ? _sharedPath->getTransformation(transformation) : transformation;
}
bool Path::IsEmpty() const
// ***********************
{
return (_sharedPath == NULL);
return (_sharedPath == NULL);
}
void Path::MakeEmpty()
// *******************
{
_sharedPath = NULL;
_sharedPath = NULL;
}
void Path::SetNameSeparator(char nameSeparator)
// ********************************************
{
SharedPath::SetNameSeparator(nameSeparator);
SharedPath::SetNameSeparator(nameSeparator);
}
string Path::_GetString() const
string Path::_getString() const
// ****************************
{
string s = "<" + _TName("Path");
if (!_sharedPath)
s += " empty";
else
s += " " + GetString(GetName());
s += ">";
return s;
string s = "<" + _TName("Path");
if (!_sharedPath)
s += " empty";
else
s += " " + getString(getName());
s += ">";
return s;
}
Record* Path::_GetRecord() const
Record* Path::_getRecord() const
// ***********************
{
Record* record = NULL;
if (_sharedPath) {
record = new Record(GetString(this));
record->Add(GetSlot("SharedPath", _sharedPath));
}
return record;
Record* record = NULL;
if (_sharedPath) {
record = new Record(getString(this));
record->Add(getSlot("SharedPath", _sharedPath));
}
return record;
}

View File

@ -27,68 +27,68 @@ class Path {
// Attributes
// **********
private: SharedPath* _sharedPath;
private: SharedPath* _sharedPath;
// Constructors
// ************
public: Path(SharedPath* sharedPath = NULL);
public: Path(Instance* instance);
public: Path(Instance* headInstance, const Path& tailPath);
public: Path(const Path& headPath, Instance* tailInstance);
public: Path(Cell* cell, const string& pathName);
public: Path(SharedPath* sharedPath = NULL);
public: Path(Instance* instance);
public: Path(Instance* headInstance, const Path& tailPath);
public: Path(const Path& headPath, Instance* tailInstance);
public: Path(Cell* cell, const string& pathName);
public: Path(const Path& headPath, const Path& tailPath);
public: Path(const Path& path);
public: Path(const Path& path);
// Destructor
// **********
public: ~Path();
public: ~Path();
// Operators
// *********
public: Path& operator=(const Path& path);
public: Path& operator=(const Path& path);
public: bool operator==(const Path& path) const;
public: bool operator!=(const Path& path) const;
public: bool operator==(const Path& path) const;
public: bool operator!=(const Path& path) const;
public: bool operator<(const Path& path) const; // for stl set -> less predicate
public: bool operator<(const Path& path) const; // for stl set -> less predicate
// Accessors
// *********
public: static char GetNameSeparator();
public: static char getNameSeparator();
public: Instance* GetHeadInstance() const;
public: Path GetTailPath() const;
public: Path GetHeadPath() const;
public: Instance* GetTailInstance() const;
public: string GetName() const;
public: Cell* GetOwnerCell() const;
public: Cell* GetMasterCell() const;
public: Instances GetInstances() const;
public: Transformation GetTransformation(const Transformation& transformation = Transformation()) const;
public: Instance* getHeadInstance() const;
public: Path getTailPath() const;
public: Path getHeadPath() const;
public: Instance* getTailInstance() const;
public: string getName() const;
public: Cell* getOwnerCell() const;
public: Cell* getMasterCell() const;
public: Instances getInstances() const;
public: Transformation getTransformation(const Transformation& transformation = Transformation()) const;
// Predicates
// **********
public: bool IsEmpty() const;
public: bool IsEmpty() const;
// Updators
// ********
public: void MakeEmpty();
public: static void SetNameSeparator(char nameSeparator);
public: void MakeEmpty();
public: static void SetNameSeparator(char nameSeparator);
// Others
// ******
public: string _GetTypeName() const { return _TName("Occurrence"); };
public: string _GetString() const;
public: Record* _GetRecord() const;
public: string _getTypeName() const { return _TName("Occurrence"); };
public: string _getString() const;
public: Record* _getRecord() const;
public: SharedPath* _GetSharedPath() const {return _sharedPath;};
public: SharedPath* _getSharedPath() const {return _sharedPath;};
};

View File

@ -45,9 +45,9 @@ typedef GenericFilter<Path> PathFilter;
#define for_each_path(path, pathes)\
/**********************************/\
{\
PathLocator _locator = pathes.GetLocator();\
PathLocator _locator = pathes.getLocator();\
while (_locator.IsValid()) {\
Path path = _locator.GetElement();\
Path path = _locator.getElement();\
_locator.Progress();

View File

@ -22,132 +22,132 @@ namespace Hurricane {
Pin::Pin(Net* net, const Name& name, const AccessDirection& accessDirection, const PlacementStatus& placementStatus, Layer* layer, const Unit& x, const Unit& y, const Unit& width, const Unit& height)
// ****************************************************************************************************
: Inherit(net, layer, x, y, width, height),
_name(name),
_accessDirection(accessDirection),
_name(name),
_accessDirection(accessDirection),
_placementStatus(placementStatus),
_nextOfCellPinMap(NULL)
_nextOfCellPinMap(NULL)
{
if (GetCell()->GetPin(name))
throw Error("Can't create " + _TName("Pin") + " : already exists");
if (getCell()->getPin(name))
throw Error("Can't create " + _TName("Pin") + " : already exists");
}
Pin* Pin::Create(Net* net, const Name& name, const AccessDirection& accessDirection, const PlacementStatus& placementStatus, Layer* layer, const Unit& x, const Unit& y, const Unit& width, const Unit& height)
// ****************************************************************************************************
{
if (!net)
throw Error("Can't create " + _TName("Pin") + " : NULL net");
if (!layer)
throw Error("Can't create " + _TName("Pin") + " : NULL layer");
if (!net)
throw Error("Can't create " + _TName("Pin") + " : NULL net");
if (!layer)
throw Error("Can't create " + _TName("Pin") + " : NULL layer");
Pin* pin = new Pin(net, name, accessDirection, placementStatus, layer, x, y, width, height);
Pin* pin = new Pin(net, name, accessDirection, placementStatus, layer, x, y, width, height);
pin->_PostCreate();
pin->_postCreate();
return pin;
return pin;
}
void Pin::SetPlacementStatus(const PlacementStatus& placementstatus)
// **********************************************************************
{
if (placementstatus != _placementStatus) {
Invalidate(true);
if (placementstatus != _placementStatus) {
Invalidate(true);
_placementStatus = placementstatus;
}
}
}
void Pin::_PostCreate()
void Pin::_postCreate()
// **********************
{
GetCell()->_GetPinMap()._Insert(this);
getCell()->_getPinMap()._Insert(this);
Inherit::_PostCreate();
Inherit::_postCreate();
}
void Pin::_PreDelete()
void Pin::_preDestroy()
// *********************
{
Inherit::_PreDelete();
Inherit::_preDestroy();
GetCell()->_GetPinMap()._Remove(this);
getCell()->_getPinMap()._Remove(this);
}
string Pin::_GetString() const
string Pin::_getString() const
// *****************************
{
string s = Inherit::_GetString();
s.insert(s.length() - 1, " " + GetString(_name));
s.insert(s.length() - 1, " " + GetString(_accessDirection));
return s;
string s = Inherit::_getString();
s.insert(s.length() - 1, " " + getString(_name));
s.insert(s.length() - 1, " " + getString(_accessDirection));
return s;
}
Record* Pin::_GetRecord() const
Record* Pin::_getRecord() const
// ************************
{
Record* record = Inherit::_GetRecord();
if (record) {
record->Add(GetSlot("Name", &_name));
record->Add(GetSlot("AccessDirection", &_accessDirection));
record->Add(GetSlot("PlacementStatus", &_placementStatus));
}
return record;
Record* record = Inherit::_getRecord();
if (record) {
record->Add(getSlot("Name", &_name));
record->Add(getSlot("AccessDirection", &_accessDirection));
record->Add(getSlot("PlacementStatus", &_placementStatus));
}
return record;
}
//void Pin::_Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation)
//// *************************************************************************************************************
//{
// view->FillRectangle(transformation.GetBox(GetBoundingBox(basicLayer)), true);
// view->FillRectangle(transformation.getBox(getBoundingBox(basicLayer)), true);
//}
//
//void Pin::_Highlight(View* view, const Box& updateArea, const Transformation& transformation)
//// ******************************************************************************************
//{
// if (_width && _height) {
// if (1 < view->GetScreenSize(max(_width, _height))) {
// for_each_basic_layer(basicLayer, GetLayer()->GetBasicLayers()) {
// basicLayer->_Fill(view, transformation.GetBox(GetBoundingBox(basicLayer)));
// end_for;
// }
// }
// }
// if (view->GetScale() <= 1)
// view->DrawPoint(transformation.GetPoint(GetPosition()), 1);
// else if (view->GetScale() <= 3)
// if (_width && _height) {
// if (1 < view->getScreenSize(max(_width, _height))) {
// for_each_basic_layer(basicLayer, getLayer()->getBasicLayers()) {
// basicLayer->_Fill(view, transformation.getBox(getBoundingBox(basicLayer)));
// end_for;
// }
// }
// }
// if (view->getScale() <= 1)
// view->DrawPoint(transformation.getPoint(getPosition()), 1);
// else if (view->getScale() <= 3)
// {
// view->DrawPoint(transformation.GetPoint(GetPosition()), 2);
// view->DrawPoint(transformation.getPoint(getPosition()), 2);
//
// if ( view->IsTextVisible() )
// {
// string text = "("
// + GetString ( GetValue ( GetX() ) ) + ","
// + GetString ( GetValue ( GetY() ) ) + ")";
// + getString ( getValue ( getX() ) ) + ","
// + getString ( getValue ( getY() ) ) + ")";
// view->DrawString ( text,
// transformation.GetBox ( GetBoundingBox() ).GetXMin(),
// transformation.GetBox ( GetBoundingBox() ).GetYMax() );
// transformation.getBox ( getBoundingBox() ).getXMin(),
// transformation.getBox ( getBoundingBox() ).getYMax() );
// }
// }
// else {
// Point position = GetPosition();
// view->DrawPoint(transformation.GetPoint(position), 3);
// if (_width) {
// Box box = transformation.GetBox(Box(position).Inflate(GetHalfWidth(), 0));
// view->DrawLine(box.GetXMin(), box.GetYMin(), box.GetXMax(), box.GetYMax());
// }
// if (_height) {
// Box box = transformation.GetBox(Box(position).Inflate(0, GetHalfHeight()));
// view->DrawLine(box.GetXMin(), box.GetYMin(), box.GetXMax(), box.GetYMax());
// }
// else {
// Point position = getPosition();
// view->DrawPoint(transformation.getPoint(position), 3);
// if (_width) {
// Box box = transformation.getBox(Box(position).Inflate(getHalfWidth(), 0));
// view->DrawLine(box.getXMin(), box.getYMin(), box.getXMax(), box.getYMax());
// }
// if (_height) {
// Box box = transformation.getBox(Box(position).Inflate(0, getHalfHeight()));
// view->DrawLine(box.getXMin(), box.getYMin(), box.getXMax(), box.getYMax());
// }
//
// if ( view->IsTextVisible() )
// {
// string text = GetString ( _name ) + "("
// + GetString ( GetValue ( GetX() ) ) + ","
// + GetString ( GetValue ( GetY() ) ) + ")";
// string text = getString ( _name ) + "("
// + getString ( getValue ( getX() ) ) + ","
// + getString ( getValue ( getY() ) ) + ")";
// view->DrawString ( text,
// transformation.GetBox ( GetBoundingBox() ).GetXMin(),
// transformation.GetBox ( GetBoundingBox() ).GetYMax() );
// transformation.getBox ( getBoundingBox() ).getXMin(),
// transformation.getBox ( getBoundingBox() ).getYMax() );
// }
// }
// }
//}
//
@ -157,42 +157,42 @@ Record* Pin::_GetRecord() const
Pin::AccessDirection::AccessDirection(const Code& code)
// ******************************************************
: _code(code)
: _code(code)
{
}
Pin::AccessDirection::AccessDirection(const AccessDirection& accessDirection)
// ****************************************************************************
: _code(accessDirection._code)
: _code(accessDirection._code)
{
}
Pin::AccessDirection& Pin::AccessDirection::operator=(const AccessDirection& accessDirection)
// **********************************************************************************************
{
_code = accessDirection._code;
return *this;
_code = accessDirection._code;
return *this;
}
string Pin::AccessDirection::_GetString() const
string Pin::AccessDirection::_getString() const
// **********************************************
{
switch (_code) {
case UNDEFINED : return "UNDEFINED";
case NORTH : return "NORTH";
case SOUTH : return "SOUTH";
case WEST : return "WEST";
case EAST : return "EAST";
}
return "ABNORMAL";
switch (_code) {
case UNDEFINED : return "UNDEFINED";
case NORTH : return "NORTH";
case SOUTH : return "SOUTH";
case WEST : return "WEST";
case EAST : return "EAST";
}
return "ABNORMAL";
}
Record* Pin::AccessDirection::_GetRecord() const
Record* Pin::AccessDirection::_getRecord() const
// *****************************************
{
Record* record = new Record(GetString(this));
record->Add(GetSlot("Code", (int)_code));
return record;
Record* record = new Record(getString(this));
record->Add(getSlot("Code", (int)_code));
return record;
}
@ -203,13 +203,13 @@ Record* Pin::AccessDirection::_GetRecord() const
Pin::PlacementStatus::PlacementStatus(const Code& code)
// ****************************************************
: _code(code)
: _code(code)
{
}
Pin::PlacementStatus::PlacementStatus(const PlacementStatus& placementstatus)
// **************************************************************************
: _code(placementstatus._code)
: _code(placementstatus._code)
{
}
@ -217,26 +217,26 @@ Pin::PlacementStatus& Pin::PlacementStatus::operator=(const PlacementStatus& pla
// ******************************************************************************************
{
_code = placementstatus._code;
return *this;
return *this;
}
string Pin::PlacementStatus::_GetString() const
string Pin::PlacementStatus::_getString() const
// ********************************************
{
switch (_code) {
case UNPLACED : return "UNPLACED";
case PLACED : return "PLACED";
case FIXED : return "FIXED";
}
return "ABNORMAL";
switch (_code) {
case UNPLACED : return "UNPLACED";
case PLACED : return "PLACED";
case FIXED : return "FIXED";
}
return "ABNORMAL";
}
Record* Pin::PlacementStatus::_GetRecord() const
Record* Pin::PlacementStatus::_getRecord() const
// ***************************************
{
Record* record = new Record(GetString(this));
record->Add(GetSlot("Code", (int)_code));
return record;
Record* record = new Record(getString(this));
record->Add(getSlot("Code", (int)_code));
return record;
}

View File

@ -28,103 +28,100 @@ class Pin : public Contact {
// Types
// *****
public: typedef Contact Inherit;
public: typedef Contact Inherit;
public: class AccessDirection {
// **************************
public: class AccessDirection {
// **************************
public: enum Code {UNDEFINED=0, NORTH=1, SOUTH=2, EAST=3, WEST=4};
public: enum Code {UNDEFINED=0, NORTH=1, SOUTH=2, EAST=3, WEST=4};
private: Code _code;
private: Code _code;
public: AccessDirection(const Code& code = UNDEFINED);
public: AccessDirection(const AccessDirection& accessDirection);
public: AccessDirection(const Code& code = UNDEFINED);
public: AccessDirection(const AccessDirection& accessDirection);
public: AccessDirection& operator=(const AccessDirection& accessDirection);
public: AccessDirection& operator=(const AccessDirection& accessDirection);
public: operator const Code&() const {return _code;};
public: operator const Code&() const {return _code;};
public: const Code& GetCode() const {return _code;};
public: const Code& getCode() const {return _code;};
public: string _GetTypeName() const { return _TName("Pin::AccessDirection"); };
public: string _GetString() const;
public: Record* _GetRecord() const;
public: string _getTypeName() const { return _TName("Pin::AccessDirection"); };
public: string _getString() const;
public: Record* _getRecord() const;
};
};
public: class PlacementStatus {
// **************************
public: class PlacementStatus {
// **************************
public: enum Code {UNPLACED=0, PLACED=1, FIXED=2};
public: enum Code {UNPLACED=0, PLACED=1, FIXED=2};
private: Code _code;
private: Code _code;
public: PlacementStatus(const Code& code = UNPLACED);
public: PlacementStatus(const PlacementStatus& placementstatus);
public: PlacementStatus(const Code& code = UNPLACED);
public: PlacementStatus(const PlacementStatus& placementstatus);
public: PlacementStatus& operator=(const PlacementStatus& placementstatus);
public: PlacementStatus& operator=(const PlacementStatus& placementstatus);
public: operator const Code&() const {return _code;};
public: operator const Code&() const {return _code;};
public: const Code& GetCode() const {return _code;};
public: const Code& getCode() const {return _code;};
public: string _GetTypeName() const { return _TName("Pin::PlacementStatus"); };
public: string _GetString() const;
public: Record* _GetRecord() const;
public: string _getTypeName() const { return _TName("Pin::PlacementStatus"); };
public: string _getString() const;
public: Record* _getRecord() const;
};
};
// Attributes
// **********
private: Name _name;
private: AccessDirection _accessDirection;
private: PlacementStatus _placementStatus;
private: Pin* _nextOfCellPinMap;
private: Name _name;
private: AccessDirection _accessDirection;
private: PlacementStatus _placementStatus;
private: Pin* _nextOfCellPinMap;
// Constructors
// ************
protected: Pin(Net* net, const Name& name, const AccessDirection& accessDirection, const PlacementStatus& placementStatus, Layer* layer, const Unit& x, const Unit& y, const Unit& width = 0, const Unit& height = 0);
protected: Pin(Net* net, const Name& name, const AccessDirection& accessDirection, const PlacementStatus& placementStatus, Layer* layer, const Unit& x, const Unit& y, const Unit& width = 0, const Unit& height = 0);
public: static Pin* Create(Net* net, const Name& name, const AccessDirection& accessDirection, const PlacementStatus& placementStatus, Layer* layer, const Unit& x, const Unit& y, const Unit& width = 0, const Unit& height = 0);
public: static Pin* Create(Net* net, const Name& name, const AccessDirection& accessDirection, const PlacementStatus& placementStatus, Layer* layer, const Unit& x, const Unit& y, const Unit& width = 0, const Unit& height = 0);
// Accessors
// *********
public: const Name& GetName() const {return _name;};
public: const AccessDirection& GetAccessDirection() const {return _accessDirection;};
public: const PlacementStatus& GetPlacementStatus() const {return _placementStatus;};
public: const Name& getName() const {return _name;};
public: const AccessDirection& getAccessDirection() const {return _accessDirection;};
public: const PlacementStatus& getPlacementStatus() const {return _placementStatus;};
// Predicates
// **********
public: bool IsUnplaced() const {return _placementStatus == PlacementStatus::UNPLACED;};
public: bool IsPlaced() const {return _placementStatus == PlacementStatus::PLACED;};
public: bool IsFixed() const {return _placementStatus == PlacementStatus::FIXED;};
public: bool IsFixed() const {return _placementStatus == PlacementStatus::FIXED;};
// Updators
// ********
public: void SetPlacementStatus(const PlacementStatus& placementstatus);
public: void SetPlacementStatus(const PlacementStatus& placementstatus);
// Others
// ******
protected: virtual void _PostCreate();
protected: virtual void _postCreate();
protected: virtual void _PreDelete();
protected: virtual void _preDestroy();
public: virtual string _GetTypeName() const {return _TName("Pin");};
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: virtual string _getTypeName() const {return _TName("Pin");};
public: virtual string _getString() const;
public: virtual Record* _getRecord() const;
public: Pin* _GetNextOfCellPinMap() const {return _nextOfCellPinMap;};
public: Pin* _getNextOfCellPinMap() const {return _nextOfCellPinMap;};
public: void _SetNextOfCellPinMap(Pin* pin) {_nextOfCellPinMap = pin;};
//public: virtual void _Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation);
//public: virtual void _Highlight(View* view, const Box& updateArea, const Transformation& transformation);
public: void _SetNextOfCellPinMap(Pin* pin) {_nextOfCellPinMap = pin;};
};

View File

@ -50,9 +50,9 @@ typedef GenericFilter<Pin*> PinFilter;
#define for_each_pin(pin, pins)\
/******************************/\
{\
PinLocator _locator = pins.GetLocator();\
PinLocator _locator = pins.getLocator();\
while (_locator.IsValid()) {\
Pin* pin = _locator.GetElement();\
Pin* pin = _locator.getElement();\
_locator.Progress();

View File

@ -27,11 +27,11 @@ class Plug_IsConnectedFilter : public Filter<Plug*> {
public: Plug_IsConnectedFilter& operator=(const Plug_IsConnectedFilter& filter) {return *this;};
public: virtual Filter<Plug*>* GetClone() const {return new Plug_IsConnectedFilter(*this);};
public: virtual Filter<Plug*>* getClone() const {return new Plug_IsConnectedFilter(*this);};
public: virtual bool Accept(Plug* plug) const {return plug->IsConnected();};
public: virtual string _GetString() const {return "<" + _TName("Plug::IsConnectedFilter>");};
public: virtual string _getString() const {return "<" + _TName("Plug::IsConnectedFilter>");};
};
@ -54,65 +54,65 @@ Plug::Plug(Instance* instance, Net* masterNet)
if (!_masterNet)
throw Error("Can't create " + _TName("Plug") + " : null master net");
if (_masterNet->GetCell() != _instance->GetMasterCell())
if (_masterNet->getCell() != _instance->getMasterCell())
throw Error("Can't create " + _TName("Plug") + " : incompatible master net");
if (!_masterNet->IsExternal())
throw Error("Can't create " + _TName("Plug") + " : not an external master net");
if (_instance->GetPlug(_masterNet))
if (_instance->getPlug(_masterNet))
throw Error("Can't create " + _TName("Plug") + " : already exists");
}
void Plug::Delete()
void Plug::destroy()
// ****************
{
throw Error("Abnormal deletion of " + _TName("Plug"));
}
Cell* Plug::GetCell() const
Cell* Plug::getCell() const
// ************************
{
return _instance->GetCell();
return _instance->getCell();
}
Unit Plug::GetX() const
Unit Plug::getX() const
// ********************
{
return _instance->GetTransformation().getX(_masterNet->GetPosition());
return _instance->getTransformation().getX(_masterNet->getPosition());
}
Unit Plug::GetY() const
Unit Plug::getY() const
// ********************
{
return _instance->GetTransformation().getY(_masterNet->GetPosition());
return _instance->getTransformation().getY(_masterNet->getPosition());
}
Point Plug::GetPosition() const
Point Plug::getPosition() const
// ****************************
{
return _instance->GetTransformation().getPoint(_masterNet->GetPosition());
return _instance->getTransformation().getPoint(_masterNet->getPosition());
}
Box Plug::GetBoundingBox() const
Box Plug::getBoundingBox() const
// *****************************
{
return _instance->GetTransformation().getBox(_masterNet->GetPosition());
return _instance->getTransformation().getBox(_masterNet->getPosition());
}
Box Plug::GetBoundingBox(const BasicLayer* basicLayer) const
Box Plug::getBoundingBox(const BasicLayer* basicLayer) const
// ***************************************************
{
return Box();
}
PlugFilter Plug::GetIsConnectedFilter()
PlugFilter Plug::getIsConnectedFilter()
// ************************************
{
return Plug_IsConnectedFilter();
}
PlugFilter Plug::GetIsUnconnectedFilter()
PlugFilter Plug::getIsUnconnectedFilter()
// **************************************
{
return !Plug_IsConnectedFilter();
@ -131,12 +131,12 @@ void Plug::Unmaterialize()
void Plug::SetNet(Net* net)
// ************************
{
if (net != GetNet()) {
if (net != getNet()) {
if (net && (GetCell() != net->GetCell()))
throw Error("Can't change net of plug : net : " + GetString(net) + "does not belong to the cell : " + GetString(GetCell()));
if (net && (getCell() != net->getCell()))
throw Error("Can't change net of plug : net : " + getString(net) + "does not belong to the cell : " + getString(getCell()));
if (!GetBodyHook()->GetSlaveHooks().IsEmpty())
if (!getBodyHook()->getSlaveHooks().IsEmpty())
throw Error("Can't change net of plug : not empty slave hooks");
_SetNet(net);
@ -148,66 +148,66 @@ Plug* Plug::_Create(Instance* instance, Net* masterNet)
{
Plug* plug = new Plug(instance, masterNet);
plug->_PostCreate();
plug->_postCreate();
return plug;
}
void Plug::_PostCreate()
void Plug::_postCreate()
// *********************
{
_instance->_GetPlugMap()._Insert(this);
_instance->_getPlugMap()._Insert(this);
Inherit::_PostCreate();
Inherit::_postCreate();
}
void Plug::_Delete()
void Plug::_destroy()
// *****************
{
_PreDelete();
_preDestroy();
delete this;
}
void Plug::_PreDelete()
void Plug::_preDestroy()
// ********************
{
// trace << "entering Plug::_PreDelete: " << this << endl;
// trace << "entering Plug::_preDestroy: " << this << endl;
// trace_in();
Inherit::_PreDelete();
Inherit::_preDestroy();
_instance->_GetPlugMap()._Remove(this);
_instance->_getPlugMap()._Remove(this);
// trace << "exiting Plug::_PreDelete:" << endl;
// trace << "exiting Plug::_preDestroy:" << endl;
// trace_out();
}
string Plug::_GetString() const
string Plug::_getString() const
// ****************************
{
string s = Inherit::_GetString();
s.insert(s.length() - 1, " " + GetName());
string s = Inherit::_getString();
s.insert(s.length() - 1, " " + getName());
return s;
}
Record* Plug::_GetRecord() const
Record* Plug::_getRecord() const
// ***********************
{
Record* record = Inherit::_GetRecord();
Record* record = Inherit::_getRecord();
if (record) {
record->Add(GetSlot("Instance", _instance));
record->Add(GetSlot("MasterNet", _masterNet));
record->Add(getSlot("Instance", _instance));
record->Add(getSlot("MasterNet", _masterNet));
}
return record;
}
string Plug::GetName() const
string Plug::getName() const
// *************************
{
return GetString(_instance->GetName())
return getString(_instance->getName())
+ "."
+ GetString(_masterNet->GetName());
+ getString(_masterNet->getName());
}
} // End of Hurricane namespace.

View File

@ -27,79 +27,76 @@ class Plug : public Component {
// Types
// *****
public: typedef Component Inherit;
public: typedef Component Inherit;
// Attributes
// **********
private: Instance* _instance;
private: Net* _masterNet;
private: Plug* _nextOfInstancePlugMap;
private: Instance* _instance;
private: Net* _masterNet;
private: Plug* _nextOfInstancePlugMap;
// Constructors
// ************
protected: Plug(Instance* instance, Net* masterNet);
protected: Plug(Instance* instance, Net* masterNet);
// Destructor
// **********
public: virtual void Delete();
public: virtual void destroy();
// Accessors
// *********
public: virtual Cell* GetCell() const;
public: virtual Unit GetX() const;
public: virtual Unit GetY() const;
public: virtual Point GetPosition() const;
public: virtual Box GetBoundingBox() const;
public: virtual Layer* GetLayer() const {return NULL;};
public: virtual Box GetBoundingBox(const BasicLayer* basicLayer) const;
public: Instance* GetInstance() const {return _instance;};
public: Net* GetMasterNet() const {return _masterNet;};
public: virtual Cell* getCell() const;
public: virtual Unit getX() const;
public: virtual Unit getY() const;
public: virtual Point getPosition() const;
public: virtual Box getBoundingBox() const;
public: virtual Layer* getLayer() const {return NULL;};
public: virtual Box getBoundingBox(const BasicLayer* basicLayer) const;
public: Instance* getInstance() const {return _instance;};
public: Net* getMasterNet() const {return _masterNet;};
// Filters
// *******
public: static PlugFilter GetIsConnectedFilter();
public: static PlugFilter GetIsUnconnectedFilter();
public: static PlugFilter getIsConnectedFilter();
public: static PlugFilter getIsUnconnectedFilter();
// Predicates
// **********
public: bool IsConnected() const {return (GetNet() != NULL);};
public: bool IsConnected() const {return (getNet() != NULL);};
// Updators
// ********
public: virtual void Translate(const Unit& dx, const Unit& dy) {};
public: virtual void Translate(const Unit& dx, const Unit& dy) {};
public: void SetNet(Net* net);
public: void SetNet(Net* net);
public: virtual void Materialize();
public: virtual void Unmaterialize();
public: virtual void Materialize();
public: virtual void Unmaterialize();
// Others
// ******
public: static Plug* _Create(Instance* instance, Net* masterNet);
protected: virtual void _PostCreate();
public: static Plug* _Create(Instance* instance, Net* masterNet);
protected: virtual void _postCreate();
public: void _Delete();
protected: virtual void _PreDelete();
public: void _destroy();
protected: virtual void _preDestroy();
public: virtual string GetName() const;
public: virtual string _GetTypeName() const {return _TName("Plug");};
public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const;
public: Plug* _GetNextOfInstancePlugMap() const {return _nextOfInstancePlugMap;};
public: virtual string getName() const;
public: virtual string _getTypeName() const {return _TName("Plug");};
public: virtual string _getString() const;
public: virtual Record* _getRecord() const;
public: Plug* _getNextOfInstancePlugMap() const {return _nextOfInstancePlugMap;};
public: virtual void _SetMasterNet(Net* masterNet) {_masterNet = masterNet;};
public: void _SetNextOfInstancePlugMap(Plug* plug) {_nextOfInstancePlugMap = plug;};
//public: virtual void _Draw(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation) {};
//public: virtual void _Highlight(View* view, const Box& updateArea, const Transformation& transformation) {};
public: virtual void _SetMasterNet(Net* masterNet) {_masterNet = masterNet;};
public: void _SetNextOfInstancePlugMap(Plug* plug) {_nextOfInstancePlugMap = plug;};
};

Some files were not shown because too many files have changed in this diff Show More