MeVisLab Toolbox Reference
ml::PageRequestCursor Class Reference

A cursor to create page and tile requests in an iterative manner, to allow breaking/resuming at any time and to avoid a recursive tree traversal which can not be easily resumed. More...

#include <mlPageRequestCursor.h>

Inheritance diagram for ml::PageRequestCursor:
ml::PageRequestQueueInterface

Public Types

enum  CursorState { HasMoreWork , HasFinished , IsBlocked }
 Defines the current state of the cursor. More...
 

Public Member Functions

 PageRequestCursor (PageRequest *request)
 Creates cursor from a root PageRequest. More...
 
 PageRequestCursor (TileRequest *request)
 Creates cursor from a root TileRequest. More...
 
 PageRequestCursor ()
 Creates empty cursor. More...
 
void init (TileRequest *request)
 Initializes from a TileRequest. More...
 
void setProcessingScope (int scope)
 Sets the processing scope. More...
 
int getProcessingScope () const
 Gets the processing scope. More...
 
CursorState nextStep (PageRequestQueueInterface &queue, bool &hasCreatedWork)
 Implements an iterative tree traversal with automatic expanding of the tile and page requests. More...
 
bool propagateCancellationDownIfRequestNotNeededAnymore ()
 See Page/TileRequest. More...
 
void propagateErrorUpwards (MLErrorCode error)
 See Page/TileRequest. More...
 
void collectPageRequestsWithErrors (std::set< PageRequest * > &result)
 See Page/TileRequest. More...
 
bool isNeeded ()
 Returns if the cursor is still needed (which is the case when it points to either a PageRequest or TileRequest). More...
 
void clear ()
 Clears the cursor, so that it points to no requests anymore. More...
 
TileRequestcurrentTileRequest ()
 returns the current tile request More...
 
void append (PageRequest *request) override
 Append PageRequest request which is ready for processing to the work queue. More...
 
MLint getNumCreatedPageRequests () const
 Return number of created page requests (inner requests, not the requests that are in the queue). More...
 
- Public Member Functions inherited from ml::PageRequestQueueInterface
virtual ~PageRequestQueueInterface ()
 Virtual destructor to get rid of warning. More...
 

Detailed Description

A cursor to create page and tile requests in an iterative manner, to allow breaking/resuming at any time and to avoid a recursive tree traversal which can not be easily resumed.

Definition at line 38 of file mlPageRequestCursor.h.

Member Enumeration Documentation

◆ CursorState

Defines the current state of the cursor.

Enumerator
HasMoreWork 

Further work is available, re-call nextStep().

HasFinished 

The cursor has no more work to-do and may be removed.

IsBlocked 

The cursor has more work but is blocked by a pending request (e.g., a pending memory image).

Definition at line 58 of file mlPageRequestCursor.h.

Constructor & Destructor Documentation

◆ PageRequestCursor() [1/3]

ml::PageRequestCursor::PageRequestCursor ( PageRequest request)

Creates cursor from a root PageRequest.

◆ PageRequestCursor() [2/3]

ml::PageRequestCursor::PageRequestCursor ( TileRequest request)

Creates cursor from a root TileRequest.

◆ PageRequestCursor() [3/3]

ml::PageRequestCursor::PageRequestCursor ( )

Creates empty cursor.

Member Function Documentation

◆ append()

void ml::PageRequestCursor::append ( PageRequest request)
overridevirtual

Append PageRequest request which is ready for processing to the work queue.

Implements ml::PageRequestQueueInterface.

◆ clear()

void ml::PageRequestCursor::clear ( )

Clears the cursor, so that it points to no requests anymore.

◆ collectPageRequestsWithErrors()

void ml::PageRequestCursor::collectPageRequestsWithErrors ( std::set< PageRequest * > &  result)

See Page/TileRequest.

◆ currentTileRequest()

TileRequest* ml::PageRequestCursor::currentTileRequest ( )
inline

returns the current tile request

Definition at line 86 of file mlPageRequestCursor.h.

◆ getNumCreatedPageRequests()

MLint ml::PageRequestCursor::getNumCreatedPageRequests ( ) const
inline

Return number of created page requests (inner requests, not the requests that are in the queue).

Definition at line 92 of file mlPageRequestCursor.h.

◆ getProcessingScope()

int ml::PageRequestCursor::getProcessingScope ( ) const
inline

Gets the processing scope.

Definition at line 55 of file mlPageRequestCursor.h.

◆ init()

void ml::PageRequestCursor::init ( TileRequest request)

Initializes from a TileRequest.

◆ isNeeded()

bool ml::PageRequestCursor::isNeeded ( )

Returns if the cursor is still needed (which is the case when it points to either a PageRequest or TileRequest).

◆ nextStep()

CursorState ml::PageRequestCursor::nextStep ( PageRequestQueueInterface queue,
bool &  hasCreatedWork 
)

Implements an iterative tree traversal with automatic expanding of the tile and page requests.

Page requests which are ready for processing are added to the queue. The return value signals if there is more work available from this cursor, if it has finished or if it is blocked (which can happen on MemoryImage calculations).

◆ propagateCancellationDownIfRequestNotNeededAnymore()

bool ml::PageRequestCursor::propagateCancellationDownIfRequestNotNeededAnymore ( )

See Page/TileRequest.

◆ propagateErrorUpwards()

void ml::PageRequestCursor::propagateErrorUpwards ( MLErrorCode  error)

See Page/TileRequest.

◆ setProcessingScope()

void ml::PageRequestCursor::setProcessingScope ( int  scope)
inline

Sets the processing scope.

Definition at line 52 of file mlPageRequestCursor.h.


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