MeVisLab Toolbox Reference
mlPageRequestProcessor.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_PROCESSOR_H
14
#define ML_PAGE_REQUEST_PROCESSOR_H
15
17
18
// ML-includes
19
#include "
mlInitSystemML.h
"
20
21
#include "
mlInitSystemML.h
"
22
23
ML_START_NAMESPACE
24
25
class
TileRequest;
26
class
PageRequest;
27
class
PageRequestCursor;
28
29
//-------------------------------------------------------------------------------------------
31
//-------------------------------------------------------------------------------------------
32
class
MLEXPORT
PageRequestQueueInterface
33
{
34
public
:
36
virtual
~PageRequestQueueInterface
() {};
37
39
virtual
void
append
(
PageRequest
*
request
) = 0;
40
};
41
42
43
//-------------------------------------------------------------------------------------------
45
//-------------------------------------------------------------------------------------------
46
class
MLEXPORT
PageRequestProcessor
:
public
PageRequestQueueInterface
47
{
48
public
:
50
~PageRequestProcessor
()
override
{}
51
53
virtual
void
addRootTileRequest
(
TileRequest
*
tileRequest
) = 0;
54
56
virtual
void
processAll
() = 0;
57
59
virtual
void
process
(
double
timeBudget
) = 0;
60
62
virtual
bool
needsProcessing
() = 0;
63
65
virtual
void
removeCancelledRequests
() = 0;
66
72
virtual
void
enterProcessingScope
() = 0;
73
75
virtual
void
leaveProcessingScope
() = 0;
76
78
virtual
void
setNumWorkerThreads
(std::size_t
/*threads*/
) = 0;
79
81
virtual
bool
processingWasSingleThreaded
()
const
= 0;
82
84
static
void
enableTileRequestAllocationFailure
(
int
count = 1);
86
static
void
disableTileRequestAllocationFailure
();
87
88
};
89
90
91
ML_END_NAMESPACE
92
93
#endif
//of __mlPageRequestProcessor_H
94
ml::PageRequestProcessor
Abstract base class for page request processors.
Definition
mlPageRequestProcessor.h:47
ml::PageRequestProcessor::setNumWorkerThreads
virtual void setNumWorkerThreads(std::size_t)=0
Set number of worker threads (available here even if subclasses may not support it)
ml::PageRequestProcessor::processingWasSingleThreaded
virtual bool processingWasSingleThreaded() const =0
Returns if the last request was processed single or multi-threaded.
ml::PageRequestProcessor::processAll
virtual void processAll()=0
Processes all requests until the cursors have traversed the whole tree and the queue is empty.
ml::PageRequestProcessor::process
virtual void process(double timeBudget)=0
Process the requests for the given timeBudget given in seconds.
ml::PageRequestProcessor::removeCancelledRequests
virtual void removeCancelledRequests()=0
Removes all requests that are canceled and no longer needed.
ml::PageRequestProcessor::needsProcessing
virtual bool needsProcessing()=0
Returns if the tile request needs some more processing.
ml::PageRequestProcessor::enableTileRequestAllocationFailure
static void enableTileRequestAllocationFailure(int count=1)
Enables failing on every count allocation.
ml::PageRequestProcessor::enterProcessingScope
virtual void enterProcessingScope()=0
Enters a recursive processing scope (always called from main thread!) Default scope is 0 (which is us...
ml::PageRequestProcessor::leaveProcessingScope
virtual void leaveProcessingScope()=0
Leaves a recursive processing scope (always called from main thread!)
ml::PageRequestProcessor::disableTileRequestAllocationFailure
static void disableTileRequestAllocationFailure()
Disables allocation failure (default!)
ml::PageRequestProcessor::~PageRequestProcessor
~PageRequestProcessor() override
Virtual destructor.
Definition
mlPageRequestProcessor.h:50
ml::PageRequestProcessor::addRootTileRequest
virtual void addRootTileRequest(TileRequest *tileRequest)=0
Adds the root tileRequest that should be processed (the ownership stays with the caller).
ml::PageRequestQueueInterface
Virtual interface for queuing PageRequests that are ready for processing.
Definition
mlPageRequestProcessor.h:33
ml::PageRequestQueueInterface::~PageRequestQueueInterface
virtual ~PageRequestQueueInterface()
Virtual destructor to get rid of warning.
Definition
mlPageRequestProcessor.h:36
ml::PageRequestQueueInterface::append
virtual void append(PageRequest *request)=0
Append PageRequest request which is ready for processing to the work queue.
ml::PageRequest
A PageRequest represents the request for the calculation of a single page of a PagedImage.
Definition
mlPageRequest.h:32
ml::TileRequest
A TileRequest either represents the input sub image that is needed by a PageRequest or if it is a roo...
Definition
mlTileRequest.h:50
mlInitSystemML.h
MLEXPORT
#define MLEXPORT
To export symbols from a dll/shared object, we need to mark them with the MLEXPORT symbol.
Definition
mlInitSystemML.h:38
mlrange_cast
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
Definition
mlRangeCasts.h:332
MeVis
Foundation
Sources
ML
include
host
mlPageRequestProcessor.h
Generated by
1.10.0