Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

Progress.h

Go to the documentation of this file.
00001 // Copyright (C) 2003 Jim Tilander.
00002 // Licensed under the GNU GPL Version 2.
00003 //
00004 // Modified for DOLFIN by Anders Logg.
00005 
00006 #ifndef __PROGRESS_H
00007 #define __PROGRESS_H
00008 
00009 #include <stdarg.h>
00010 #include <dolfin/constants.h>
00011 
00012 namespace dolfin {
00013   
00014   class Progress {
00015   public:
00016     
00017     Progress(const char* title, unsigned int n);
00018     Progress(const char* title);
00019     ~Progress();
00020     
00021     void operator=(unsigned int i);
00022     void operator=(real p);
00023     void operator++();
00024     void operator++(int);
00025     
00026     void update(unsigned int i,  const char* format, ...);
00027     void update(real p, const char* format, ...);
00028     
00029     real value();
00030     const char* title();
00031     const char* label();
00032     
00033   private:
00034     
00035     real checkBounds(unsigned int i);
00036     real checkBounds(real p);
00037     
00038     void update();
00039     
00040     char* _title;
00041     char* _label;
00042     
00043     real p0;
00044     real p1;
00045 
00046     real progress_step;
00047     
00048     unsigned int i;
00049     unsigned int n;
00050     
00051   };
00052   
00053 }
00054 
00055 #endif


Documentation automatically generated with Doxygen on 10 Sep 2004.