| 407 | typename mem_manager |
| 408 | > |
| 409 | void deserialize ( |
| 410 | array2d<T,mem_manager>& item, |
| 411 | std::istream& in |
| 412 | ) |
| 413 | { |
| 414 | try |
| 415 | { |
| 416 | long nr, nc; |
| 417 | deserialize(nr,in); |
| 418 | deserialize(nc,in); |
| 419 | |
| 420 | // this is the newer serialization format |
| 421 | if (nr < 0 || nc < 0) |
| 422 | { |
| 423 | nr *= -1; |
| 424 | nc *= -1; |
| 425 | } |
| 426 | else |
| 427 | { |
| 428 | std::swap(nr,nc); |
| 429 | } |
| 430 | |
| 431 | item.set_size(nr,nc); |
| 432 | |
| 433 | while (item.move_next()) |
| 434 | deserialize(item.element(),in); |
| 435 | item.reset(); |
| 436 | } |
| 437 | catch (serialization_error& e) |
| 438 | { |
| 439 | item.clear(); |
| 440 | throw serialization_error(e.info + "\n while deserializing object of type array2d"); |
| 441 | } |
| 442 | } |
| 443 | |
| 444 | // ---------------------------------------------------------------------------------------- |
| 445 | // ---------------------------------------------------------------------------------------- |