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

Function validate_cell_path

src/layui/layui/layLayoutViewFunctions.cc:70–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70static bool
71validate_cell_path (const db::Layout &layout, lay::LayoutViewBase::cell_path_type &path)
72{
73 for (size_t i = 0; i < path.size (); ++i) {
74
75 if (! layout.is_valid_cell_index (path [i])) {
76
77 if (layout.is_valid_cell_index (path.back ())) {
78 // use a stub path
79 path.erase (path.begin (), --path.end ());
80 } else {
81 // strip everything that is not valid
82 path.erase (path.begin () + i, path.end ());
83 }
84
85 return true;
86
87 }
88 }
89
90 return false;
91}
92
93LayoutViewFunctions::LayoutViewFunctions (db::Manager *manager, LayoutViewBase *view)
94 : lay::Plugin (view), mp_view (view), mp_manager (manager)

Callers 3

cm_cell_replaceMethod · 0.85
cm_cell_deleteMethod · 0.85

Calls 6

is_valid_cell_indexMethod · 0.80
sizeMethod · 0.45
backMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected