MeVisLab Toolbox Reference
ml::ImagingBackgroundTask Class Reference

#include <mlImagingBackgroundTask.h>

Inheritance diagram for ml::ImagingBackgroundTask:
ml::MessagingBackgroundTask ml::BackgroundTask ml::ModuleBackgroundTask ml::ProcessAllPagesBackgroundTask ml::RTObjectSaveBackgroundTask

Classes

class  AsyncTileRequest
 An asynchronous tile request. This is copyable! More...
class  ProcessAllPagesRequest
 An asynchronous process all pages request. This is copyable! More...

Public Types

enum  TileRequestFlags {
  UseMemoryManager = TileRequest::UseMemoryManager , UseMLAlloc = TileRequest::UseMLAlloc , NoAllocation = TileRequest::NoAllocation , ExternalBuffer = TileRequest::ExternalBuffer ,
  AllocationPolicyMask = 0xf , RequestReadOnlyPage = 16 , ReceiveProgressMessages = 32
}
Public Types inherited from ml::BackgroundTask
enum  Status {
  NotInTaskManager , Queued , Running , Finished ,
  Canceled , Suspended
}
 Defines current status of the task. More...

Public Member Functions

 ImagingBackgroundTask (void *owner)
 ~ImagingBackgroundTask () override
Public Member Functions inherited from ml::MessagingBackgroundTask
 MessagingBackgroundTask (void *ownerArg)
template<typename Object, typename Method>
void callMethodOnGUI (const DistantObject< Object > &target, Method method)
template<typename Object, typename Method, typename Arg1>
void callMethodOnGUI (const DistantObject< Object > &target, Method method, const Arg1 &arg1)
template<typename Object, typename Method, typename Arg1, typename Arg2>
void callMethodOnGUI (const DistantObject< Object > &target, Method method, const Arg1 &arg1, const Arg2 &arg2)
template<typename Object, typename Method, typename Arg1, typename Arg2, typename Arg3>
void callMethodOnGUI (const DistantObject< Object > &target, Method method, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3)
template<typename Object, typename Method, typename Arg1, typename Arg2, typename Arg3, typename Arg4>
void callMethodOnGUI (const DistantObject< Object > &target, Method method, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4)
template<typename Object, typename Method, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5>
void callMethodOnGUI (const DistantObject< Object > &target, Method method, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5)
Public Member Functions inherited from ml::BackgroundTask
 BackgroundTask (void *owner)
virtual ~BackgroundTask ()
virtual void run ()=0
 Method that needs to be reimplemented. This is called from the worker thread.
bool isSynchronous () const
 Checks whether the task is synchronous, which means it is not executed in a different thread.
void setSynchronous (bool flag)
 Sets whether the task is handled synchronously. Call this only in the setup of the task, not while it is already running.
void setSynchronousCancelField (NotifyField *field)
 Sets a cancel field that is used in synchronous mode to check whether cancel was pressed.
Status status () const
void cancel ()
bool isCanceled () const
bool shouldStop ()
void resume ()
void suspend ()
std::string statusString () const
virtual void setStatusString (const std::string &status)
float progress () const
virtual void setProgress (float progress)
void setOwnerWasDeleted ()
bool hasOwner () const
void * owner () const
void waitAndExecuteNextMessage ()
bool executeNextMessage ()
void sendMessageToGUI (BackgroundTaskMessage *message)
void logMessage (const std::string &message)
bool isVerbose () const
 Checks whether task uses verbose logging.
void setVerbose (bool flag)
double runningTime () const
double idleTime () const
void getStatusInformation (BackgroundTaskStatusInformation &info)
MLuint32 taskId () const
 Returns the unique id of this task. The id of a task never changes.
void setTaskFinishedCB (BackgroundTaskFinishedCB *callback, void *userdata)
void addObserver (Observer *observer)
void removeObserver (Observer *observer)

Protected Member Functions

BackgroundRequestId generateBackgroundRequestId ()
 Generates next generateBackgroundRequestId().
Protected Member Functions inherited from ml::BackgroundTask
void sendStatusChangedToObservers ()
 Sends the status change to all observers.
void sendStatusStringChangedToObservers ()
 Sends the status string change to all observers.
void sendLogMessageToObservers (const std::string &msg)
 Sends the status string change to all observers.
void addIdleTime (double timeInSecs)
 Adds given timeInSecs as spent idle time.

Friends

class BackgroundTaskMLGetTileResultMessage
class BackgroundTaskMLProcessAllPagesResultMessage
class AsyncTileRequest
class ProcessAllPagesRequest

Detailed Description

Definition at line 32 of file mlImagingBackgroundTask.h.

Member Enumeration Documentation

◆ TileRequestFlags

Defines flags that can be passed with requestTile(). Note: Only one of the allocation schemes can be used at a time.

Enumerator
UseMemoryManager 
UseMLAlloc 
NoAllocation 
ExternalBuffer 
AllocationPolicyMask 
RequestReadOnlyPage 
ReceiveProgressMessages 

Definition at line 43 of file mlImagingBackgroundTask.h.

Constructor & Destructor Documentation

◆ ImagingBackgroundTask()

◆ ~ImagingBackgroundTask()

ml::ImagingBackgroundTask::~ImagingBackgroundTask ( )
override

Member Function Documentation

◆ generateBackgroundRequestId()

BackgroundRequestId ml::ImagingBackgroundTask::generateBackgroundRequestId ( )
inlineprotected

Generates next generateBackgroundRequestId().

Definition at line 100 of file mlImagingBackgroundTask.h.

◆ AsyncTileRequest

friend class AsyncTileRequest
friend

Definition at line 107 of file mlImagingBackgroundTask.h.

◆ BackgroundTaskMLGetTileResultMessage

friend class BackgroundTaskMLGetTileResultMessage
friend

◆ BackgroundTaskMLProcessAllPagesResultMessage

friend class BackgroundTaskMLProcessAllPagesResultMessage
friend

◆ ProcessAllPagesRequest

friend class ProcessAllPagesRequest
friend

Definition at line 108 of file mlImagingBackgroundTask.h.


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