ACF $AcfVersion:0$
Classes | Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
ibase::CCumulatedProgressManagerBase Class Reference

Progress manager delegating cumulated progress result to another manager. More...

#include <CCumulatedProgressManagerBase.h>

Inheritance diagram for ibase::CCumulatedProgressManagerBase:
ibase::IProgressManager istd::IPolymorphic iqtgui::CProgressDialog iqtgui::CProgressGuiBridge iqtgui::CProgressManagerGuiComp iqtgui::CSubtaskProgressDialog

Classes

class  TaskBase
 
struct  TaskInfo
 
struct  TaskProgressInfo
 

Public Types

enum class  TaskStatus { Created , Running , Finished }
 

Public Member Functions

 CCumulatedProgressManagerBase (const TaskInfo &defaultTaskInfo={"", ""})
 Create cumulated progress manager.
 
virtual ~CCumulatedProgressManagerBase ()
 
void SetDefaultTaskInfo (const TaskInfo &defaultTaskInfo)
 Set information of the default task.
 
double GetCumulatedProgress () const
 Get final progress beeing result of all task progress.
 
std::vector< TaskProgressInfoGetProcessedTasks (bool preferSorted=false, int maxCount=-1) const
 Get list of current processed tasks.
 
bool IsCancelable () const
 
virtual bool IsCanceled () const
 
void SetCanceled (bool state=true)
 
virtual void ResetProgressManager () override
 Reset progress manager and make it possible to reuse it.
 
std::unique_ptr< IProgressManagerCreateSubtaskManager (const QByteArray &taskId, const QString &taskDescription, double weight=1.0) override
 Create progress manager for the subtask.
 
virtual std::unique_ptr< IProgressLoggerStartProgressLogger (bool isCancelable=false, const QString &description={}) override
 Create progress logger.
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Protected Member Functions

virtual void OnProgressChanged (double cumulatedValue)
 
virtual void OnTasksChanged ()
 
virtual void OpenTask (TaskBase *taskPtr, const TaskInfo &taskInfo, double weight, bool isCancelable)
 
virtual void CloseTask (TaskBase *taskPtr)
 
virtual void ReportTaskProgress (TaskBase *taskPtr, double progress, TaskStatus taskStatus)
 
void TryUpdateCumulatedProgress ()
 

Friends

class SubTaskManager
 

Detailed Description

Progress manager delegating cumulated progress result to another manager.

It allows to access cumulated progress and list of tasks beeing curently processed.

Definition at line 24 of file CCumulatedProgressManagerBase.h.

Member Enumeration Documentation

◆ TaskStatus

Enumerator
Created 

Task was created, but not started.

Running 

Task is running.

Progress information is beeing reported.

Finished 

Task was finished.

No progress information will be emitted anymore.

Definition at line 27 of file CCumulatedProgressManagerBase.h.

Constructor & Destructor Documentation

◆ CCumulatedProgressManagerBase()

ibase::CCumulatedProgressManagerBase::CCumulatedProgressManagerBase ( const TaskInfo defaultTaskInfo = {"", ""})

Create cumulated progress manager.

◆ ~CCumulatedProgressManagerBase()

virtual ibase::CCumulatedProgressManagerBase::~CCumulatedProgressManagerBase ( )
virtual

Member Function Documentation

◆ CloseTask()

virtual void ibase::CCumulatedProgressManagerBase::CloseTask ( TaskBase taskPtr)
protectedvirtual

◆ CreateSubtaskManager()

std::unique_ptr< IProgressManager > ibase::CCumulatedProgressManagerBase::CreateSubtaskManager ( const QByteArray &  taskId,
const QString &  taskDescription,
double  weight = 1.0 
)
overridevirtual

Create progress manager for the subtask.

This function should be called up at the start of the task for all subtasks.

Parameters
taskIdunique ID of this task. This ID can be used by the progress bar to distinguish between different tasks.
taskDescriptionhuman readable description of this task.
weightweight value

Implements ibase::IProgressManager.

◆ GetCumulatedProgress()

double ibase::CCumulatedProgressManagerBase::GetCumulatedProgress ( ) const

Get final progress beeing result of all task progress.

◆ GetProcessedTasks()

std::vector< TaskProgressInfo > ibase::CCumulatedProgressManagerBase::GetProcessedTasks ( bool  preferSorted = false,
int  maxCount = -1 
) const

Get list of current processed tasks.

Parameters
preferSortedFlag indicating, that the task list should be sorted from the most important to less important.
maxCountMaximal number of tasks should be returned.

◆ IsCancelable()

bool ibase::CCumulatedProgressManagerBase::IsCancelable ( ) const

◆ IsCanceled()

virtual bool ibase::CCumulatedProgressManagerBase::IsCanceled ( ) const
virtual

◆ OnProgressChanged()

virtual void ibase::CCumulatedProgressManagerBase::OnProgressChanged ( double  cumulatedValue)
protectedvirtual

◆ OnTasksChanged()

virtual void ibase::CCumulatedProgressManagerBase::OnTasksChanged ( )
protectedvirtual

◆ OpenTask()

virtual void ibase::CCumulatedProgressManagerBase::OpenTask ( TaskBase taskPtr,
const TaskInfo taskInfo,
double  weight,
bool  isCancelable 
)
protectedvirtual

◆ ReportTaskProgress()

virtual void ibase::CCumulatedProgressManagerBase::ReportTaskProgress ( TaskBase taskPtr,
double  progress,
TaskStatus  taskStatus 
)
protectedvirtual

◆ ResetProgressManager()

virtual void ibase::CCumulatedProgressManagerBase::ResetProgressManager ( )
overridevirtual

Reset progress manager and make it possible to reuse it.

Implements ibase::IProgressManager.

◆ SetCanceled()

void ibase::CCumulatedProgressManagerBase::SetCanceled ( bool  state = true)

◆ SetDefaultTaskInfo()

void ibase::CCumulatedProgressManagerBase::SetDefaultTaskInfo ( const TaskInfo defaultTaskInfo)

Set information of the default task.

◆ StartProgressLogger()

virtual std::unique_ptr< IProgressLogger > ibase::CCumulatedProgressManagerBase::StartProgressLogger ( bool  isCancelable = false,
const QString &  description = {} 
)
overridevirtual

Create progress logger.

This function should be called once at the start of the task if it provides progress information.

Parameters
isCancelableinforms, that this task can be cancel during the processing.

Implements ibase::IProgressManager.

◆ TryUpdateCumulatedProgress()

void ibase::CCumulatedProgressManagerBase::TryUpdateCumulatedProgress ( )
protected

Friends And Related Symbol Documentation

◆ SubTaskManager

friend class SubTaskManager
friend

Definition at line 107 of file CCumulatedProgressManagerBase.h.


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