| 618 | |
| 619 | |
| 620 | void EsriReader::load(int nodeId) |
| 621 | { |
| 622 | std::string filepath = "nodes/" + std::to_string(nodeId); |
| 623 | m_pool->add([this, filepath]() |
| 624 | { |
| 625 | TileContents tile; |
| 626 | try |
| 627 | { |
| 628 | tile = loadPath(filepath); |
| 629 | } |
| 630 | //ABELL - Need to make sure we trap all the errors |
| 631 | // from size check, fetchBinary, decompress... |
| 632 | catch (const i3s::EsriError& e) |
| 633 | { |
| 634 | tile.m_error = e.what(); |
| 635 | } |
| 636 | |
| 637 | // Stick the loaded tile on the output queue. |
| 638 | { |
| 639 | std::unique_lock<std::mutex> l(m_mutex); |
| 640 | m_contents.push(std::move(tile)); |
| 641 | } |
| 642 | m_contentsCv.notify_one(); |
| 643 | } |
| 644 | ); |
| 645 | } |
| 646 | |
| 647 | |
| 648 | EsriReader::TileContents EsriReader::loadPath(const std::string& filepath) |