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 <set>
25 #include "hurricane/Points.h"
26 #include "hurricane/Go.h"
27 #include "hurricane/Components.h"
28 #include "hurricane/Hook.h"
29 #include "hurricane/Hooks.h"
30 #include "hurricane/Interval.h"
31 
32 
33 namespace Hurricane {
34 
35  class Net;
36  class Rubber;
37  class Layer;
38 
39 
40 // -------------------------------------------------------------------
41 // Class : "Component".
42 
43  class Component : public Go {
44  public:
45  typedef Go Inherit;
46 
47  public:
48  class Points_Contour : public PointHC {
49  public:
50  class Locator : public PointHL {
51  public:
52  Locator ( const Component* );
53  inline Locator ( const Locator& );
54  virtual Point getElement () const;
55  virtual PointHL* getClone () const;
56  virtual bool isValid () const;
57  virtual void progress ();
58  virtual string _getString () const;
59  protected:
60  const Component* _component;
61  size_t _iPoint;
62  };
63  public:
64  inline Points_Contour ( const Component* );
65  inline Points_Contour ( const Points_Contour& );
66  virtual PointHC* getClone () const;
67  virtual PointHL* getLocator () const;
68  virtual string _getString () const;
69  protected:
70  const Component* _component;
71  };
72 
73  public:
74  class BodyHook : public Hook {
75  friend class Component;
76  public:
77  typedef Hook Inherit;
78  public:
79  virtual Component* getComponent () const;
80  virtual bool isMaster () const {return true;};
81  virtual string _getTypeName () const { return "Component::BodyHook"; };
82  virtual string _getString () const;
83  static Hook* _compToHook ( Component* );
84  private:
85  BodyHook ( Component* );
86  };
87 
88  protected:
89  Component ( Net* , bool inPlugCreate = false );
90  public:
91  // Accessors.
92  virtual bool isManhattanized () const;
93  virtual bool isNonRectangle () const;
94  virtual Cell* getCell () const;
95  Net* getNet () const { return _net; };
96  Rubber* getRubber () const { return _rubber; };
97  Hook* getBodyHook () { return &_bodyHook; };
98  virtual Hooks getHooks () const;
99  virtual DbU::Unit getX () const = 0;
100  virtual DbU::Unit getY () const = 0;
101  virtual Point getPosition () const { return Point( getX(), getY() ); };
102  virtual Point getCenter () const { return getPosition(); };
103  virtual const Layer* getLayer () const = 0;
104  virtual size_t getPointsSize () const;
105  virtual Point getPoint ( size_t ) const;
106  virtual Box getBoundingBox () const = 0;
107  virtual Box getBoundingBox ( const BasicLayer* ) const = 0;
108  inline Points getContour () const;
109  virtual Points getMContour () const;
112  // Mutators.
113  virtual void materialize ();
114  virtual void unmaterialize ();
115  virtual void invalidate ( bool propagateFlag = true );
116  virtual void forceId ( unsigned int id );
117  // Filters
118  static ComponentFilter getIsUnderFilter ( const Box& area );
119  // Others
120  protected:
121  virtual void _postCreate ();
122  virtual void _preDestroy ();
123  public:
124  virtual void _toJson ( JsonWriter* ) const;
125  virtual void _toJsonSignature ( JsonWriter* ) const;
126  virtual string _getString () const;
127  virtual Record* _getRecord () const;
128  Component* _getNextOfNetComponentSet () const {return _nextOfNetComponentSet;};
129  void _setNet ( Net* );
130  void _setRubber ( Rubber* );
131  void _setNextOfNetComponentSet ( Component* component ) { _nextOfNetComponentSet = component; };
132  private:
133  Net* _net;
134  Rubber* _rubber;
135  BodyHook _bodyHook;
136  Component* _nextOfNetComponentSet;
137  };
138 
139 
140  inline Points Component::getContour () const { return Points_Contour(this); }
141 
142 
143  inline Component::Points_Contour::Locator::Locator ( const Locator &locator )
144  : PointHL ()
145  , _component(locator._component)
146  , _iPoint (locator._iPoint)
147  { }
148 
149 
150  inline Component::Points_Contour::Points_Contour ( const Component* component )
151  : PointHC ()
152  , _component(component)
153  { }
154 
155 
156  inline Component::Points_Contour::Points_Contour ( const Points_Contour& other )
157  : PointHC ()
158  , _component(other._component)
159  { }
160 
161 
162  double getArea ( Component* component );
163 
164 
165 // -------------------------------------------------------------------
166 // Class : "JsonComponent".
167 
168  class JsonComponent : public JsonEntity {
169  public:
170  JsonComponent ( unsigned long flags );
171  };
172 
173 
174  typedef std::set<Component*,DBo::CompareById> ComponentSet;
175 
176 
177 } // Hurricane namespace.
178 
179 
180 INSPECTOR_P_SUPPORT(Hurricane::Component);
181 INSPECTOR_P_SUPPORT(Hurricane::Component::BodyHook);
182 
183 
184 #endif // HURRICANE_COMPONENT_H
185 
186 // ****************************************************************************************************
187 // Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
188 // ****************************************************************************************************
BasicLayer description (API)
Definition: BasicLayer.h:42
Box description (API)
Definition: Box.h:31
The model (API).
Definition: Cell.h:64
Collection description (API)
Definition: Collection.h:39
Definition: Component.h:74
Component description (API)
Definition: Component.h:43
virtual DbU::Unit getX() const =0
Net * getNet() const
Definition: Component.h:95
Hook * getBodyHook()
Definition: Component.h:97
virtual Hooks getHooks() const
Go Inherit
Definition: Component.h:45
Components getConnexComponents() const
virtual DbU::Unit getY() const =0
static ComponentFilter getIsUnderFilter(const Box &area)
virtual Point getPosition() const
Definition: Component.h:101
virtual Box getBoundingBox(const BasicLayer *) const =0
virtual const Layer * getLayer() const =0
Rubber * getRubber() const
Definition: Component.h:96
Components getSlaveComponents() const
std::int64_t Unit
Definition: DbU.h:67
Generic Collection auto-pointer.
Definition: Collection.h:235
Generic Filter auto-pointer.
Definition: Filter.h:86
Go description (API)
Definition: Go.h:34
Hook description (API)
Definition: Hook.h:34
Layer description (API)
Definition: Layer.h:50
Locator description (API)
Definition: Locator.h:33
Net description (API)
Definition: Net.h:46
Point description (API)
Definition: Point.h:32
Rubber description (API)
Definition: Rubber.h:36
Contains Almost Everything.
Definition: BasicLayer.h:39


Generated by doxygen 1.9.1 on Fri Oct 4 2024 Return to top of page
Hurricane VLSI Database Copyright © 2000-2020 Bull S.A. All rights reserved