A singleton class used to manage tasks progresses and their viewers. More...
#include <ProgressManager.h>
Public Types | |
typedef ObjectLevelLockingPolicy < ::boost::lock_guard < ::boost::recursive_mutex > > | LockRead |
typedef ObjectLevelLockingPolicy < ::boost::lock_guard < ::boost::recursive_mutex > > | LockWrite |
typedef volatile ProgressManager | VolatileType |
Public Member Functions | |
int | addTask (TaskProgress *tp) |
Used in TaskProgress constructor, register this task generating a task id. More... | |
int | addViewer (AbstractProgressViewer *apv) |
Attach a progress viewer. More... | |
void | cancelTask (int taskId) |
Inform all viewers that a task was canceled. More... | |
void | cancelTasks (unsigned int type) |
Cancels the task with the given task type and inform all viewers that a task was canceled. More... | |
void | clearAll () |
Removes references for Viewers and tasks. More... | |
void | removeTask (int taskId) |
Used in TaskProgress destructor, remove task from singleton. More... | |
void | removeViewer (int viewerId) |
Dettach a progress viewer. More... | |
void | setTotalValues (int taskId) |
Inform all viewers that a task set the total values. More... | |
void | updateMessage (int taskId) |
Inform all viewers that a task set the message. More... | |
void | updateValue (int taskId) |
Inform all viewers that a task set the current step. More... | |
Static Public Member Functions | |
static ProgressManager & | getInstance () |
It returns a reference to the singleton instance. More... | |
Protected Member Functions | |
int | generateTaskId () |
Used to generate a new task id (use internal counter). More... | |
int | generateViewerId () |
Used to generate a new viewer id (use internal counter). More... | |
ProgressManager () | |
Default constructor. More... | |
~ProgressManager () | |
Destructor. More... | |
Protected Attributes | |
int | m_taskCounter |
Counter used to generate a task id. More... | |
std::map< int, TaskProgress * > | m_tasks |
Container with tasks. More... | |
int | m_viewerCounter |
Counter used to generate a viewer id. More... | |
std::map< int, AbstractProgressViewer * > | m_viewers |
Container with viewers. More... | |
Friends | |
class | te::common::Singleton< ProgressManager > |
A singleton class used to manage tasks progresses and their viewers.
This singleton is used to store all tasks created and their progress viewers. If one or more viewers is attached, all instances will be used to display the tasks progresses.
Definition at line 59 of file ProgressManager.h.
|
inherited |
Definition at line 205 of file ThreadingPolicies.h.
|
inherited |
Definition at line 206 of file ThreadingPolicies.h.
|
inherited |
Definition at line 204 of file ThreadingPolicies.h.
|
protected |
Default constructor.
Definition at line 181 of file ProgressManager.cpp.
|
protected |
Destructor.
Definition at line 187 of file ProgressManager.cpp.
int te::common::ProgressManager::addTask | ( | TaskProgress * | tp | ) |
Used in TaskProgress constructor, register this task generating a task id.
tp | TaskProgress instance |
Definition at line 59 of file ProgressManager.cpp.
Referenced by te::common::TaskProgress::TaskProgress().
int te::common::ProgressManager::addViewer | ( | AbstractProgressViewer * | apv | ) |
Attach a progress viewer.
apv | Progress viewer instance |
Definition at line 31 of file ProgressManager.cpp.
References te::common::AbstractProgressViewer::addTask(), generateViewerId(), m_tasks, and m_viewers.
Referenced by te::qt::widgets::SegmenterWizardPage::apply(), te::qt::plugins::terralib4::TL4ConverterWizard::commit(), te::qt::widgets::VectorizationWizard::execute(), te::qt::widgets::RegisterWizard::execute(), te::qt::widgets::ClassifierWizard::execute(), te::qt::widgets::FilterWizard::execute(), te::qt::widgets::ClippingWizard::execute(), te::qt::widgets::ColorTransformWizard::execute(), te::qt::widgets::ContrastWizard::execute(), te::qt::widgets::SegmenterWizard::execute(), te::vp::GeometricOpWizard::execute(), te::qt::widgets::ArithmeticOpWizard::execute(), te::qt::widgets::MosaicWizard::executeGeoMosaic(), te::qt::widgets::FusionWizard::executeIHS(), te::qt::widgets::FusionWizard::executePCA(), te::qt::widgets::MosaicWizard::executeSequenceMosaic(), te::qt::widgets::MosaicWizard::executeTiePointMosaic(), te::qt::widgets::FusionWizard::executeWisper(), te::qt::af::BaseApplication::makeDialog(), te::qt::plugins::cellspace::CreateCellularSpaceDialog::onCreatePushButtonClicked(), te::sa::BayesGlobalDialog::onOkPushButtonClicked(), te::sa::ProximityMatrixCreatorDialog::onOkPushButtonClicked(), te::sa::SkaterDialog::onOkPushButtonClicked(), te::sa::SamplePointsGeneratorDialog::onOkPushButtonClicked(), te::sa::BayesLocalDialog::onOkPushButtonClicked(), te::sa::SpatialStatisticsDialog::onOkPushButtonClicked(), te::sa::KernelRatioDialog::onOkPushButtonClicked(), te::sa::KernelMapDialog::onOkPushButtonClicked(), te::vp::PolygonToLineDialog::onOkPushButtonClicked(), te::vp::LineToPolygonDialog::onOkPushButtonClicked(), te::vp::IntersectionDialog::onOkPushButtonClicked(), te::vp::MultipartToSinglepartDialog::onOkPushButtonClicked(), te::attributefill::VectorToRasterDialog::onOkPushButtonClicked(), te::attributefill::RasterToVectorDialog::onOkPushButtonClicked(), te::vp::BufferDialog::onOkPushButtonClicked(), te::attributefill::VectorToVectorDialog::onOkPushButtonClicked(), and te::vp::AggregationDialog::onOkPushButtonClicked().
void te::common::ProgressManager::cancelTask | ( | int | taskId | ) |
Inform all viewers that a task was canceled.
taskId | Task identifier. |
Definition at line 102 of file ProgressManager.cpp.
Referenced by te::common::TaskProgress::cancel().
void te::common::ProgressManager::cancelTasks | ( | unsigned int | type | ) |
Cancels the task with the given task type and inform all viewers that a task was canceled.
type | The task type. |
Definition at line 120 of file ProgressManager.cpp.
Referenced by te::qt::af::BaseApplication::onStopDrawTriggered().
void te::common::ProgressManager::clearAll | ( | ) |
Removes references for Viewers and tasks.
Definition at line 175 of file ProgressManager.cpp.
Referenced by te::qt::af::BaseApplication::~BaseApplication().
|
protected |
Used to generate a new task id (use internal counter).
Definition at line 197 of file ProgressManager.cpp.
|
protected |
Used to generate a new viewer id (use internal counter).
Definition at line 192 of file ProgressManager.cpp.
Referenced by addViewer().
|
staticinherited |
It returns a reference to the singleton instance.
Referenced by te::qt::widgets::SegmenterWizardPage::apply(), te::common::TaskProgress::cancel(), te::qt::plugins::terralib4::TL4ConverterWizard::commit(), te::qt::widgets::VectorizationWizard::execute(), te::qt::widgets::RegisterWizard::execute(), te::qt::widgets::ClassifierWizard::execute(), te::qt::widgets::FilterWizard::execute(), te::qt::widgets::ClippingWizard::execute(), te::qt::widgets::ColorTransformWizard::execute(), te::qt::widgets::ContrastWizard::execute(), te::qt::widgets::SegmenterWizard::execute(), te::vp::GeometricOpWizard::execute(), te::qt::widgets::ArithmeticOpWizard::execute(), te::qt::widgets::MosaicWizard::executeGeoMosaic(), te::qt::widgets::FusionWizard::executeIHS(), te::qt::widgets::FusionWizard::executePCA(), te::qt::widgets::MosaicWizard::executeSequenceMosaic(), te::qt::widgets::MosaicWizard::executeTiePointMosaic(), te::qt::widgets::FusionWizard::executeWisper(), te::qt::af::BaseApplication::makeDialog(), te::qt::plugins::cellspace::CreateCellularSpaceDialog::onCreatePushButtonClicked(), te::sa::ProximityMatrixCreatorDialog::onOkPushButtonClicked(), te::sa::BayesGlobalDialog::onOkPushButtonClicked(), te::sa::BayesLocalDialog::onOkPushButtonClicked(), te::sa::SamplePointsGeneratorDialog::onOkPushButtonClicked(), te::sa::SkaterDialog::onOkPushButtonClicked(), te::sa::KernelMapDialog::onOkPushButtonClicked(), te::sa::KernelRatioDialog::onOkPushButtonClicked(), te::sa::SpatialStatisticsDialog::onOkPushButtonClicked(), te::vp::LineToPolygonDialog::onOkPushButtonClicked(), te::vp::PolygonToLineDialog::onOkPushButtonClicked(), te::vp::IntersectionDialog::onOkPushButtonClicked(), te::vp::MultipartToSinglepartDialog::onOkPushButtonClicked(), te::attributefill::VectorToRasterDialog::onOkPushButtonClicked(), te::attributefill::RasterToVectorDialog::onOkPushButtonClicked(), te::vp::BufferDialog::onOkPushButtonClicked(), te::attributefill::VectorToVectorDialog::onOkPushButtonClicked(), te::vp::AggregationDialog::onOkPushButtonClicked(), te::qt::af::BaseApplication::onStopDrawTriggered(), te::common::TaskProgress::setCurrentStep(), te::common::TaskProgress::setMessage(), te::common::TaskProgress::setTotalSteps(), te::common::TaskProgress::TaskProgress(), te::qt::af::BaseApplication::~BaseApplication(), and te::common::TaskProgress::~TaskProgress().
void te::common::ProgressManager::removeTask | ( | int | taskId | ) |
Used in TaskProgress destructor, remove task from singleton.
taskId | Task identifier. |
Definition at line 80 of file ProgressManager.cpp.
Referenced by te::common::TaskProgress::~TaskProgress().
void te::common::ProgressManager::removeViewer | ( | int | viewerId | ) |
Dettach a progress viewer.
viewerId | Progress viewer identifier |
Definition at line 49 of file ProgressManager.cpp.
Referenced by te::qt::widgets::SegmenterWizardPage::apply(), te::qt::plugins::terralib4::TL4ConverterWizard::commit(), te::qt::widgets::VectorizationWizard::execute(), te::qt::widgets::RegisterWizard::execute(), te::qt::widgets::FilterWizard::execute(), te::qt::widgets::ClassifierWizard::execute(), te::qt::widgets::ColorTransformWizard::execute(), te::qt::widgets::ClippingWizard::execute(), te::qt::widgets::ContrastWizard::execute(), te::qt::widgets::SegmenterWizard::execute(), te::vp::GeometricOpWizard::execute(), te::qt::widgets::ArithmeticOpWizard::execute(), te::qt::widgets::MosaicWizard::executeGeoMosaic(), te::qt::widgets::FusionWizard::executeIHS(), te::qt::widgets::FusionWizard::executePCA(), te::qt::widgets::MosaicWizard::executeSequenceMosaic(), te::qt::widgets::MosaicWizard::executeTiePointMosaic(), te::qt::widgets::FusionWizard::executeWisper(), te::qt::plugins::cellspace::CreateCellularSpaceDialog::onCreatePushButtonClicked(), te::sa::BayesGlobalDialog::onOkPushButtonClicked(), te::sa::ProximityMatrixCreatorDialog::onOkPushButtonClicked(), te::sa::SamplePointsGeneratorDialog::onOkPushButtonClicked(), te::sa::SkaterDialog::onOkPushButtonClicked(), te::sa::BayesLocalDialog::onOkPushButtonClicked(), te::sa::SpatialStatisticsDialog::onOkPushButtonClicked(), te::sa::KernelMapDialog::onOkPushButtonClicked(), te::sa::KernelRatioDialog::onOkPushButtonClicked(), te::vp::LineToPolygonDialog::onOkPushButtonClicked(), te::vp::PolygonToLineDialog::onOkPushButtonClicked(), te::vp::IntersectionDialog::onOkPushButtonClicked(), te::vp::MultipartToSinglepartDialog::onOkPushButtonClicked(), te::attributefill::VectorToRasterDialog::onOkPushButtonClicked(), te::attributefill::RasterToVectorDialog::onOkPushButtonClicked(), te::vp::BufferDialog::onOkPushButtonClicked(), te::attributefill::VectorToVectorDialog::onOkPushButtonClicked(), and te::vp::AggregationDialog::onOkPushButtonClicked().
void te::common::ProgressManager::setTotalValues | ( | int | taskId | ) |
Inform all viewers that a task set the total values.
taskId | Task identifier. |
Definition at line 139 of file ProgressManager.cpp.
Referenced by te::common::TaskProgress::setTotalSteps().
void te::common::ProgressManager::updateMessage | ( | int | taskId | ) |
Inform all viewers that a task set the message.
taskId | Task identifier. |
Definition at line 163 of file ProgressManager.cpp.
Referenced by te::common::TaskProgress::setMessage().
void te::common::ProgressManager::updateValue | ( | int | taskId | ) |
Inform all viewers that a task set the current step.
taskId | Task identifier. |
Definition at line 151 of file ProgressManager.cpp.
Referenced by te::common::TaskProgress::setCurrentStep().
|
friend |
Definition at line 65 of file ProgressManager.h.
|
protected |
Counter used to generate a task id.
Definition at line 171 of file ProgressManager.h.
|
protected |
|
protected |
Counter used to generate a viewer id.
Definition at line 172 of file ProgressManager.h.
|
protected |
Container with viewers.
Definition at line 174 of file ProgressManager.h.
Referenced by addViewer().