Streamed execution.
| 71 | |
| 72 | // Streamed execution. |
| 73 | void Streamable::execute(StreamPointTable& table) |
| 74 | { |
| 75 | m_log->get(LogLevel::Debug) << "Executing pipeline in stream mode." << |
| 76 | std::endl; |
| 77 | struct StreamableList : public std::list<Streamable *> |
| 78 | { |
| 79 | StreamableList operator - (const StreamableList& other) const |
| 80 | { |
| 81 | StreamableList resultList; |
| 82 | auto ti = rbegin(); |
| 83 | auto oi = other.rbegin(); |
| 84 | |
| 85 | while (oi != other.rend() && ti != rend() && *ti == *oi) |
| 86 | { |
| 87 | oi++; |
| 88 | ti++; |
| 89 | } |
| 90 | while (ti != rend()) |
| 91 | resultList.push_front(*ti++); |
| 92 | return resultList; |
| 93 | }; |
| 94 | |
| 95 | void ready(PointTableRef& table) |
| 96 | { |
| 97 | for (auto s : *this) |
| 98 | { |
| 99 | s->startLogging(); |
| 100 | s->ready(table); |
| 101 | s->stopLogging(); |
| 102 | SpatialReference srs = s->getSpatialReference(); |
| 103 | if (!srs.empty()) |
| 104 | table.setSpatialReference(srs); |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | void done(PointTableRef& table) |
| 109 | { |
| 110 | for (auto s : *this) |
| 111 | { |
| 112 | s->startLogging(); |
| 113 | s->done(table); |
| 114 | s->stopLogging(); |
| 115 | } |
| 116 | } |
| 117 | }; |
| 118 | |
| 119 | const Stage *nonstreaming = findNonstreamable(); |
| 120 | if (nonstreaming) |
| 121 | nonstreaming->throwError("Attempting to use stream mode with a " |
| 122 | "stage that doesn't support streaming."); |
| 123 | |
| 124 | SpatialReference srs; |
| 125 | std::list<StreamableList> lists; |
| 126 | StreamableList stages; |
| 127 | StreamableList lastRunStages; |
| 128 | |
| 129 | if (!table.layout()->finalized()) |
| 130 | { |
nothing calls this directly
no test coverage detected