PLearn 0.1
Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes | Static Private Attributes
PLearn::ProgressBar Class Reference

This class will help you display progress of a calculation. More...

#include <ProgressBar.h>

Inheritance diagram for PLearn::ProgressBar:
Inheritance graph
[legend]
Collaboration diagram for PLearn::ProgressBar:
Collaboration graph
[legend]

List of all members.

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< ProgressBarPlugingetCurrentPlugin ()

Public Attributes

string title
uint32_t currentpos
uint32_t maxpos

Private Attributes

bool closed

Static Private Attributes

static PP< ProgressBarPluginplugin

Detailed Description

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.


Constructor & Destructor Documentation

PLearn::ProgressBar::ProgressBar ( string  _title,
uint32_t  the_maxpos 
)

Definition at line 73 of file ProgressBar.cc.

References plugin.

    :title(_title),currentpos(0), maxpos(the_maxpos),closed(false)
{
    if (plugin == NULL)
        plugin = new TextProgressBarPlugin(cerr);

    plugin->addProgressBar(this);
}
PLearn::ProgressBar::ProgressBar ( ostream &  _out,
string  _title,
uint32_t  the_maxpos 
)

Definition at line 82 of file ProgressBar.cc.

References plugin.

    :title(_title),currentpos(0), maxpos(the_maxpos),closed(false)
{
    if (plugin == NULL)
        plugin = new TextProgressBarPlugin(cerr);

    plugin->addProgressBar(this);
}
PLearn::ProgressBar::ProgressBar ( PStream _out,
string  _title,
uint32_t  the_maxpos 
)

Definition at line 90 of file ProgressBar.cc.

References plugin.

    :title(_title),currentpos(0), maxpos(the_maxpos),closed(false)
{
    if (plugin == NULL)
        plugin = new TextProgressBarPlugin(cerr);

    plugin->addProgressBar(this);
}
PLearn::ProgressBar::~ProgressBar ( )

Definition at line 99 of file ProgressBar.cc.

References close().

{
    close();
}

Here is the call graph for this function:


Member Function Documentation

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);
}

Here is the call graph for this function:

Here is the caller graph for this function:

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().

{
    if (plugin == NULL)
        plugin = new TextProgressBarPlugin(cerr);
    return plugin;
}

Here is the caller graph for this function:

void PLearn::ProgressBar::operator() ( uint32_t  newpos) [inline]

Definition at line 168 of file ProgressBar.h.

Referenced by close().

{plugin->update(this,newpos);}

Here is the caller graph for this function:

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_; }

Here is the caller graph for this function:

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);}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 181 of file ProgressBar.h.

Referenced by close().

Definition at line 182 of file ProgressBar.h.

Referenced by close(), and ProgressBar().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines