| 53 | |
| 54 | template<typename TDatums> |
| 55 | void WIdGenerator<TDatums>::work(TDatums& tDatums) |
| 56 | { |
| 57 | try |
| 58 | { |
| 59 | if (checkNoNullNorEmpty(tDatums)) |
| 60 | { |
| 61 | // Debugging log |
| 62 | opLogIfDebug("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); |
| 63 | // Profiling speed |
| 64 | const auto profilerKey = Profiler::timerInit(__LINE__, __FUNCTION__, __FILE__); |
| 65 | // Add ID |
| 66 | for (auto& tDatumPtr : *tDatums) |
| 67 | // To avoid overwritting ID if e.g., custom input has already filled it |
| 68 | if (tDatumPtr->id == std::numeric_limits<unsigned long long>::max()) |
| 69 | tDatumPtr->id = mGlobalCounter; |
| 70 | // Increase ID |
| 71 | const auto& tDatumPtr = (*tDatums)[0]; |
| 72 | if (tDatumPtr->subId == tDatumPtr->subIdMax) |
| 73 | mGlobalCounter++; |
| 74 | // Profiling speed |
| 75 | Profiler::timerEnd(profilerKey); |
| 76 | Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__); |
| 77 | // Debugging log |
| 78 | opLogIfDebug("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); |
| 79 | } |
| 80 | } |
| 81 | catch (const std::exception& e) |
| 82 | { |
| 83 | this->stop(); |
| 84 | tDatums = nullptr; |
| 85 | error(e.what(), __LINE__, __FUNCTION__, __FILE__); |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | COMPILE_TEMPLATE_DATUM(WIdGenerator); |
| 90 | } |
nothing calls this directly
no test coverage detected