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

Method create_plugins

src/laybasic/laybasic/layLayoutViewBase.cc:595–642  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

593}
594
595void LayoutViewBase::create_plugins (const lay::PluginDeclaration *except_this)
596{
597 clear_plugins ();
598
599 // create the plugins
600 for (tl::Registrar<lay::PluginDeclaration>::iterator cls = tl::Registrar<lay::PluginDeclaration>::begin (); cls != tl::Registrar<lay::PluginDeclaration>::end (); ) {
601
602 // NOTE: during "create_plugin" a plugin may be unregistered, so don't increment the iterator after
603 auto current = cls.operator-> ();
604 std::string current_name = cls.current_name ();
605 ++cls;
606
607 if (current != except_this) {
608
609 // TODO: clean solution. The following is a HACK:
610 if (current_name == "ant::Plugin" || current_name == "img::Plugin") {
611 // ant and img are created always
612 create_plugin (current);
613 } else if (current_name == "laybasic::MouseTrackerPlugin") {
614 if ((m_options & LV_NoTracker) == 0) {
615 mp_tracker = dynamic_cast<lay::MouseTracker *> (create_plugin (current));
616 }
617 } else if (current_name == "laybasic::MoveServicePlugin") {
618 if ((m_options & LV_NoMove) == 0) {
619 mp_move_service = dynamic_cast<lay::MoveService *> (create_plugin (current));
620 }
621 } else if (current_name == "laybasic::SelectionServicePlugin") {
622 if ((m_options & LV_NoSelection) == 0) {
623 mp_selection_service = dynamic_cast<lay::SelectionService *> (create_plugin (current));
624 }
625 } else if (current_name == "laybasic::ZoomServicePlugin") {
626 if ((m_options & LV_NoZoom) == 0) {
627 mp_zoom_service = dynamic_cast<lay::ZoomService *> (create_plugin (current));
628 }
629 } else if ((options () & LV_NoPlugins) == 0) {
630 // others: only create unless LV_NoPlugins is set
631 create_plugin (current);
632 } else if ((options () & LV_NoGrid) == 0 && current_name == "lay::GridNetPlugin") {
633 // except grid net plugin which is created on request
634 create_plugin (current);
635 }
636
637 }
638
639 }
640
641 mode (default_mode ());
642}
643
644lay::Plugin *LayoutViewBase::create_plugin (const lay::PluginDeclaration *cls)
645{

Callers

nothing calls this directly

Calls 6

optionsFunction · 0.85
beginFunction · 0.70
endFunction · 0.70
create_pluginFunction · 0.70
modeFunction · 0.70
operator->Method · 0.45

Tested by

no test coverage detected