MeVisLab Toolbox Reference
ml::SingleThreadedPageRequestProcessor Class Reference

#include <mlSingleThreadedPageRequestProcessor.h>

Inheritance diagram for ml::SingleThreadedPageRequestProcessor:
ml::PageRequestProcessorBase ml::PageRequestProcessor ml::PageRequestQueueInterface

Public Member Functions

 SingleThreadedPageRequestProcessor (Host *host=nullptr)
 ~SingleThreadedPageRequestProcessor () override
bool supportsMultiThreading () override
 Returns whether multithreading is supported.
void setNumWorkerThreads (std::size_t) override
 Sets the number of threads (ignored by this implementation).
void addRootTileRequest (TileRequest *tileRequest) override
 Adds the root tileRequest that should be processed; the ownership stays with the caller.
void processAll () override
 Processes all requests until the cursors have traversed the entire tree and the queue is empty.
void process (double timeBudget) override
 Process the requests for the given timeBudget given in seconds.
bool needsProcessing () override
 Returns whether the tile request needs some more processing.
void append (PageRequest *request) override
 Implements PageRequestQueueInterface interface.
bool processingWasSingleThreaded () const override
 Processing is always single-threaded, only implemented for testing purposes.
Public Member Functions inherited from ml::PageRequestProcessorBase
 PageRequestProcessorBase (Host *host)
 ~PageRequestProcessorBase () override
void removeCancelledRequests () override
ProcessingTimeLinegetProcessingTimeLine ()
 Returns access to the processing timeline.
ProcessingTimeLine::TimeLinegetOverviewTimeLine ()
 Returns access to the overview timeline (only if timeline profiling is on).
void enableTimeLineProfiling (bool flag)
 Enables/disables timeline profiling.
bool isTimeLineProfilingEnabled () const
 Returns whether timeline profiling is enabled.
int getProcessingScope () const
 Returns the current processing scope.
void enterProcessingScope () override
 Enters a recursive processing scope. This is always called from main thread!
void leaveProcessingScope () override
 Leaves a recursive processing scope. This is always called from main thread!
Public Member Functions inherited from ml::PageRequestProcessor
 ~PageRequestProcessor () override
 Virtual destructor.
Public Member Functions inherited from ml::PageRequestQueueInterface
virtual ~PageRequestQueueInterface ()
 Virtual destructor to get rid of warning.

Additional Inherited Members

Static Public Member Functions inherited from ml::PageRequestProcessor
static void enableTileRequestAllocationFailure (int count=1)
 Enables failing on every count allocation.
static void disableTileRequestAllocationFailure ()
 Disables allocation failure. This is the default!
Protected Member Functions inherited from ml::PageRequestProcessorBase
bool createMoreWork (bool sleepWhenBlocked, bool *allBlocked=nullptr, MLint pageRequestLimit=100000, MLint *resultPageRequestCount=nullptr)
 Creates more work items, returns true if new work was created.
void setupCurrentProcessingScope ()
 Helper.
virtual void handleErrorsInGUIThread ()
 Handles all errors that have been accumulated.
void terminateAllRequestsInGUIThread ()
 Terminates all requests.
void addNewCursor (PageRequestCursor *cursor)
 Adds the new cursor.
virtual void getAllPageRequestQueues (std::vector< std::deque< PageRequest * > * > &queues)
 Returns all page request queues (to be derived when there are more than the GUI queues).
UserThreadDatagetUserThreadData (PageRequest *request, PerThreadStorage &perThreadStorage)
 Returns or allocates the UserThreadData for the given request as part of the perThreadStorage.
Protected Attributes inherited from ml::PageRequestProcessorBase
Host_host
 Optional pointer to the host.
bool _terminated
 Flag whether the calculation was terminated.
int _rootTileRequests
 The number of root tile requests; if this gets down to 0, we are done.
std::vector< std::vector< PageRequestCursor * > > _cursors
int _processingScope
 The current processing scope (0 = BG tasks, 1 = normal get tile, >1 = recursive get tile).
int _producerProcessingScope
 The current cursor scope of the producer.
int _producerCursorCounter
 How many cursors the producer contains in all lists.
int _guiThreadRecursionCounter
 The recursion of the GUI thread (0 = outer entry).
ScopeStackEntry_currentScope
 The current scope pointer.
std::vector< ScopeStackEntry_scopeStack
TimeCounter _progressUpdateTimer
 Timer used for progress update from GUI thread.
PerThreadStorage _guiPerThreadStorage
 The per-thread storage for the GUI thread.
bool _useTimeLineProfiling
ProcessingTimeLine _profile
ProcessingTimeLine::TimeLine_guiThreadTimeLine
ProcessingTimeLine::TimeLine_overviewTimeLine

Detailed Description

A single-threaded processor that takes one or even multiple tile requests and can process them iteratively.

Definition at line 27 of file mlSingleThreadedPageRequestProcessor.h.

Constructor & Destructor Documentation

◆ SingleThreadedPageRequestProcessor()

ml::SingleThreadedPageRequestProcessor::SingleThreadedPageRequestProcessor ( Host * host = nullptr)

◆ ~SingleThreadedPageRequestProcessor()

ml::SingleThreadedPageRequestProcessor::~SingleThreadedPageRequestProcessor ( )
override

Member Function Documentation

◆ addRootTileRequest()

void ml::SingleThreadedPageRequestProcessor::addRootTileRequest ( TileRequest * tileRequest)
overridevirtual

Adds the root tileRequest that should be processed; the ownership stays with the caller.

Implements ml::PageRequestProcessor.

◆ append()

void ml::SingleThreadedPageRequestProcessor::append ( PageRequest * request)
overridevirtual

Implements PageRequestQueueInterface interface.

Implements ml::PageRequestQueueInterface.

◆ needsProcessing()

bool ml::SingleThreadedPageRequestProcessor::needsProcessing ( )
overridevirtual

Returns whether the tile request needs some more processing.

Implements ml::PageRequestProcessor.

◆ process()

void ml::SingleThreadedPageRequestProcessor::process ( double timeBudget)
overridevirtual

Process the requests for the given timeBudget given in seconds.

Implements ml::PageRequestProcessor.

◆ processAll()

void ml::SingleThreadedPageRequestProcessor::processAll ( )
overridevirtual

Processes all requests until the cursors have traversed the entire tree and the queue is empty.

Implements ml::PageRequestProcessor.

◆ processingWasSingleThreaded()

bool ml::SingleThreadedPageRequestProcessor::processingWasSingleThreaded ( ) const
inlineoverridevirtual

Processing is always single-threaded, only implemented for testing purposes.

Implements ml::PageRequestProcessor.

Definition at line 55 of file mlSingleThreadedPageRequestProcessor.h.

◆ setNumWorkerThreads()

void ml::SingleThreadedPageRequestProcessor::setNumWorkerThreads ( std::size_t )
inlineoverridevirtual

Sets the number of threads (ignored by this implementation).

Implements ml::PageRequestProcessor.

Definition at line 37 of file mlSingleThreadedPageRequestProcessor.h.

◆ supportsMultiThreading()

bool ml::SingleThreadedPageRequestProcessor::supportsMultiThreading ( )
inlineoverridevirtual

Returns whether multithreading is supported.

Implements ml::PageRequestProcessorBase.

Definition at line 34 of file mlSingleThreadedPageRequestProcessor.h.


The documentation for this class was generated from the following file: