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

Method LayoutHandle

src/laybasic/laybasic/layLayoutHandle.cc:49–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47
48
49LayoutHandle::LayoutHandle (db::Layout *layout, const std::string &filename)
50 : mp_layout (layout),
51 m_ref_count (0),
52 m_filename (filename),
53 m_dirty (false),
54 m_save_options_valid (false)
55{
56 // the layout gets held by the LayoutHandle object
57 layout->keep ();
58
59 layout->technology_changed_event.add (this, &LayoutHandle::on_technology_changed);
60
61 // layouts in the managed layouts space participate in spare proxy cleanup
62 layout->do_cleanup (true);
63
64 add_file_to_watcher (m_filename);
65
66 if (! m_filename.empty ()) {
67 rename (filename_for_caption (m_filename));
68 } else {
69
70 // create a unique new name
71 static int nn = 0;
72
73 std::string n;
74 do {
75 n = tl::sprintf ("L%d", ++nn);
76 } while (find (n) != 0);
77
78 m_name = n;
79 ms_dict.insert (std::make_pair (n, this));
80
81 }
82
83 mp_layout->hier_changed_event.add (this, &LayoutHandle::layout_changed);
84 mp_layout->bboxes_changed_any_event.add (this, &LayoutHandle::layout_changed);
85 mp_layout->cell_name_changed_event.add (this, &LayoutHandle::layout_changed);
86 mp_layout->prop_ids_changed_event.add (this, &LayoutHandle::layout_changed);
87 mp_layout->layer_properties_changed_event.add (this, &LayoutHandle::layout_changed);
88
89 if (tl::verbosity () >= 30) {
90 tl::info << "Created layout " << name ();
91 }
92}
93
94LayoutHandle::~LayoutHandle ()
95{

Callers

nothing calls this directly

Calls 11

renameFunction · 0.85
filename_for_captionFunction · 0.85
verbosityFunction · 0.85
findFunction · 0.70
nameFunction · 0.70
sprintfFunction · 0.50
keepMethod · 0.45
addMethod · 0.45
do_cleanupMethod · 0.45
emptyMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected