PLearn 0.1
|
This class will help you display progress of a calculation. More...
#include <ProgressBar.h>
Public Member Functions | |
ProgressBar (string _title, uint32_t the_maxpos) | |
ProgressBar (ostream &_out, string _title, uint32_t the_maxpos) | |
ProgressBar (PStream &_out, string _title, uint32_t the_maxpos) | |
void | operator() (uint32_t newpos) |
void | update (uint32_t newpos) |
void | close () |
~ProgressBar () | |
Static Public Member Functions | |
static void | setPlugin (PP< ProgressBarPlugin > plugin_) |
static PP< ProgressBarPlugin > | getCurrentPlugin () |
Public Attributes | |
string | title |
uint32_t | currentpos |
uint32_t | maxpos |
Private Attributes | |
bool | closed |
Static Private Attributes | |
static PP< ProgressBarPlugin > | plugin |
This class will help you display progress of a calculation.
Each progressBar you create is connected to the same ProgressBarPlugin object. By default, a TextProgressBarPlugin that dumps the text in stderr is created and used.
FAQ: Q #1 : How do I reuse the same progress bar? A #1 : simply call progress_bar(i) again with 'i' from 0..maxpos (The text progress bar plugin will display a new progress bar)
Definition at line 153 of file ProgressBar.h.
PLearn::ProgressBar::ProgressBar | ( | string | _title, |
uint32_t | the_maxpos | ||
) |
Definition at line 73 of file ProgressBar.cc.
References plugin.
PLearn::ProgressBar::ProgressBar | ( | ostream & | _out, |
string | _title, | ||
uint32_t | the_maxpos | ||
) |
Definition at line 82 of file ProgressBar.cc.
References plugin.
PLearn::ProgressBar::ProgressBar | ( | PStream & | _out, |
string | _title, | ||
uint32_t | the_maxpos | ||
) |
Definition at line 90 of file ProgressBar.cc.
References plugin.
PLearn::ProgressBar::~ProgressBar | ( | ) |
Definition at line 99 of file ProgressBar.cc.
References close().
{ close(); }
void PLearn::ProgressBar::close | ( | ) |
Definition at line 104 of file ProgressBar.cc.
References closed, currentpos, maxpos, operator()(), and plugin.
Referenced by PLearn::DX_create_grid_outputs_file(), and ~ProgressBar().
{ if(closed) return; closed=true; if(currentpos<maxpos) operator()(maxpos); plugin->killProgressBar(this); }
PP< ProgressBarPlugin > PLearn::ProgressBar::getCurrentPlugin | ( | ) | [static] |
Definition at line 66 of file ProgressBar.cc.
Referenced by PLearn::PLearnService::progress_callback(), PLearn::PLearnServer::run(), and PLearn::Plide::run().
void PLearn::ProgressBar::operator() | ( | uint32_t | newpos | ) | [inline] |
Definition at line 168 of file ProgressBar.h.
Referenced by close().
{plugin->update(this,newpos);}
static void PLearn::ProgressBar::setPlugin | ( | PP< ProgressBarPlugin > | plugin_ | ) | [inline, static] |
Definition at line 172 of file ProgressBar.h.
Referenced by PLearn::global_options(), PLearn::PLearnService::progress_callback(), PLearn::Plide::run(), PLearn::PLearnServer::run(), and PLearn::setProgressBarPlugin().
{ plugin = plugin_; }
void PLearn::ProgressBar::update | ( | uint32_t | newpos | ) | [inline] |
Definition at line 170 of file ProgressBar.h.
Referenced by PLearn::AnalyzeDond2DiscreteVariables::analyzeDiscreteVariable(), PLearn::AnalyzeFieldStats::analyzeVariableStats(), PLearn::TextFilesVMatrix::autoBuildMappings(), PLearn::compute_learner_outputs_on_grid(), PLearn::SecondIterationWrapper::computeClassStatistics(), PLearn::CovariancePreservationImputationVMatrix::computeCovariances(), PLearn::TestImputations::computeCovPresStats(), PLearn::TestImputations::computeMeanMedianModeStats(), PLearn::MeanMedianModeImputationVMatrix::computeMeanMedianModeVectors(), PLearn::NeighborhoodConditionalMean::computeNeighborhood(), PLearn::TestImputations::computeNeighborhoodStats(), PLearn::computeOutputFields(), PLearn::SecondIterationWrapper::computeSalesStatistics(), PLearn::ComputeDond2Target::computeTarget(), PLearn::TestImputations::computeTreeCondMeanStats(), PLearn::DichotomizeDond2DiscreteVariables::dichotomizeDiscreteVariables(), PLearn::DX_create_dataset_outputs_file(), PLearn::DX_create_grid_outputs_file(), PLearn::Experimentation::experimentSetUp(), PLearn::NeighborhoodConditionalMean::experimentWithVariousKs(), PLearn::FixDond2BinaryVariables::fixBinaryVariables(), PLearn::TestImputations::initialize(), PLearn::Preprocessing::manageTrainTestUnknownSets(), PLearn::MergeDond2Files::mergeFiles(), PLearn::MemoryStressTest::perform(), PLearn::SpearmanRankCorrelation(), PLearn::SupervisedDBN::train(), PLearn::PartSupervisedDBN::train(), PLearn::MoleculeTemplateLearner::train(), PLearn::HintonDeepBeliefNet::train(), PLearn::GaussPartSupervisedDBN::train(), PLearn::GaussianDBNRegression::train(), PLearn::GaussianDBNClassification::train(), PLearn::GaussianContinuumDistribution::train(), PLearn::DynamicallyLinkedRBMsModel::train(), PLearn::DenoisingRecurrentNet::train(), PLearn::ConditionalDensityNet::train(), and PLearn::ComputePurenneError::train().
{plugin->update(this,newpos);}
bool PLearn::ProgressBar::closed [private] |
Definition at line 181 of file ProgressBar.h.
Referenced by close().
uint32_t PLearn::ProgressBar::currentpos |
Definition at line 157 of file ProgressBar.h.
Referenced by close(), PLearn::LineOutputProgressBarPlugin::pbInfo(), PLearn::TextProgressBarPlugin::update(), PLearn::LineOutputProgressBarPlugin::update(), and PLearn::RemoteProgressBarPlugin::update().
uint32_t PLearn::ProgressBar::maxpos |
Definition at line 158 of file ProgressBar.h.
Referenced by PLearn::TextProgressBarPlugin::addProgressBar(), close(), PLearn::LineOutputProgressBarPlugin::pbInfo(), PLearn::RemoteProgressBarPlugin::printTitle(), PLearn::TextProgressBarPlugin::update(), PLearn::LineOutputProgressBarPlugin::update(), PLearn::PlideProgressPlugin::update(), and PLearn::RemoteProgressBarPlugin::update().
PP< ProgressBarPlugin > PLearn::ProgressBar::plugin [static, private] |
Definition at line 182 of file ProgressBar.h.
Referenced by close(), and ProgressBar().
string PLearn::ProgressBar::title |