contrib/mul/mbl/mbl_progress_text.h
Go to the documentation of this file.
00001 #ifndef mbl_progress_text_h_
00002 #define mbl_progress_text_h_
00003 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00004 #pragma interface
00005 #endif
00006 //:
00007 // \file
00008 // \brief Progress class that outputs simple text reporting on progress
00009 // \author Graham Vincent and Kevin de Souza
00010 // \date 25 Feb 2005
00011 
00012 #include <vcl_iostream.h>
00013 #include <mbl/mbl_progress.h>
00014 
00015 //========================================================================
00016 //: Progress object that outputs simple text reporting on progress
00017 class mbl_progress_text : public mbl_progress
00018 {
00019  public:
00020 
00021   //: Constructor
00022   // \param os Ostream for text output (defaults to cout)
00023   mbl_progress_text(vcl_ostream& os=vcl_cout);
00024 
00025   //: Destructor
00026   ~mbl_progress_text();
00027 
00028   //: Name of the class
00029   virtual vcl_string is_a() const;
00030 
00031 
00032  protected:
00033 
00034   //: Called when set_estimate_iterations() is called for a given identifier.
00035   //  \param identifier The operation being monitored.
00036   virtual void on_set_estimated_iterations(const vcl_string& identifier,
00037                                            const int total_iterations);
00038 
00039   //: Called when set_progress() is called for a given identifier.
00040   //  \param identifier The operation being monitored.
00041   //  \param progress The new progress status.
00042   virtual void on_set_progress(const vcl_string& identifier,
00043                                const int progress);
00044 
00045   //: Called when end_progress() is called for a given identifier.
00046   //  \param identifier The operation being monitored.
00047   virtual void on_end_progress(const vcl_string &identifier);
00048 
00049   vcl_ostream& os_;
00050 };
00051 
00052 //========================================================================
00053 
00054 #endif // mbl_progress_text_h_