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

Function insert

src/db/db/dbArray.h:262–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260
261 template <class Coord>
262 basic_array<Coord> *insert (const basic_array<Coord> &base)
263 {
264 repositories::iterator r;
265 for (r = m_reps.begin (); r != m_reps.end (); ++r) {
266 if ((*r->begin ())->cast (&base)) {
267 break;
268 }
269 }
270
271 if (r == m_reps.end ()) {
272 m_reps.push_back (basic_repository ());
273 r = m_reps.end () - 1;
274 }
275
276 basic_repository::iterator f = r->find ((ArrayBase *) &base);
277 if (f != r->end ()) {
278 return dynamic_cast <basic_array<Coord> *> (*f);
279 } else {
280 basic_array<Coord> *bb = base.clone ();
281 bb->in_repository = true;
282 r->insert (bb);
283 return bb;
284 }
285 }
286
287 void mem_stat (MemStatistics *stat, MemStatistics::purpose_t purpose, int cat, bool no_self = false, void *parent = 0) const;
288

Callers

nothing calls this directly

Calls 7

beginMethod · 0.45
endMethod · 0.45
castMethod · 0.45
push_backMethod · 0.45
findMethod · 0.45
cloneMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected