This class can be used to inform the progress of a task. More...
#include <TaskProgress.h>
Public Types | |
| enum | { UNDEFINED = 0, DRAW = 1 } | 
| Defines some task types.  More... | |
Public Member Functions | |
| void | cancel () | 
| Cancel task, set the task active FALSE.  More... | |
| int | getCurrentStep () const | 
| Get the task current step.  More... | |
| int | getId () const | 
| Get the task identification.  More... | |
| const std::string & | getMessage () const | 
| Get the task message.  More... | |
| int | getProportionalValue () const | 
| Get the proportional value (value between 0 and 100).  More... | |
| int | getTotalSteps () const | 
| Get the task total stepes.  More... | |
| unsigned int | getType () const | 
| Get the task type.  More... | |
| bool | hasToUpdate () const | 
| This function is used when proportional value has changed.  More... | |
| bool | isActive () const | 
| Verify if the task is active.  More... | |
| void | pulse () | 
| Calls setCurrentStep() function using getCurrentStep() + 1.  More... | |
| void | setCurrentStep (int value) | 
| Set the task current step.  More... | |
| void | setMessage (const std::string &message) | 
| Set the task message.  More... | |
| void | setTotalSteps (int value) | 
| Set the task total stepes.  More... | |
| TaskProgress (const std::string &message="", unsigned int type=UNDEFINED, int totalSteps=0) | |
| Default constructor.  More... | |
| void | useMultiThread (bool flag) | 
| Used to define if task is running in thread mode.  More... | |
| void | useTimer (bool flag) | 
| Used to define if task use progress timer information.  More... | |
| ~TaskProgress () | |
| Destructor.  More... | |
Protected Attributes | |
| int | m_currentPropStep | 
| Current proportinal step.  More... | |
| int | m_currentStep | 
| Task current step.  More... | |
| bool | m_hasToUpdate | 
| Flag used to indicate the update status.  More... | |
| int | m_id | 
| Task identification.  More... | |
| bool | m_isActive | 
| Flag used to indicate the task status.  More... | |
| bool | m_isMultiThread | 
| Flag used to indicate the thread mode.  More... | |
| std::string | m_message | 
| Task message.  More... | |
| ProgressTimer * | m_timer | 
| Progress timer instance.  More... | |
| int | m_totalSteps | 
| Task total steps.  More... | |
| unsigned int | m_type | 
| Task type.  More... | |
| bool | m_useTimer | 
| Flag used to indicate the timer status.  More... | |
This class can be used to inform the progress of a task.
Definition at line 53 of file TaskProgress.h.
| anonymous enum | 
Defines some task types.
| Enumerator | |
|---|---|
| UNDEFINED | 
 Undefined task type.  | 
| DRAW | 
 Draw task type.  | 
