MCPcopy Create free account
hub / github.com/nodejs/nan / AsyncBareProgressQueueWorker

Class AsyncBareProgressQueueWorker

nan.h:2271–2306  ·  view source on GitHub ↗

abstract */

Source from the content-addressed store, hash-verified

2269template<class T>
2270/* abstract */
2271class AsyncBareProgressQueueWorker : public AsyncBareProgressWorkerBase {
2272 public:
2273 explicit AsyncBareProgressQueueWorker(
2274 Callback *callback_,
2275 const char* resource_name = "nan:AsyncBareProgressQueueWorker")
2276 : AsyncBareProgressWorkerBase(callback_, resource_name) {
2277 }
2278
2279 virtual ~AsyncBareProgressQueueWorker() {
2280 }
2281
2282 class ExecutionProgress {
2283 friend class AsyncBareProgressQueueWorker;
2284 public:
2285 void Send(const T* data, size_t count) const {
2286 that_->SendProgress_(data, count);
2287 }
2288
2289 private:
2290 explicit ExecutionProgress(AsyncBareProgressQueueWorker *that)
2291 : that_(that) {}
2292 NAN_DISALLOW_ASSIGN_COPY_MOVE(ExecutionProgress)
2293 AsyncBareProgressQueueWorker* const that_;
2294 };
2295
2296 virtual void Execute(const ExecutionProgress& progress) = 0;
2297 virtual void HandleProgressCallback(const T *data, size_t size) = 0;
2298
2299 private:
2300 void Execute() /*final override*/ {
2301 ExecutionProgress progress(this);
2302 Execute(progress);
2303 }
2304
2305 virtual void SendProgress_(const T *data, size_t count) = 0;
2306};
2307
2308template<class T>
2309/* abstract */

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected