light modifications
This commit is contained in:
parent
8852389baa
commit
6a98b38248
|
@ -149,7 +149,7 @@ void Cell::flattenNets(bool buildRings)
|
||||||
cerr << "[ERROR] " << primaryPlug << "\n"
|
cerr << "[ERROR] " << primaryPlug << "\n"
|
||||||
<< " has attached components, not managed yet." << endl;
|
<< " has attached components, not managed yet." << endl;
|
||||||
} else {
|
} else {
|
||||||
primaryPlug->getBodyHook()->Detach ();
|
primaryPlug->getBodyHook()->detach ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end_for
|
end_for
|
||||||
|
@ -160,12 +160,12 @@ void Cell::flattenNets(bool buildRings)
|
||||||
currentRP->materialize ();
|
currentRP->materialize ();
|
||||||
if ( buildRings ) {
|
if ( buildRings ) {
|
||||||
if ( previousRP ) {
|
if ( previousRP ) {
|
||||||
currentRP->getBodyHook()->Attach ( previousRP->getBodyHook() );
|
currentRP->getBodyHook()->attach ( previousRP->getBodyHook() );
|
||||||
}
|
}
|
||||||
Plug* plug = static_cast<Plug*>( plugOccurrence.getEntity() );
|
Plug* plug = static_cast<Plug*>( plugOccurrence.getEntity() );
|
||||||
if ( plugOccurrence.getPath().isEmpty() ) {
|
if ( plugOccurrence.getPath().isEmpty() ) {
|
||||||
plug->getBodyHook()->Attach ( currentRP->getBodyHook() );
|
plug->getBodyHook()->attach ( currentRP->getBodyHook() );
|
||||||
plug->getBodyHook()->Detach ();
|
plug->getBodyHook()->detach ();
|
||||||
}
|
}
|
||||||
previousRP = currentRP;
|
previousRP = currentRP;
|
||||||
}
|
}
|
||||||
|
@ -179,10 +179,10 @@ void Cell::flattenNets(bool buildRings)
|
||||||
currentRP = createRoutingPad ( pin );
|
currentRP = createRoutingPad ( pin );
|
||||||
if ( buildRings ) {
|
if ( buildRings ) {
|
||||||
if ( previousRP ) {
|
if ( previousRP ) {
|
||||||
currentRP->getBodyHook()->Attach ( previousRP->getBodyHook() );
|
currentRP->getBodyHook()->attach ( previousRP->getBodyHook() );
|
||||||
}
|
}
|
||||||
pin->getBodyHook()->Attach ( currentRP->getBodyHook() );
|
pin->getBodyHook()->attach ( currentRP->getBodyHook() );
|
||||||
pin->getBodyHook()->Detach ();
|
pin->getBodyHook()->detach ();
|
||||||
}
|
}
|
||||||
previousRP = currentRP;
|
previousRP = currentRP;
|
||||||
}
|
}
|
||||||
|
|
|
@ -390,11 +390,11 @@ void Component::_preDestroy()
|
||||||
component->unmaterialize();
|
component->unmaterialize();
|
||||||
for_each_hook(hook, component->getHooks()) {
|
for_each_hook(hook, component->getHooks()) {
|
||||||
for_each_hook(hook, hook->getHooks()) {
|
for_each_hook(hook, hook->getHooks()) {
|
||||||
if (hook->IsMaster() && (componentSet.find(hook->getComponent()) == componentSet.end()))
|
if (hook->isMaster() && (componentSet.find(hook->getComponent()) == componentSet.end()))
|
||||||
masterHookSet.insert(hook);
|
masterHookSet.insert(hook);
|
||||||
end_for;
|
end_for;
|
||||||
}
|
}
|
||||||
if (!hook->IsMaster()) hook->Detach();
|
if (!hook->isMaster()) hook->detach();
|
||||||
end_for;
|
end_for;
|
||||||
}
|
}
|
||||||
end_for;
|
end_for;
|
||||||
|
@ -430,7 +430,7 @@ void Component::_preDestroy()
|
||||||
}
|
}
|
||||||
/**/
|
/**/
|
||||||
|
|
||||||
_bodyHook.Detach();
|
_bodyHook.detach();
|
||||||
|
|
||||||
Inherit::_preDestroy();
|
Inherit::_preDestroy();
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ class Component : public Go {
|
||||||
|
|
||||||
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 _getTypeName() const { return _TName("Component::BodyHook"); };
|
||||||
public: virtual string _getString() const;
|
public: virtual string _getString() const;
|
||||||
|
|
|
@ -122,7 +122,7 @@ Contact::Contact(Net* net, Component* anchor, Layer* layer, const Unit& dx, cons
|
||||||
if (!_layer)
|
if (!_layer)
|
||||||
throw Error("Can't create " + _TName("Contact") + " : null 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::create(Net* net, Layer* layer, const Unit& x, const Unit& y, const Unit& width, const Unit& height)
|
||||||
|
@ -308,7 +308,7 @@ void Contact::_preDestroy()
|
||||||
|
|
||||||
Inherit::_preDestroy();
|
Inherit::_preDestroy();
|
||||||
|
|
||||||
_anchorHook.Detach();
|
_anchorHook.detach();
|
||||||
|
|
||||||
// trace << "exiting Contact::PreDestroy" << endl;
|
// trace << "exiting Contact::PreDestroy" << endl;
|
||||||
// trace_out();
|
// trace_out();
|
||||||
|
|
|
@ -37,7 +37,7 @@ class Contact : public Component {
|
||||||
|
|
||||||
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 _getTypeName() const { return _TName("Contact::AnchorHook"); };
|
||||||
public: virtual string _getString() const;
|
public: virtual string _getString() const;
|
||||||
|
|
|
@ -160,7 +160,7 @@ size_t DeepNet::_createRoutingPads ( bool buildRings )
|
||||||
currentRP = createRoutingPad ( this, plugOccurrence );
|
currentRP = createRoutingPad ( this, plugOccurrence );
|
||||||
if ( buildRings ) {
|
if ( buildRings ) {
|
||||||
if ( previousRP ) {
|
if ( previousRP ) {
|
||||||
currentRP->getBodyHook()->Attach ( previousRP->getBodyHook() );
|
currentRP->getBodyHook()->attach ( previousRP->getBodyHook() );
|
||||||
}
|
}
|
||||||
previousRP = currentRP;
|
previousRP = currentRP;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ class Hook_IsMasterFilter : public Filter<Hook*> {
|
||||||
|
|
||||||
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>");};
|
||||||
|
|
||||||
|
@ -206,7 +206,7 @@ Hook* Hook::getMasterHook() const
|
||||||
{
|
{
|
||||||
Hook* hook = (Hook*)this;
|
Hook* hook = (Hook*)this;
|
||||||
do {
|
do {
|
||||||
if (hook->IsMaster()) return hook;
|
if (hook->isMaster()) return hook;
|
||||||
hook = hook->_nextHook;
|
hook = hook->_nextHook;
|
||||||
} while (hook != this);
|
} while (hook != this);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -224,7 +224,7 @@ Hook* Hook::getPreviousMasterHook() const
|
||||||
Hook* previousMasterHook = NULL;
|
Hook* previousMasterHook = NULL;
|
||||||
Hook* hook = (Hook*)this;
|
Hook* hook = (Hook*)this;
|
||||||
do {
|
do {
|
||||||
if (hook->IsMaster()) previousMasterHook = hook;
|
if (hook->isMaster()) previousMasterHook = hook;
|
||||||
hook = hook->_nextHook;
|
hook = hook->_nextHook;
|
||||||
} while (hook != this);
|
} while (hook != this);
|
||||||
return previousMasterHook;
|
return previousMasterHook;
|
||||||
|
@ -248,22 +248,22 @@ HookFilter Hook::getIsMasterFilter()
|
||||||
return Hook_IsMasterFilter();
|
return Hook_IsMasterFilter();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Hook::IsAttached() const
|
bool Hook::isAttached() const
|
||||||
// **************************
|
// **************************
|
||||||
{
|
{
|
||||||
if (!IsMaster())
|
if (!isMaster())
|
||||||
return (getMasterHook() != NULL);
|
return (getMasterHook() != NULL);
|
||||||
else
|
else
|
||||||
return (getNextMasterHook() != this);
|
return (getNextMasterHook() != this);
|
||||||
}
|
}
|
||||||
|
|
||||||
Hook* Hook::Detach()
|
Hook* Hook::detach()
|
||||||
// *****************
|
// *****************
|
||||||
{
|
{
|
||||||
Hook* previousHook = NULL;
|
Hook* previousHook = NULL;
|
||||||
Hook* hook = _nextHook;
|
Hook* hook = _nextHook;
|
||||||
while (hook != this) {
|
while (hook != this) {
|
||||||
if (!IsMaster() || hook->IsMaster()) previousHook = hook;
|
if (!isMaster() || hook->isMaster()) previousHook = hook;
|
||||||
hook = hook->_nextHook;
|
hook = hook->_nextHook;
|
||||||
}
|
}
|
||||||
if (previousHook) {
|
if (previousHook) {
|
||||||
|
@ -272,8 +272,8 @@ Hook* Hook::Detach()
|
||||||
previousHook->_nextHook = nextHook;
|
previousHook->_nextHook = nextHook;
|
||||||
|
|
||||||
// /*
|
// /*
|
||||||
if (IsMaster()) {
|
if (isMaster()) {
|
||||||
assert(previousHook->IsMaster());
|
assert(previousHook->isMaster());
|
||||||
Component* component = getComponent();
|
Component* component = getComponent();
|
||||||
Rubber* rubber = component->getRubber();
|
Rubber* rubber = component->getRubber();
|
||||||
if (rubber) {
|
if (rubber) {
|
||||||
|
@ -287,16 +287,16 @@ Hook* Hook::Detach()
|
||||||
return previousHook;
|
return previousHook;
|
||||||
}
|
}
|
||||||
|
|
||||||
Hook* Hook::Attach(Hook* hook)
|
Hook* Hook::attach(Hook* hook)
|
||||||
// ***************************
|
// ***************************
|
||||||
{
|
{
|
||||||
if (IsAttached())
|
if (isAttached())
|
||||||
throw Error("Can't attach : already attached");
|
throw Error("Can't attach : already attached");
|
||||||
|
|
||||||
if (!hook)
|
if (!hook)
|
||||||
throw Error("Can't attach : null hook");
|
throw Error("Can't attach : null hook");
|
||||||
|
|
||||||
if (!hook->IsMaster())
|
if (!hook->isMaster())
|
||||||
throw Error("Can't attach : not a master hook");
|
throw Error("Can't attach : not a master hook");
|
||||||
|
|
||||||
if (hook == this)
|
if (hook == this)
|
||||||
|
@ -308,7 +308,7 @@ Hook* Hook::Attach(Hook* hook)
|
||||||
_nextHook = nextHook;
|
_nextHook = nextHook;
|
||||||
|
|
||||||
// /*
|
// /*
|
||||||
if (IsMaster()) {
|
if (isMaster()) {
|
||||||
Rubber* rubber = hook->getComponent()->getRubber();
|
Rubber* rubber = hook->getComponent()->getRubber();
|
||||||
if (rubber)
|
if (rubber)
|
||||||
getComponent()->_setRubber(rubber);
|
getComponent()->_setRubber(rubber);
|
||||||
|
@ -322,7 +322,7 @@ Hook* Hook::Attach(Hook* hook)
|
||||||
|
|
||||||
void Hook::_setNextHook(Hook* hook)
|
void Hook::_setNextHook(Hook* hook)
|
||||||
{
|
{
|
||||||
if (IsMaster())
|
if (isMaster())
|
||||||
{
|
{
|
||||||
Rubber* rubber = hook->getComponent()->getRubber();
|
Rubber* rubber = hook->getComponent()->getRubber();
|
||||||
if (rubber)
|
if (rubber)
|
||||||
|
@ -334,13 +334,13 @@ void Hook::_setNextHook(Hook* hook)
|
||||||
Hook* Hook::merge(Hook* hook)
|
Hook* Hook::merge(Hook* hook)
|
||||||
// **************************
|
// **************************
|
||||||
{
|
{
|
||||||
if (!IsMaster())
|
if (!isMaster())
|
||||||
throw Error("Can't merge : not a master");
|
throw Error("Can't merge : not a master");
|
||||||
|
|
||||||
if (!hook)
|
if (!hook)
|
||||||
throw Error("Can't merge : null hook");
|
throw Error("Can't merge : null hook");
|
||||||
|
|
||||||
if (!hook->IsMaster())
|
if (!hook->isMaster())
|
||||||
throw Error("Can't merge : not a master hook");
|
throw Error("Can't merge : not a master hook");
|
||||||
|
|
||||||
if (hook == this)
|
if (hook == this)
|
||||||
|
@ -546,13 +546,13 @@ Hook_SlaveHooks::Locator::Locator(const Hook* hook)
|
||||||
_hook(hook),
|
_hook(hook),
|
||||||
_currentHook(NULL)
|
_currentHook(NULL)
|
||||||
{
|
{
|
||||||
if (_hook && _hook->IsMaster()) {
|
if (_hook && _hook->isMaster()) {
|
||||||
_currentHook = _hook->getPreviousMasterHook();
|
_currentHook = _hook->getPreviousMasterHook();
|
||||||
if (_currentHook) {
|
if (_currentHook) {
|
||||||
_currentHook = _currentHook->getNextHook();
|
_currentHook = _currentHook->getNextHook();
|
||||||
if (_currentHook == _hook) _currentHook = NULL;
|
if (_currentHook == _hook) _currentHook = NULL;
|
||||||
}
|
}
|
||||||
assert(!_currentHook || !_currentHook->IsMaster());
|
assert(!_currentHook || !_currentHook->isMaster());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -596,7 +596,7 @@ void Hook_SlaveHooks::Locator::progress()
|
||||||
if (_currentHook) {
|
if (_currentHook) {
|
||||||
_currentHook = _currentHook->getNextHook();
|
_currentHook = _currentHook->getNextHook();
|
||||||
if (_currentHook == _hook) _currentHook = NULL;
|
if (_currentHook == _hook) _currentHook = NULL;
|
||||||
assert(!_currentHook || !_currentHook->IsMaster());
|
assert(!_currentHook || !_currentHook->isMaster());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,15 +67,15 @@ class Hook : public NestedSlotAdapter {
|
||||||
// Predicates
|
// Predicates
|
||||||
// **********
|
// **********
|
||||||
|
|
||||||
public: virtual bool IsMaster() const = 0;
|
public: virtual bool isMaster() const = 0;
|
||||||
|
|
||||||
public: bool IsAttached() const;
|
public: bool isAttached() const;
|
||||||
|
|
||||||
// Updators
|
// Updators
|
||||||
// ********
|
// ********
|
||||||
|
|
||||||
public: Hook* Detach();
|
public: Hook* detach();
|
||||||
public: Hook* Attach(Hook* hook);
|
public: Hook* attach(Hook* hook);
|
||||||
public: Hook* merge(Hook* hook);
|
public: Hook* merge(Hook* hook);
|
||||||
public: void _setNextHook(Hook* hook);
|
public: void _setNextHook(Hook* hook);
|
||||||
|
|
||||||
|
|
|
@ -566,14 +566,14 @@ void Net::merge(Net* net)
|
||||||
Hook* masterHook = plug->getBodyHook();
|
Hook* masterHook = plug->getBodyHook();
|
||||||
Hook* nextMasterHook = masterHook->getNextMasterHook();
|
Hook* nextMasterHook = masterHook->getNextMasterHook();
|
||||||
if (nextMasterHook != masterHook) {
|
if (nextMasterHook != masterHook) {
|
||||||
masterHook->Detach();
|
masterHook->detach();
|
||||||
mainPlug->getBodyHook()->merge(nextMasterHook);
|
mainPlug->getBodyHook()->merge(nextMasterHook);
|
||||||
}
|
}
|
||||||
Hooks slaveHooks = masterHook->getSlaveHooks();
|
Hooks slaveHooks = masterHook->getSlaveHooks();
|
||||||
while (!slaveHooks.IsEmpty()) {
|
while (!slaveHooks.IsEmpty()) {
|
||||||
Hook* slaveHook = slaveHooks.getFirst();
|
Hook* slaveHook = slaveHooks.getFirst();
|
||||||
slaveHook->Detach();
|
slaveHook->detach();
|
||||||
slaveHook->Attach(mainPlug->getBodyHook());
|
slaveHook->attach(mainPlug->getBodyHook());
|
||||||
}
|
}
|
||||||
plug->_destroy();
|
plug->_destroy();
|
||||||
end_for;
|
end_for;
|
||||||
|
@ -613,8 +613,8 @@ void Net::_preDestroy()
|
||||||
for_each_hook(hook, component->getHooks()) {
|
for_each_hook(hook, component->getHooks()) {
|
||||||
// 15 05 2006 xtof : detach all hooks in rings when
|
// 15 05 2006 xtof : detach all hooks in rings when
|
||||||
// a net deletion occurs, can't see why master hooks were not detached.
|
// a net deletion occurs, can't see why master hooks were not detached.
|
||||||
//if (!hook->IsMaster()) hook->Detach();
|
//if (!hook->IsMaster()) hook->detach();
|
||||||
hook->Detach();
|
hook->detach();
|
||||||
end_for;
|
end_for;
|
||||||
}
|
}
|
||||||
end_for;
|
end_for;
|
||||||
|
|
|
@ -128,7 +128,7 @@ Rubber* Rubber::_create(Hook* hook)
|
||||||
if (!hook)
|
if (!hook)
|
||||||
throw Error("Can't create " + _TName("Rubber") + " : null hook");
|
throw Error("Can't create " + _TName("Rubber") + " : null hook");
|
||||||
|
|
||||||
if (!hook->IsMaster())
|
if (!hook->isMaster())
|
||||||
throw Error("Can't create " + _TName("Rubber") + " : not a master hook");
|
throw Error("Can't create " + _TName("Rubber") + " : not a master hook");
|
||||||
|
|
||||||
Net* net = hook->getComponent()->getNet();
|
Net* net = hook->getComponent()->getNet();
|
||||||
|
@ -220,7 +220,7 @@ void Rubber::_setNet(Net* net)
|
||||||
void Rubber::_setHook(Hook* hook)
|
void Rubber::_setHook(Hook* hook)
|
||||||
// ******************************
|
// ******************************
|
||||||
{
|
{
|
||||||
assert(hook->IsMaster());
|
assert(hook->isMaster());
|
||||||
assert(hook->getComponent()->getNet() == getNet());
|
assert(hook->getComponent()->getNet() == getNet());
|
||||||
_hook = hook;
|
_hook = hook;
|
||||||
}
|
}
|
||||||
|
|
|
@ -177,8 +177,8 @@ Segment::Segment(Net* net, Component* source, Component* target, Layer* layer, c
|
||||||
if (!_layer)
|
if (!_layer)
|
||||||
throw Error("Can't create " + _TName("Segment") + " : null layer");
|
throw Error("Can't create " + _TName("Segment") + " : null layer");
|
||||||
|
|
||||||
if (source) _sourceHook.Attach(source->getBodyHook());
|
if (source) _sourceHook.attach(source->getBodyHook());
|
||||||
if (target) _targetHook.Attach(target->getBodyHook());
|
if (target) _targetHook.attach(target->getBodyHook());
|
||||||
}
|
}
|
||||||
|
|
||||||
Hooks Segment::getHooks() const
|
Hooks Segment::getHooks() const
|
||||||
|
@ -268,10 +268,10 @@ void Segment::Invert()
|
||||||
Component* source = getSource();
|
Component* source = getSource();
|
||||||
Component* target = getTarget();
|
Component* target = getTarget();
|
||||||
if (source && target && (target != source)) {
|
if (source && target && (target != source)) {
|
||||||
getSourceHook()->Detach();
|
getSourceHook()->detach();
|
||||||
getTargetHook()->Detach();
|
getTargetHook()->detach();
|
||||||
getSourceHook()->Attach(target->getBodyHook());
|
getSourceHook()->attach(target->getBodyHook());
|
||||||
getTargetHook()->Attach(source->getBodyHook());
|
getTargetHook()->attach(source->getBodyHook());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -283,8 +283,8 @@ void Segment::_preDestroy()
|
||||||
|
|
||||||
Inherit::_preDestroy();
|
Inherit::_preDestroy();
|
||||||
|
|
||||||
_sourceHook.Detach();
|
_sourceHook.detach();
|
||||||
_targetHook.Detach();
|
_targetHook.detach();
|
||||||
|
|
||||||
// trace << "exiting Segment::_preDestroy:" << endl;
|
// trace << "exiting Segment::_preDestroy:" << endl;
|
||||||
// trace_out();
|
// trace_out();
|
||||||
|
|
|
@ -37,7 +37,7 @@ class Segment : public Component {
|
||||||
|
|
||||||
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("Segment::SourceHook"); };
|
public: virtual string _getTypeName() const { return _TName("Segment::SourceHook"); };
|
||||||
public: virtual string _getString() const;
|
public: virtual string _getString() const;
|
||||||
|
@ -54,7 +54,7 @@ class Segment : public Component {
|
||||||
|
|
||||||
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("Segment::TargetHook"); };
|
public: virtual string _getTypeName() const { return _TName("Segment::TargetHook"); };
|
||||||
public: virtual string _getString() const;
|
public: virtual string _getString() const;
|
||||||
|
|
Loading…
Reference in New Issue