MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
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
52 {
53 _processingScope = scope;
54 }
55
58 {
59 return _processingScope;
60 }
61
68
74
77
80
82 void collectPageRequestsWithErrors(std::set<PageRequest*>& result);
83
86 bool isNeeded();
87
89 void clear();
90
93 {
94 return _tileRequest;
95 }
96
98 void append(PageRequest* request) override;
99
102 {
103 return _numCreatedPageRequests;
104 };
105
106private:
108 void commonInit();
109
114 void moveUpToNextDown();
115
117 PageRequest* _pageRequest;
119 TileRequest* _tileRequest;
120
122 PageRequest* _pageRequestToPutInQueue;
123
125 int _processingScope;
126
128 int _currentDepth;
129
130 MLint _numCreatedPageRequests;
131};
132
134
135#endif // of __mlPageRequestCursor_H
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:772
#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:489