This utility handles transparently the DPL inputs and triggers a customizable action on sequences of consecutive raw pages following similar RDH features, e.g. the same FEE ID.
More...
|
| DPLRawPageSequencer ()=delete |
|
| DPLRawPageSequencer (InputRecord &inputs, std::vector< InputSpec > filterSpecs={}) |
|
template<typename Predicate , typename Inserter , typename Precheck > |
int | operator() (Predicate &&pred, Inserter &&inserter, Precheck preCheck) |
|
template<typename Predicate , typename Inserter > |
int | operator() (Predicate &&pred, Inserter &&inserter) |
|
template<typename Predicate , typename Inserter > |
int | binary (Predicate pred, Inserter inserter) |
|
template<typename Predicate , typename Inserter , typename Precheck > |
int | binary (Predicate pred, Inserter inserter, Precheck preCheck) |
|
template<typename Predicate , typename Inserter > |
int | forward (Predicate pred, Inserter inserter) |
|
template<typename Predicate , typename Inserter , typename Precheck > |
int | forward (Predicate pred, Inserter inserter, Precheck preCheck) |
|
This utility handles transparently the DPL inputs and triggers a customizable action on sequences of consecutive raw pages following similar RDH features, e.g. the same FEE ID.
A DPL processor will receive raw pages accumulated on three levels: 1) the DPL processor has one or more input route(s) 2) multiple parts per input route (split payloads or multiple input specs matching the same route spec 3) variable number of raw pages in one payload
The DPLRawPageSequencer loops transparently over all inputs matching the optional filter, and partitions input buffers into sequences of raw pages matching the provided predicate by binary search.
Note: binary search requires that all raw pages must have a fixed length, only the last page can be shorter.
Usage: auto isSameRdh = [](const char* left, const char* right) -> bool { // implement the condition here return left == right; }; std::vector<std::pair<const char*, size_t>> pages; auto insertPages = [&pages](const char* ptr, size_t n) -> void { // as an example, the sequences are simply stored in a vector pages.emplace_back(ptr, n); }; DPLRawPageSequencer(inputs)(isSameRdh, insertPages);
TODO:
- support configurable page length
Definition at line 68 of file DPLRawPageSequencer.h.