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

Function find_layer

src/db/db/gsiDeclDbLayout.cc:526–547  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524}
525
526static tl::Variant find_layer (db::Layout *l, const db::LayerProperties &lp)
527{
528 if (lp.is_null ()) {
529 // for a null layer info always return nil
530 return tl::Variant ();
531 } else {
532 // if we have a layer with the requested properties already, return this one.
533 // first pass: exact match
534 int index = l->get_layer_maybe (lp);
535 if (index >= 0) {
536 return tl::Variant ((unsigned int) index);
537 }
538 // second pass: relaxed match
539 for (db::Layout::layer_iterator li = l->begin_layers (); li != l->end_layers (); ++li) {
540 if (log_equal_ext ((*li).second, lp)) {
541 return tl::Variant ((*li).first);
542 }
543 }
544 // otherwise return nil
545 return tl::Variant ();
546 }
547}
548
549static tl::Variant find_layer1 (db::Layout *l, const std::string &name)
550{

Callers 4

find_layer1Function · 0.70
find_layer2Function · 0.70
find_layer3Function · 0.70
set_current_layerMethod · 0.50

Calls 6

log_equal_extFunction · 0.85
get_layer_maybeMethod · 0.80
begin_layersMethod · 0.80
end_layersMethod · 0.80
VariantClass · 0.70
is_nullMethod · 0.45

Tested by

no test coverage detected