Helper class for running chains of actions on both the main thread and a background thread. 
Especially useful for doing ui that also needs networking. Think of it like a JS-like promise chain except with more C++.
     
     
     
     
     
     
         
         
 
         
         bool success = SomeLongNetworkOperation();
         
         return success;
     })
     
         
         bool success = var.value<bool>();
         UpdateUI(success);
         
     })
     
         progress(0, 0);
         
         progress(1, 1);
     })
     
     
     ->
then(SomeOtherFunctionThatReturnsABackgroundThread())
 
     
serially
     
         
         try
         {
             std::rethrow_exception(exc);
         }
         catch (std::exception e)
         {
             
         }
     })
     
         ...
     })
     
     
     
         if (success)
         {
             ReportSuccess();
         }
     })
     
         ...
     })
     
BackgroundThread * thenBackgroundWithProgress(QWidget *parent, const QString &title, const QString &text, const QString &cancel, Func &&func)
Add a function to run on a background thread, with a progress dialog that blocks the main thread whil...
Definition progresstask.h:562
 
BackgroundThread * thenBackground(Func &&func)
Add a function to run on a background thread.
Definition progresstask.h:534
 
BackgroundThread * then(BackgroundThread *other)
Add another BackgroundThread's functions to the end of this one's.
Definition progresstask.h:507
 
BackgroundThread * catchBackground(CatchFunction func)
Add a function to run on a background thread in the event an exception is thrown.
Definition progresstask.h:623
 
BackgroundThread * catchMainThread(CatchFunction func)
Add a function to run on the main thread in the event an exception is thrown.
Definition progresstask.h:634
 
BinaryNinja::ProgressFunction ProgressFunction
Definition progresstask.h:282
 
BackgroundThread * finallyMainThread(FinallyFunction func)
Add a function to run on the main thread after all other functions, even if something threw.
Definition progresstask.h:656
 
BackgroundThread * finallyBackground(FinallyFunction func)
Add a function to run on a background thread after all other functions, even if something threw.
Definition progresstask.h:645
 
void start(QVariant init=QVariant())
Start the thread and run all its functions in sequence.
Definition progresstask.h:454
 
static BackgroundThread * create(QObject *owner=nullptr)
Create a new background thread (but don't start it)
Definition progresstask.h:444
 
BackgroundThread * thenMainThread(Func &&func)
Add a function to run on the main thread.
Definition progresstask.h:546
 
void setText(const QString &text)
Set the text label on the progress dialog.
 
Wrapper around QThread and ProgressDialog that runs a task in the background, providing updates to th...
Definition progresstask.h:106
 
ProgressFunction SplitProgress(ProgressFunction originalFn, size_t subpart, size_t subpartCount)
Split a single progress function into equally sized subparts.
Definition binaryninjaapi.cpp:433