13 #ifndef ML_IMAGING_BACKGROUND_TASK_H
14 #define ML_IMAGING_BACKGROUND_TASK_H
47 AllocationPolicyMask = 0xf,
49 RequestReadOnlyPage = 16,
52 ReceiveProgressMessages = 32
60 : _tileId(tileId), _task(task)
67 return _task->getFinishedRequest(_tileId, found);
81 : _id(tileId), _task(task)
89 return _task->waitForProcessAllPages(_id);
100 return _nextTileRequestId++;
114 this->handler = handlerArg;
115 this->image =
nullptr;
120 this->image = imageArg;
121 this->handler =
nullptr;
133 ProcessAllPagesHandler* handler;
134 ManagedSubImage* image;
154 std::deque<RequestResult> _availableTiles;
#define MLBACKGROUNDTASKS_EXPORT
Project global and OS specific declarations.
an asynchronous tile request (copyable!)
ManagedSubImage * getTile()
get the requested tile (this will block until the tile is received) it returns NULL if the task was c...
AsyncTileRequest(BackgroundRequestId tileId, ImagingBackgroundTask *task)
an asynchronous process all pages request (copyable!)
bool waitUntilFinished()
Wait until the process all pages request has finished, returns false if the request failed.
ProcessAllPagesRequest(BackgroundRequestId tileId, ImagingBackgroundTask *task)
TileRequestFlags
Defines flags that can be passed with requestTile(). NOTE: Only one of the allocation schemes can be ...
ImagingBackgroundTask(void *owner)
BackgroundRequestId generateBackgroundRequestId()
generate next generateBackgroundRequestId()
~ImagingBackgroundTask() override
ManagedSubImage is derived from SubImage and frees its allocated memory automatically when it is dest...
MessagingBackgroundTask extends the BackgroundTask with the functionality to call methods on DistantO...
Base class for handlers that are used for the Module::processAllPages facility.
#define ML_DISALLOW_COPY_AND_ASSIGN(className)
Defines basic macros.
MLuint32 BackgroundRequestId
the id of a tile request