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

Method insert_cell

src/db/db/dbLayout.cc:1333–1352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1331}
1332
1333void
1334Layout::insert_cell (cell_index_type ci, const std::string &name, db::Cell *cell)
1335{
1336 // this method is supposed to restore a cell deleted before
1337 tl_assert (m_cell_names.size () > ci);
1338 tl_assert (m_cell_names [ci] == 0);
1339
1340 char *cp = new char [name.size () + 1];
1341 m_cell_names [ci] = cp;
1342 strcpy (cp, name.c_str ());
1343
1344 invalidate_hier ();
1345
1346 m_cells.push_back_ptr (cell);
1347 m_cell_ptrs [ci] = cell;
1348 m_cell_map.insert (std::make_pair (cp, ci));
1349
1350 cell->reregister ();
1351 ++m_cells_size;
1352}
1353
1354db::Cell *
1355Layout::take_cell (cell_index_type ci)

Callers 1

new_cellMethod · 0.80

Calls 6

invalidate_hierFunction · 0.85
push_back_ptrMethod · 0.80
sizeMethod · 0.45
c_strMethod · 0.45
insertMethod · 0.45
reregisterMethod · 0.45

Tested by

no test coverage detected