17 #ifndef KATABATIC_AUTOCONTACT_H
18 #define KATABATIC_AUTOCONTACT_H
22 #include "hurricane/Contact.h"
23 #include "hurricane/ExtensionGo.h"
24 #include "katabatic/Constants.h"
25 #include "katabatic/AutoSegment.h"
26 #include "katabatic/GCell.h"
41 using Hurricane::ExtensionGo;
44 class KatabaticEngine;
50 typedef std::map<Contact*,AutoContact*> AutoContactLut;
65 , CntIgnoreAnchor = 0x00000200
66 , CntWeakTerminal = 0x00000400
67 , CntUserNativeConstraints = 0x00000800
108 inline bool isTerminal ()
const;
109 inline bool isTurn ()
const;
110 bool isTee (
unsigned int direction )
const;
111 inline bool isHTee ()
const;
112 inline bool isVTee ()
const;
114 inline bool isUserNativeConstraints ()
const;
116 bool canDestroy (
unsigned int flags=0 )
const;
123 inline size_t getId ()
const;
133 Interval getNativeUConstraints (
unsigned int direction )
const;
147 virtual void updateCache () = 0;
152 inline void setFlags (
unsigned int );
153 inline void unsetFlags (
unsigned int );
163 void restoreNativeConstraintBox ();
167 Record* _getRecord ()
const;
168 virtual string _getString ()
const;
169 virtual string _getTypeName ()
const;
173 static size_t _maxId;
174 static size_t _allocateds;
175 static const Name _goName;
192 virtual void _postCreate ();
193 virtual void _preDestroy ();
202 virtual void _invalidate (
unsigned int flags ) = 0;
240 inline bool AutoContact::isUserNativeConstraints ()
const {
return _flags&CntUserNativeConstraints; }
241 inline bool AutoContact::isTerminal ()
const {
return _flags&
CntTerminal; }
253 inline void AutoContact::setFlags (
unsigned int flags ) { _flags|= flags; }
254 inline void AutoContact::unsetFlags (
unsigned int flags ) { _flags&=~flags; }
280 inline unsigned int _min ()
const;
281 inline unsigned int _max ()
const;
290 : _flags(flags), _index(_min()), _contact(contact)
293 cdebug_log(145,0) <<
"CTOR LocatorHelper " << contact->_getString() << endl;
294 cdebug_log(145,0) <<
"+ _min():" << _min() << endl;
295 cdebug_log(145,0) <<
"+ _max():" << _max() << endl;
296 cdebug_log(145,0) <<
"+ getSegment(_min()):" << _contact->
getSegment(_min()) << endl;
302 {
return _index < _max(); }
304 inline unsigned int LocatorHelper::_min ()
const
307 inline unsigned int LocatorHelper::_max ()
const
312 cdebug_log(145,0) <<
"LocatorHelper::getSegment(" << _index <<
") - " << _contact->
getSegment(_index) << endl;
313 return (_index < _max()) ? _contact->
getSegment(_index) : NULL;
320 cdebug_log(145,0) <<
"LocatorHelper::progress() [" << _index <<
"] " << _contact->
getSegment(_index) << endl;
321 while ((_index < _max()) and (_contact->
getSegment(_index) == NULL)) {
323 cdebug_log(145,0) <<
"LocatorHelper::progress() [" << _index <<
"] " << _contact->
getSegment(_index) << endl;
333 template<
typename Type>
inline void order ( Type& a, Type& b ) {
if (a>b) std::swap(a,b); }
337 if ( lower > value ) value = lower;
338 if ( upper < value ) value = upper;
343 inline size_t abssub (
size_t a,
size_t b ) {
return (a>b) ? a-b : b-a; }
352 #endif // KATABATIC_AUTOCONTACT_H
Definition: AutoContact.h:63
Definition: Constants.h:29
AutoContactFlag
Definition: AutoContact.h:56
virtual Point getPosition() const
Definition: AutoContact.h:56
Definition: AutoContact.h:58
virtual DbU::Unit getX() const =0
virtual const Layer * getLayer() const =0
static Unit fromLambda(double value)
LocatorHelper(AutoContact *, unsigned int flags=0)
Definition: AutoContact.h:289
Definition: AutoContact.h:59
Routing Global Cell.
Definition: GCell.h:74
DbU::Unit getY() const
Definition: GCell.h:245
Abstract base class for AutoSegment.
Definition: AutoSegment.h:104
Definition: Constants.h:32
Components getSlaveComponents() const
virtual DbU::Unit getY() const =0
AutoSegment * getSegment() const
Definition: AutoContact.h:310
Definition: AutoContact.h:64
Locator Helper Collection's Locators.
Definition: AutoContact.h:273
DbU::Unit getXMax() const
Definition: GCell.h:246
DbU::Unit getYMax() const
Definition: GCell.h:247
Definition: AutoContact.h:62
Definition: Constants.h:27
Definition: AutoContact.h:60
Definition: AutoContact.h:57
void progress()
Definition: AutoContact.h:316
Definition: AutoContact.h:61
DbU::Unit getX() const
Definition: GCell.h:244
GenericCollection< Component * > Components
bool isValid() const
Definition: AutoContact.h:301
static double toLambda(Unit u)