MCPcopy Create free account
hub / github.com/KLayout/klayout / is_valid

Method is_valid

src/laybasic/laybasic/layObjectInstPath.cc:43–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43bool
44ObjectInstPath::is_valid (lay::LayoutViewBase *view) const
45{
46 const lay::CellView &cv = view->cellview (cv_index ());
47 if (! cv.is_valid ()) {
48 return false;
49 }
50
51 const db::Layout &ly = cv->layout ();
52 db::cell_index_type ci = topcell ();
53 if (! ly.is_valid_cell_index (ci)) {
54 return false;
55 }
56
57 for (auto p = begin (); p != end (); ++p) {
58 if (! ly.cell (ci).is_valid (p->inst_ptr)) {
59 return false;
60 }
61 ci = p->inst_ptr.cell_index ();
62 if (! ly.is_valid_cell_index (ci)) {
63 return false;
64 }
65 }
66
67 if (! is_cell_inst ()) {
68 if (! ly.is_valid_layer (layer ()) && layer () != ly.guiding_shape_layer ()) {
69 return false;
70 }
71 if (! ly.cell (ci).shapes (layer ()).is_valid (shape ())) {
72 return false;
73 }
74 }
75
76 return true;
77}
78
79db::cell_index_type
80ObjectInstPath::cell_index_tot () const

Callers

nothing calls this directly

Calls 13

is_cell_instFunction · 0.85
cellviewMethod · 0.80
is_valid_cell_indexMethod · 0.80
guiding_shape_layerMethod · 0.80
cv_indexFunction · 0.70
topcellFunction · 0.70
beginFunction · 0.70
endFunction · 0.70
layerFunction · 0.70
shapeFunction · 0.70
layoutMethod · 0.45
cellMethod · 0.45

Tested by

no test coverage detected