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

Function do_init

src/db/db/dbLayoutQuery.cc:627–667  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

625 }
626
627 virtual void do_init ()
628 {
629 if (m_pattern.is_catchall () || m_pattern.needs_eval ()) {
630
631 if (! objectives ().wants_all_cells ()) {
632
633 // wildcard or unknown filter: include the parent cells if specific child cells are looked for
634
635 int levels = 1;
636 for (size_t i = 0; i < followers ().size (); ++i) {
637 if (followers ()[i] == 0) {
638 // this is a sign of recursion - collect caller cells from all levels.
639 levels = -1;
640 }
641 }
642
643 // this means, one follower wants only certain cells. We can optimize by only checking for potential parents
644 std::set<db::cell_index_type> callers;
645 for (FilterStateObjectives::cell_iterator c = objectives ().begin_cells (); c != objectives ().end_cells (); ++c) {
646 layout ()->cell (*c).collect_caller_cells (callers, levels);
647 }
648
649 for (std::set<db::cell_index_type>::const_iterator c = callers.begin (); c != callers.end (); ++c) {
650 objectives ().request_cell (*c);
651 }
652
653 }
654
655 } else {
656
657 objectives ().set_wants_all_cells (false);
658
659 // include all matching cells into the objectives
660 for (db::Layout::const_iterator c = layout ()->begin (); c != layout ()->end(); ++c) {
661 if (m_pattern.match (c->get_qualified_name ())) {
662 objectives ().request_cell (c->cell_index ());
663 }
664 }
665
666 }
667 }
668
669 db::Instance instance () const
670 {

Callers 1

initMethod · 0.85

Calls 13

wants_all_cellsMethod · 0.80
collect_caller_cellsMethod · 0.80
request_cellMethod · 0.80
layoutFunction · 0.70
is_catchallMethod · 0.45
sizeMethod · 0.45
cellMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
set_wants_all_cellsMethod · 0.45
matchMethod · 0.45
get_qualified_nameMethod · 0.45

Tested by

no test coverage detected