# Hurricane Documentation

# Hurricane VLSI Database

Component.h
1 // ****************************************************************************************************
2 // File: ./hurricane/Component.h
3 // Authors: R. Escassut
4 // Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
5 //
6 // This file is part of Hurricane.
7 //
8 // Hurricane is free software: you can redistribute it and/or modify it under the terms of the GNU
9 // Lesser General Public License as published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
11 //
12 // Hurricane is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
13 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
14 // General Public License for more details.
15 //
16 // You should have received a copy of the Lesser GNU General Public License along with Hurricane. If
17 // not, see <http://www.gnu.org/licenses/>.
18 // ****************************************************************************************************
19
20
21 #ifndef HURRICANE_COMPONENT_H
22 #define HURRICANE_COMPONENT_H
23
24 #include "hurricane/Points.h"
25 #include "hurricane/Go.h"
26 #include "hurricane/Components.h"
27 #include "hurricane/Hook.h"
28 #include "hurricane/Hooks.h"
29 #include "hurricane/Interval.h"
30
31
32 namespace Hurricane {
33
34 class Net;
35 class Rubber;
36 class Layer;
37
38
39 // -------------------------------------------------------------------
40 // Class : "Component".
41
42 class Component : public Go {
43 public:
44 typedef Go Inherit;
45
46 public:
47 class Points_Contour : public PointHC {
48 public:
49 class Locator : public PointHL {
50 public:
51 Locator ( const Component* );
52 inline Locator ( const Locator& );
53 virtual Point getElement () const;
54 virtual PointHL* getClone () const;
55 virtual bool isValid () const;
56 virtual void progress ();
57 virtual string _getString () const;
58 protected:
59 const Component* _component;
60 size_t _iPoint;
61 };
62 public:
63 inline Points_Contour ( const Component* );
64 inline Points_Contour ( const Points_Contour& );
65 virtual PointHC* getClone () const;
66 virtual PointHL* getLocator () const;
67 virtual string _getString () const;
68 protected:
69 const Component* _component;
70 };
71
72 public:
73 class BodyHook : public Hook {
74 friend class Component;
75 public:
76 typedef Hook Inherit;
77 public:
78 virtual Component* getComponent () const;
79 virtual bool isMaster () const {return true;};
80 virtual string _getTypeName () const { return "Component::BodyHook"; };
81 virtual string _getString () const;
82 static Hook* _compToHook ( Component* );
83 private:
84 BodyHook ( Component* );
85 };
86
87 protected:
88 Component ( Net* , bool inPlugCreate = false );
89 public:
90 // Accessors.
91 virtual bool isManhattanized () const;
92 virtual bool isNonRectangle () const;
93 virtual Cell* getCell () const;
94 Net* getNet () const { return _net; };
95 Rubber* getRubber () const { return _rubber; };
96 Hook* getBodyHook () { return &_bodyHook; };
97 virtual Hooks getHooks () const;
98 virtual DbU::Unit getX () const = 0;
99 virtual DbU::Unit getY () const = 0;
100 virtual Point getPosition () const { return Point( getX(), getY() ); };
101 virtual Point getCenter () const { return getPosition(); };
102 virtual const Layer* getLayer () const = 0;
103 virtual size_t getPointsSize () const;
104 virtual Point getPoint ( size_t ) const;
105 virtual Box getBoundingBox () const = 0;
106 virtual Box getBoundingBox ( const BasicLayer* ) const = 0;
107 inline Points getContour () const;
108 virtual Points getMContour () const;
109 Components getConnexComponents () const;
110 Components getSlaveComponents () const;
111 // Mutators.
112 virtual void materialize ();
113 virtual void unmaterialize ();
114 virtual void invalidate ( bool propagateFlag = true );
115 virtual void forceId ( unsigned int id );
116 // Filters
117 static ComponentFilter getIsUnderFilter ( const Box& area );
118 // Others
119 protected:
120 virtual void _postCreate ();
121 virtual void _preDestroy ();
122 public:
123 virtual void _toJson ( JsonWriter* ) const;
124 virtual void _toJsonSignature ( JsonWriter* ) const;
125 virtual string _getString () const;
126 virtual Record* _getRecord () const;
127 Component* _getNextOfNetComponentSet () const {return _nextOfNetComponentSet;};
128 void _setNet ( Net* );
129 void _setRubber ( Rubber* );
130 void _setNextOfNetComponentSet ( Component* component ) { _nextOfNetComponentSet = component; };
131 private:
132 Net* _net;
133 Rubber* _rubber;
134 BodyHook _bodyHook;
135 Component* _nextOfNetComponentSet;
136 };
137
138
139 inline Points Component::getContour () const { return Points_Contour(this); }
140
141
142 inline Component::Points_Contour::Locator::Locator ( const Locator &locator )
143 : PointHL ()
144 , _component(locator._component)
145 , _iPoint (locator._iPoint)
146 { }
147
148
149 inline Component::Points_Contour::Points_Contour ( const Component* component )
150 : PointHC ()
151 , _component(component)
152 { }
153
154
155 inline Component::Points_Contour::Points_Contour ( const Points_Contour& other )
156 : PointHC ()
157 , _component(other._component)
158 { }
159
160
161 double getArea ( Component* component );
162
163
164 // -------------------------------------------------------------------
165 // Class : "JsonComponent".
166
167 class JsonComponent : public JsonEntity {
168 public:
169 JsonComponent ( unsigned long flags );
170 };
171
172
173 } // Hurricane namespace.
174
175
176 INSPECTOR_P_SUPPORT(Hurricane::Component);
177 INSPECTOR_P_SUPPORT(Hurricane::Component::BodyHook);
178
179
180 #endif // HURRICANE_COMPONENT_H
181
182 // ****************************************************************************************************
183 // Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
184 // ****************************************************************************************************
Hurricane::Go
Go description (API)
Definition: Go.h:36
Hurricane::Collection
Collection description (API)
Definition: Collection.h:39
Hurricane::Component::getNet
Net * getNet() const
Definition: Component.h:94
Hurricane::Component::getHooks
virtual Hooks getHooks() const
Hurricane::Component::getBodyHook
Hook * getBodyHook()
Definition: Component.h:96
Hurricane::Component
Component description (API)
Definition: Component.h:42
Hurricane::Component::getX
virtual DbU::Unit getX() const =0
Hurricane::Component::getConnexComponents
Components getConnexComponents() const
Hurricane::Component::getLayer
virtual const Layer * getLayer() const =0
Hurricane::DbU::Unit
std::int64_t Unit
Definition: DbU.h:70
Hurricane::Component::getSlaveComponents
Components getSlaveComponents() const
Hurricane::Cell
The model (API).
Definition: Cell.h:66
Hurricane::Point
Point description (API)
Definition: Point.h:32
Hurricane::GenericCollection
Generic Collection auto-pointer.
Definition: Collection.h:28
Hurricane::Component::getY
virtual DbU::Unit getY() const =0
Hurricane::Hook
Hook description (API)
Definition: Hook.h:36
Hurricane::Locator
Locator description (API)
Definition: Locator.h:33
Hurricane::Component::getIsUnderFilter
static ComponentFilter getIsUnderFilter(const Box &area)
Hurricane::Component::Inherit
Go Inherit
Definition: Component.h:44
Hurricane
The namespace dedicated to Hurricane.
Definition: Generalities.dox:5
Hurricane::ComponentFilter
GenericFilter< Component * > ComponentFilter
Definition: Components.h:51
Hurricane::Component::getPosition
virtual Point getPosition() const
Definition: Component.h:100
Hurricane::Components
GenericCollection< Component * > Components
Definition: Components.h:27
Hurricane::Net
Net description (API)
Definition: Net.h:48
Hurricane::Component::getRubber
Rubber * getRubber() const
Definition: Component.h:95
Hurricane::Rubber
Rubber description (API)
Definition: Rubber.h:36
Hurricane::Component::BodyHook
Definition: Component.h:73