| 8 | } // namespace |
| 9 | |
| 10 | SC::Result SC::HttpClientOperationScheduler::init(const HttpClientOperationSchedulerMemory& memory) |
| 11 | { |
| 12 | SC_TRY_MSG(not initialized, "HttpClientOperationScheduler: already initialized"); |
| 13 | SC_TRY_MSG(not memory.operations.empty(), "HttpClientOperationScheduler: operations missing"); |
| 14 | SC_TRY_MSG(memory.readyOperations.sizeInElements() >= memory.operations.sizeInElements(), |
| 15 | "HttpClientOperationScheduler: ready state capacity too small"); |
| 16 | |
| 17 | schedulerMemory = memory; |
| 18 | for (size_t idx = 0; idx < schedulerMemory.operations.sizeInElements(); ++idx) |
| 19 | { |
| 20 | SC_TRY_MSG(schedulerMemory.operations[idx] != nullptr, "HttpClientOperationScheduler: null operation"); |
| 21 | SC_TRY_MSG(schedulerMemory.operations[idx]->isInitialized(), |
| 22 | "HttpClientOperationScheduler: operation not initialized"); |
| 23 | schedulerMemory.readyOperations[idx] = 1; |
| 24 | schedulerMemory.operations[idx]->setNotifier(this); |
| 25 | } |
| 26 | |
| 27 | initialized = true; |
| 28 | readyCV.broadcast(); |
| 29 | return Result(true); |
| 30 | } |
| 31 | |
| 32 | SC::Result SC::HttpClientOperationScheduler::close() |
| 33 | { |
nothing calls this directly
no test coverage detected