Definition at line 58 of file TaskProgress.h.
| te::common::TaskProgress::TaskProgress | ( | const std::string & | message = "",  | 
        
| unsigned int | type = UNDEFINED,  | 
        ||
| int | totalSteps = 0  | 
        ||
| ) | 
Default constructor.
The constructor will register the task in the progress manager.
Definition at line 31 of file TaskProgress.cpp.
References te::common::Singleton< T >::getInstance(), m_id, and setTotalSteps().
| te::common::TaskProgress::~TaskProgress | ( | ) | 
Destructor.
The destructor will remove the task from the progress manager.
Definition at line 50 of file TaskProgress.cpp.
References te::common::Singleton< T >::getInstance().
| void te::common::TaskProgress::cancel | ( | ) | 
Cancel task, set the task active FALSE.
Definition at line 158 of file TaskProgress.cpp.
References te::common::Singleton< T >::getInstance().
| int te::common::TaskProgress::getCurrentStep | ( | ) | const | 
Get the task current step.
Definition at line 95 of file TaskProgress.cpp.
| int te::common::TaskProgress::getId | ( | ) | const | 
Get the task identification.
Definition at line 57 of file TaskProgress.cpp.
| const std::string & te::common::TaskProgress::getMessage | ( | ) | const | 
Get the task message.
Definition at line 140 of file TaskProgress.cpp.
Referenced by te::qt::widgets::ProgressViewerWidget::addTask().
| int te::common::TaskProgress::getProportionalValue | ( | ) | const | 
Get the proportional value (value between 0 and 100).
Definition at line 90 of file TaskProgress.cpp.
| int te::common::TaskProgress::getTotalSteps | ( | ) | const | 
Get the task total stepes.
Definition at line 67 of file TaskProgress.cpp.
Referenced by te::qt::widgets::ProgressViewerWidget::addTask().
| unsigned int te::common::TaskProgress::getType | ( | ) | const | 
| bool te::common::TaskProgress::hasToUpdate | ( | ) | const | 
This function is used when proportional value has changed.
Definition at line 194 of file TaskProgress.cpp.
| bool te::common::TaskProgress::isActive | ( | ) | const | 
Verify if the task is active.
Definition at line 153 of file TaskProgress.cpp.
Referenced by AggregationMemory(), te::rp::Skeleton::applyVecDiffusion(), te::qt::widgets::createHistogram(), te::qt::widgets::createScatter(), te::map::AbstractLayerRenderer::drawDatSetGeometries(), te::map::DrawGeometries(), te::map::DataSetLayerRenderer::drawGrouping(), te::map::AbstractLayerRenderer::drawLayerGrouping(), te::rp::ClassifierMAPStrategy::getPrioriProbabilities(), PairwiseIntersection(), and te::rp::Segmenter::segmenterThreadEntry().
| void te::common::TaskProgress::pulse | ( | ) | 
Calls setCurrentStep() function using getCurrentStep() + 1.
Definition at line 132 of file TaskProgress.cpp.
Referenced by te::graph::AddDeepAttribute::AddDeepAttribute(), te::graph::AddRasterAttribute::AddRasterAttribute(), AggregationMemory(), BufferMemory(), te::graph::QueryGraphBuilder::build(), te::graph::LDDGraphBuilder::build(), te::graph::RAGGraphBuilder::createEdgeObjects(), te::qt::widgets::createHistogram(), te::qt::widgets::createScatter(), te::map::AbstractLayerRenderer::drawDatSetGeometries(), te::map::DrawGeometries(), te::map::DataSetLayerRenderer::drawGrouping(), te::map::AbstractLayerRenderer::drawLayerGrouping(), te::rp::ClassifierKMeansStrategy::execute(), te::rp::ClassifierEMStrategy::execute(), te::rp::ClassifierMAPStrategy::getPrioriProbabilities(), PairwiseIntersection(), te::rp::Segmenter::segmenterThreadEntry(), and te::cl::KMeans< TTRAIN, TCLASSIFY >::train().
| void te::common::TaskProgress::setCurrentStep | ( | int | value | ) | 
Set the task current step.
| value | Current value. | 
Definition at line 100 of file TaskProgress.cpp.
References te::common::Singleton< T >::getInstance().
Referenced by BufferMemory(), te::rp::ClassifierKMeansStrategy::execute(), and te::rp::ClassifierEMStrategy::execute().
| void te::common::TaskProgress::setMessage | ( | const std::string & | message | ) | 
Set the task message.
| message | String value with task message. | 
Definition at line 145 of file TaskProgress.cpp.
References te::common::Singleton< T >::getInstance().
Referenced by te::graph::AddDeepAttribute::AddDeepAttribute(), te::graph::AddRasterAttribute::AddRasterAttribute(), BufferMemory(), te::graph::QueryGraphBuilder::build(), te::graph::LDDGraphBuilder::build(), te::graph::RAGGraphBuilder::createEdgeObjects(), te::qt::widgets::createHistogram(), te::qt::widgets::createScatter(), te::rp::ClassifierKMeansStrategy::execute(), and te::rp::ClassifierEMStrategy::execute().
| void te::common::TaskProgress::setTotalSteps | ( | int | value | ) | 
Set the task total stepes.
| value | Interger value with total steps. | 
Definition at line 72 of file TaskProgress.cpp.
References te::common::Singleton< T >::getInstance().
Referenced by te::graph::AddDeepAttribute::AddDeepAttribute(), te::graph::AddRasterAttribute::AddRasterAttribute(), AggregationMemory(), BufferMemory(), te::graph::QueryGraphBuilder::build(), te::graph::LDDGraphBuilder::build(), te::graph::RAGGraphBuilder::createEdgeObjects(), te::qt::widgets::createHistogram(), te::qt::widgets::createScatter(), te::rp::ClassifierKMeansStrategy::execute(), te::rp::ClassifierEMStrategy::execute(), PairwiseIntersection(), and TaskProgress().
| void te::common::TaskProgress::useMultiThread | ( | bool | flag | ) | 
Used to define if task is running in thread mode.
| flag | Boolean value used to set the thread option. | 
Definition at line 166 of file TaskProgress.cpp.
| void te::common::TaskProgress::useTimer | ( | bool | flag | ) | 
Used to define if task use progress timer information.
| flag | Boolean value used to set the timer option. | 
Definition at line 179 of file TaskProgress.cpp.
Referenced by AggregationMemory(), BufferMemory(), te::graph::QueryGraphBuilder::build(), te::graph::LDDGraphBuilder::build(), and PairwiseIntersection().
      
  | 
  protected | 
Current proportinal step.
Definition at line 181 of file TaskProgress.h.
      
  | 
  protected | 
Task current step.
Definition at line 180 of file TaskProgress.h.
      
  | 
  protected | 
Flag used to indicate the update status.
Definition at line 183 of file TaskProgress.h.
      
  | 
  protected | 
      
  | 
  protected | 
Flag used to indicate the task status.
Definition at line 184 of file TaskProgress.h.
      
  | 
  protected | 
Flag used to indicate the thread mode.
Definition at line 185 of file TaskProgress.h.
      
  | 
  protected | 
Task message.
Definition at line 182 of file TaskProgress.h.
      
  | 
  protected | 
Progress timer instance.
Definition at line 187 of file TaskProgress.h.
      
  | 
  protected | 
Task total steps.
Definition at line 179 of file TaskProgress.h.
      
  | 
  protected | 
Task type.
Definition at line 178 of file TaskProgress.h.
      
  | 
  protected | 
Flag used to indicate the timer status.
Definition at line 186 of file TaskProgress.h.