MeVisLab Toolbox Reference
mlSingleThreadedPageRequestProcessor.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_SINGLE_THREADED_PAGE_REQUEST_PROCESSOR_H
14#define ML_SINGLE_THREADED_PAGE_REQUEST_PROCESSOR_H
15
16#include "mlInitSystemML.h"
17
20
21ML_START_NAMESPACE
22
23//-------------------------------------------------------------------------------------------
26//-------------------------------------------------------------------------------------------
28{
29public:
32
34 bool supportsMultiThreading() override { return false; }
35
37 void setNumWorkerThreads(std::size_t /*threads*/) override {};
38
40 void addRootTileRequest(TileRequest* tileRequest) override;
41
43 void processAll() override;
44
46 void process(double timeBudget) override;
47
49 bool needsProcessing() override;
50
52 void append(PageRequest* request) override;
53
55 bool processingWasSingleThreaded() const override { return true; }
56
57private:
59 bool processNextGUIRequest(bool processAll);
60
62 MLErrorCode processRequest(PageRequest* request);
63
65 static void rootTileRequestFinishedCB(void* data, TileRequest* request);
66
68 void rootTileRequestFinished(TileRequest* request);
69
70};
71
72ML_END_NAMESPACE
73
74#endif
75
PageRequestProcessorBase(Host *host)
void setNumWorkerThreads(std::size_t) override
Sets the number of threads (ignored by this implementation).
bool supportsMultiThreading() override
Returns whether multithreading is supported.
void addRootTileRequest(TileRequest *tileRequest) override
Adds the root tileRequest that should be processed; the ownership stays with the caller.
bool needsProcessing() override
Returns whether the tile request needs some more processing.
void process(double timeBudget) override
Process the requests for the given timeBudget given in seconds.
void processAll() override
Processes all requests until the cursors have traversed the entire tree and the queue is empty.
bool processingWasSingleThreaded() const override
Processing is always single-threaded, only implemented for testing purposes.
SingleThreadedPageRequestProcessor(Host *host=nullptr)
void append(PageRequest *request) override
Implements PageRequestQueueInterface interface.
MLint32 MLErrorCode
Type of an ML Error code.
Definition mlTypeDefs.h:715
#define MLEXPORT
Code it as import symbol if compiled elsewhere.