GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
GpgFrontend::Thread::Task Class Reference
Inheritance diagram for GpgFrontend::Thread::Task:
Inheritance graph
Collaboration diagram for GpgFrontend::Thread::Task:
Collaboration graph

Classes

class  Impl
 
class  TaskHandler
 

Public Types

using TaskRunnable = std::function< int(DataObjectPtr)>
 
using TaskCallback = std::function< void(int, DataObjectPtr)>
 

Public Slots

void SafelyRun ()
 shouldn't be overwrite by subclass
 

Signals

void SignalRun ()
 
void SignalTaskShouldEnd (int)
 
void SignalTaskEnd ()
 

Public Member Functions

 Task (QString name)
 Construct a new Task object.
 
 Task (TaskRunnable runnable, QString name, DataObjectPtr data_object=nullptr)
 Construct a new Task object. More...
 
 Task (TaskRunnable runnable, QString name, DataObjectPtr data, TaskCallback callback)
 Construct a new Task object. More...
 
 ~Task () override
 Destroy the Task object.
 
auto GetUUID () const -> QString
 
auto GetFullID () const -> QString
 Get the Full I D object. More...
 
void HoldOnLifeCycle (bool hold_on)
 
virtual auto Run () -> int
 can be overwrite by subclass More...
 
auto GetRTN ()
 

Protected Member Functions

void setRTN (int rtn)
 

Private Slots

void slot_exception_safe_run () noexcept
 

Private Member Functions

void run () override
 

Private Attributes

SecureUniquePtr< Implp_
 

Friends

class TaskRunner
 

Constructor & Destructor Documentation

◆ Task() [1/2]

GpgFrontend::Thread::Task::Task ( TaskRunnable  runnable,
QString  name,
DataObjectPtr  data_object = nullptr 
)
explicit

Construct a new Task object.

Parameters
callbackThe callback function to be executed.

◆ Task() [2/2]

GpgFrontend::Thread::Task::Task ( TaskRunnable  runnable,
QString  name,
DataObjectPtr  data,
TaskCallback  callback 
)
explicit

Construct a new Task object.

Parameters
runnable

Member Function Documentation

◆ GetFullID()

QString GpgFrontend::Thread::Task::GetFullID ( ) const -> QString

Get the Full I D object.

Returns
QString

◆ GetRTN()

auto GpgFrontend::Thread::Task::GetRTN ( )
Returns
auto

◆ GetUUID()

QString GpgFrontend::Thread::Task::GetUUID ( ) const -> QString
Returns
QString

◆ HoldOnLifeCycle()

◆ Run()

int GpgFrontend::Thread::Task::Run ( ) -> int
virtual

◆ setRTN()

void GpgFrontend::Thread::Task::setRTN ( int  rtn)
protected
Parameters
rtn

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