MeVisLab Toolbox Reference
mlPageRequestCursor.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2009, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef ML_PAGE_REQUEST_CURSOR_H
14#define ML_PAGE_REQUEST_CURSOR_H
15
17
18// ML-includes
19#include "mlInitSystemML.h"
20
22
23#include <set>
24
26
27class TileRequest;
28class PageRequest;
29
30#define ML_PAGEREQUEST_TILES_NOT_CREATED -1
31#define ML_TILEREQUEST_PAGES_NOT_CREATED -1
32
33//-------------------------------------------------------------------------------------------
36//-------------------------------------------------------------------------------------------
38{
39public:
46
49
51 void setProcessingScope(int scope) { _processingScope = scope; }
52
54 int getProcessingScope() const { return _processingScope; }
55
62
68
71
74
76 void collectPageRequestsWithErrors(std::set<PageRequest*>& result);
77
79 bool isNeeded();
80
82 void clear();
83
85 TileRequest* currentTileRequest() { return _tileRequest; }
86
88 void append(PageRequest* request) override;
89
91 MLint getNumCreatedPageRequests() const { return _numCreatedPageRequests; };
92
93private:
95 void commonInit();
96
101 void moveUpToNextDown();
102
104 PageRequest* _pageRequest;
106 TileRequest* _tileRequest;
107
109 PageRequest* _pageRequestToPutInQueue;
110
112 int _processingScope;
113
115 int _currentDepth;
116
117 MLint _numCreatedPageRequests;
118};
119
121
122#endif //of __mlPageRequestCursor_H
123
A cursor to create page and tile requests iteratively, allowing breaks and resumption at any time,...
CursorState
Defines the current state of the cursor.
@ HasFinished
The cursor has no more work and may be removed.
@ HasMoreWork
Further work is available, re-call nextStep().
PageRequestCursor(TileRequest *request)
Creates a cursor from a root TileRequest.
void setProcessingScope(int scope)
Sets the processing scope.
CursorState nextStep(PageRequestQueueInterface &queue, bool &hasCreatedWork)
Implements an iterative tree traversal with automatic expanding of the tile and page requests.
int getProcessingScope() const
Returns the processing scope.
bool propagateCancellationDownIfRequestNotNeededAnymore()
See Page/TileRequest.
TileRequest * currentTileRequest()
Returns the current tile request.
PageRequestCursor(PageRequest *request)
Creates a cursor from a root PageRequest.
void propagateErrorUpwards(MLErrorCode error)
See Page/TileRequest.
void init(TileRequest *request)
Initializes from a TileRequest.
MLint getNumCreatedPageRequests() const
Returns number of created page requests (inner requests, not the requests that are in the queue).
void append(PageRequest *request) override
Appends PageRequest request that is ready for processing to the work queue.
void clear()
Clears the cursor so that it points to no requests anymore.
bool isNeeded()
Returns whether the cursor is still needed (which is the case when it points to either a PageRequest ...
PageRequestCursor()
Creates an empty cursor.
void collectPageRequestsWithErrors(std::set< PageRequest * > &result)
See Page/TileRequest.
Virtual interface for queuing PageRequests that are ready for processing.
A PageRequest represents the request for the calculation of a single page of a PagedImage.
A TileRequest either represents the input subimage that is needed by a PageRequest or if it is a root...
MLint32 MLErrorCode
Type of an ML Error code.
Definition mlTypeDefs.h:716
#define MLEXPORT
To export symbols from a DLL/shared object, we need to mark them with the MLEXPORT symbol.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition mlTypeDefs.h:490