| 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 | |