contrib/mul/mbl/mbl_screen_counter.cxx
Go to the documentation of this file.
00001 // This is mul/mbl/mbl_screen_counter.cxx
00002 #include "mbl_screen_counter.h"
00003 //:
00004 // \file
00005 // \brief Printing dots to the screen to indicate events
00006 // \author Ian Scott
00007 
00008 #include <vcl_iostream.h>
00009 
00010 mbl_screen_counter::mbl_screen_counter(vcl_ostream & os):
00011 count_(0), symbol_('a'), skip_(1), os_(os)
00012 {
00013 }
00014 
00015 //: Mark event
00016 // This is a postfix increment operator
00017 mbl_screen_counter mbl_screen_counter::operator++ (int)
00018 {
00019   count_++;
00020   if (count_ % skip_ == 0) os_ << symbol_ << vcl_flush;
00021 
00022   if (count_ / skip_ == 100)
00023   {
00024     skip_ *= 10;
00025     symbol_++;
00026     os_ << "\nReached " << count_ << ". Each '" << symbol_ << "' = " << skip_ << ":";
00027   }
00028   return *this;
00029 }