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
21
#include <
host/mlPageRequestProcessor.h
>
22
23
#include <set>
24
25
ML_START_NAMESPACE
26
27
class
TileRequest;
28
class
PageRequest;
29
30
#define ML_PAGEREQUEST_TILES_NOT_CREATED -1
31
#define ML_TILEREQUEST_PAGES_NOT_CREATED -1
32
33
//-------------------------------------------------------------------------------------------
36
//-------------------------------------------------------------------------------------------
37
class
MLEXPORT
PageRequestCursor
:
public
PageRequestQueueInterface
38
{
39
public
:
41
PageRequestCursor
(
PageRequest
* request);
43
PageRequestCursor
(
TileRequest
* request);
45
PageRequestCursor
();
46
48
void
init
(
TileRequest
* request);
49
51
void
setProcessingScope
(
int
scope) { _processingScope = scope; }
52
54
int
getProcessingScope
()
const
{
return
_processingScope; }
55
57
enum
CursorState
{
58
HasMoreWork
,
59
HasFinished
,
60
IsBlocked
61
};
62
67
CursorState
nextStep
(
PageRequestQueueInterface
& queue,
bool
&hasCreatedWork);
68
70
bool
propagateCancellationDownIfRequestNotNeededAnymore
();
71
73
void
propagateErrorUpwards
(
MLErrorCode
error);
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
93
private
:
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
120
ML_END_NAMESPACE
121
122
#endif
//of __mlPageRequestCursor_H
123
ml::PageRequestCursor::CursorState
CursorState
Defines the current state of the cursor.
Definition
mlPageRequestCursor.h:57
ml::PageRequestCursor::HasFinished
@ HasFinished
The cursor has no more work and may be removed.
Definition
mlPageRequestCursor.h:59
ml::PageRequestCursor::HasMoreWork
@ HasMoreWork
Further work is available, re-call nextStep().
Definition
mlPageRequestCursor.h:58
ml::PageRequestCursor::IsBlocked
@ IsBlocked
The cursor has more work but is blocked by a pending request (e.g., a pending memory image).
Definition
mlPageRequestCursor.h:60
ml::PageRequestCursor::PageRequestCursor
PageRequestCursor(TileRequest *request)
Creates a cursor from a root TileRequest.
ml::PageRequestCursor::setProcessingScope
void setProcessingScope(int scope)
Sets the processing scope.
Definition
mlPageRequestCursor.h:51
ml::PageRequestCursor::nextStep
CursorState nextStep(PageRequestQueueInterface &queue, bool &hasCreatedWork)
ml::PageRequestCursor::getProcessingScope
int getProcessingScope() const
Returns the processing scope.
Definition
mlPageRequestCursor.h:54
ml::PageRequestCursor::propagateCancellationDownIfRequestNotNeededAnymore
bool propagateCancellationDownIfRequestNotNeededAnymore()
See Page/TileRequest.
ml::PageRequestCursor::currentTileRequest
TileRequest * currentTileRequest()
Returns the current tile request.
Definition
mlPageRequestCursor.h:85
ml::PageRequestCursor::PageRequestCursor
PageRequestCursor(PageRequest *request)
Creates a cursor from a root PageRequest.
ml::PageRequestCursor::propagateErrorUpwards
void propagateErrorUpwards(MLErrorCode error)
See Page/TileRequest.
ml::PageRequestCursor::init
void init(TileRequest *request)
Initializes from a TileRequest.
ml::PageRequestCursor::getNumCreatedPageRequests
MLint getNumCreatedPageRequests() const
Returns number of created page requests (inner requests, not the requests that are in the queue).
Definition
mlPageRequestCursor.h:91
ml::PageRequestCursor::append
void append(PageRequest *request) override
Appends PageRequest request that is ready for processing to the work queue.
ml::PageRequestCursor::clear
void clear()
Clears the cursor so that it points to no requests anymore.
ml::PageRequestCursor::isNeeded
bool isNeeded()
Returns whether the cursor is still needed (which is the case when it points to either a PageRequest ...
ml::PageRequestCursor::PageRequestCursor
PageRequestCursor()
Creates an empty cursor.
ml::PageRequestCursor::collectPageRequestsWithErrors
void collectPageRequestsWithErrors(std::set< PageRequest * > &result)
See Page/TileRequest.
ml::PageRequestQueueInterface
Virtual interface for queuing PageRequests that are ready for processing.
Definition
mlPageRequestProcessor.h:33
ml::PageRequest
Definition
mlPageRequest.h:32
ml::TileRequest
Definition
mlTileRequest.h:50
MLErrorCode
MLint32 MLErrorCode
Type of an ML Error code.
Definition
mlTypeDefs.h:715
mlInitSystemML.h
MLEXPORT
#define MLEXPORT
Code it as import symbol if compiled elsewhere.
Definition
mlInitSystemML.h:38
mlPageRequestProcessor.h
MLint
MLint64 MLint
Definition
mlTypeDefs.h:489
MeVis
Foundation
Sources
ML
include
host
mlPageRequestCursor.h
Generated by
1.15.0