Hurricane VLSI Database


Segment.h
1// ****************************************************************************************************
2// File: ./hurricane/Segment.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#ifndef HURRICANE_SEGMENT
21#define HURRICANE_SEGMENT
22
23#include "hurricane/Component.h"
24#include "hurricane/Segments.h"
25
26namespace Hurricane {
27
28
29// ****************************************************************************************************
30// Segment declaration
31// ****************************************************************************************************
32
33class Segment : public Component {
34// *****************************
35 private:
36 static FastRTTI _fastRTTI;
37 public:
38 static inline const FastRTTI& fastRTTI ();
39 virtual const FastRTTI& vfastRTTI () const;
40
41// Types
42// *****
43
44 public: typedef Component Inherit;
45
46 public: class SourceHook : public Hook {
47 // ***********************************
48
49 friend class Segment;
50
51 public: typedef Hook Inherit;
52
53 private: SourceHook(Segment* segment);
54
55 public: virtual Component* getComponent() const;
56
57 public: virtual bool isMaster() const {return false;};
58
59 public: virtual string _getTypeName() const { return "Segment::SourceHook"; };
60 public: virtual string _getString() const;
61 public: static Hook* _compToHook(Component*);
62 };
63
64 public: class TargetHook : public Hook {
65 // ***********************************
66
67 friend class Segment;
68
69 public: typedef Hook Inherit;
70
71 private: TargetHook(Segment* segment);
72
73 public: virtual Component* getComponent() const;
74
75 public: virtual bool isMaster() const {return false;};
76
77 public: virtual string _getTypeName() const { return "Segment::TargetHook"; };
78 public: virtual string _getString() const;
79 public: static Hook* _compToHook(Component*);
80 };
81
82// Attributes
83// **********
84
85 private: SourceHook _sourceHook;
86 private: TargetHook _targetHook;
87 private: const Layer* _layer;
88 private: DbU::Unit _width;
89
90// Constructors
91// ************
92
93 protected: Segment ( Net* net
94 , Component* source
95 , Component* target
96 , const Layer* layer
97 , const DbU::Unit& width = 0
98 );
99
100// Accessors
101// *********
102
103 public: virtual Hooks getHooks() const;
104 public: virtual DbU::Unit getX() const {return 0;};
105 public: virtual DbU::Unit getY() const {return 0;};
106 public: virtual const Layer* getLayer() const {return _layer;};
107 public: Hook* getSourceHook() {return &_sourceHook;};
108 public: Hook* getTargetHook() {return &_targetHook;};
109 public: Hook* getOppositeHook(const Hook* hook) const;
110 public: Component* getSource() const;
111 public: Component* getTarget() const;
112 public: Components getAnchors() const;
113 public: Component* getOppositeAnchor(Component* anchor) const;
114 public: const DbU::Unit& getWidth() const {return _width;};
115 public: DbU::Unit getHalfWidth() const {return (_width / 2);};
116 public: virtual DbU::Unit getSourceX() const = 0;
117 public: virtual DbU::Unit getSourceY() const = 0;
118 public: virtual Point getSourcePosition() const;
119 public: virtual DbU::Unit getTargetX() const = 0;
120 public: virtual DbU::Unit getTargetY() const = 0;
121 public: virtual Point getTargetPosition() const;
122 public: virtual DbU::Unit getLength() const = 0;
123
124// Updators
125// ********
126
127 public: void setLayer(const Layer* layer);
128 public: void setWidth(const DbU::Unit& width);
129 public: void invert();
130
131// Others
132// ******
133
134 protected: virtual void _preDestroy();
135
136 public: virtual void _toJson(JsonWriter*) const;
137 public: virtual string _getString() const;
138 public: virtual Record* _getRecord() const;
139
140};
141
142
143 inline const FastRTTI& Segment::fastRTTI () { return _fastRTTI; }
144
145
146// ****************************************************************************************************
147// JsonSegment declaration
148// ****************************************************************************************************
149
150class JsonSegment : public JsonComponent {
151// ***************************************
152
153 public: JsonSegment(unsigned long flags);
154};
155
156
157} // End of Hurricane namespace.
158
159
160INSPECTOR_P_SUPPORT(Hurricane::Segment);
161INSPECTOR_P_SUPPORT(Hurricane::Segment::SourceHook);
162INSPECTOR_P_SUPPORT(Hurricane::Segment::TargetHook);
163
164
165#endif // HURRICANE_SEGMENT
166
167
168// ****************************************************************************************************
169// Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
170// ****************************************************************************************************
virtual DbU::Unit getX() const =0
virtual DbU::Unit getY() const =0
virtual Hooks getHooks() const
virtual const Layer * getLayer() const =0
std::int64_t Unit
Definition DbU.h:67
Hook description (API).
Definition Hook.h:34
virtual Component * getComponent() const =0
virtual bool isMaster() const =0
Layer description (API).
Definition Layer.h:120
Net description (API).
Definition Net.h:46
Point description (API).
Definition Point.h:30
Definition Segment.h:46
Definition Segment.h:64
Segment description (API).
Definition Segment.h:33
Hook * getSourceHook()
Definition Segment.h:107
Component * getTarget() const
virtual DbU::Unit getLength() const =0
const DbU::Unit & getWidth() const
Definition Segment.h:114
virtual DbU::Unit getTargetY() const =0
DbU::Unit getHalfWidth() const
Definition Segment.h:115
virtual Point getSourcePosition() const
Component Inherit
Definition Segment.h:44
virtual Point getTargetPosition() const
virtual DbU::Unit getSourceY() const =0
Component * getOppositeAnchor(Component *anchor) const
virtual DbU::Unit getTargetX() const =0
Component * getSource() const
virtual DbU::Unit getSourceX() const =0
Hook * getTargetHook()
Definition Segment.h:108
Components getAnchors() const
void setLayer(const Layer *layer)
void setWidth(const DbU::Unit &width)
Hook * getOppositeHook(const Hook *hook) const
Contains Almost Everything.
Definition BasicLayer.h:39
GenericCollection< Hook * > Hooks
Definition Hooks.h:35
GenericCollection< Component * > Components
Definition Components.h:35


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