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

Method new_cell

src/laybasic/laybasic/layLayoutViewBase.cc:6366–6385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6364}
6365
6366db::cell_index_type
6367LayoutViewBase::new_cell (int cv_index, const std::string &cell_name)
6368{
6369 db::cell_index_type new_ci (0);
6370
6371 if (cv_index >= 0 && int (m_cellviews.size ()) > cv_index) {
6372
6373 db::Layout &layout = cellview (cv_index)->layout ();
6374 if (! cell_name.empty () && layout.cell_by_name (cell_name.c_str ()).first) {
6375 throw tl::Exception (tl::to_string (tr ("A cell with that name already exists: %s")), cell_name);
6376 }
6377
6378 transaction (tl::to_string (tr ("New cell")));
6379 new_ci = layout.add_cell (cell_name.empty () ? 0 : cell_name.c_str ());
6380 commit ();
6381
6382 }
6383
6384 return new_ci;
6385}
6386
6387template <class T, class Iter>
6388static void make_unique_name (T *object, Iter from, Iter to)

Callers 1

cm_new_cellMethod · 0.45

Calls 11

transactionFunction · 0.70
commitFunction · 0.70
ExceptionClass · 0.50
to_stringFunction · 0.50
trFunction · 0.50
sizeMethod · 0.45
layoutMethod · 0.45
emptyMethod · 0.45
cell_by_nameMethod · 0.45
c_strMethod · 0.45
add_cellMethod · 0.45

Tested by

no test coverage detected