statistics.cpp

Go to the documentation of this file.
00001 /*****************************************************************************/
00002 /*!
00003  * \file statistics.cpp
00004  * \brief Description: Implementation of Statistics class
00005  * 
00006  * Author: Sergey Berezin
00007  * 
00008  * Created: Thu Jun  5 17:49:01 2003
00009  *
00010  * <hr>
00011  * Copyright (C) 2003 by the Board of Trustees of Leland Stanford
00012  * Junior University and by New York University. 
00013  *
00014  * License to use, copy, modify, sell and/or distribute this software
00015  * and its documentation for any purpose is hereby granted without
00016  * royalty, subject to the terms and conditions defined in the \ref
00017  * LICENSE file provided with this distribution.  In particular:
00018  *
00019  * - The above copyright notice and this permission notice must appear
00020  * in all copies of the software and related documentation.
00021  *
00022  * - THE SOFTWARE IS PROVIDED "AS-IS", WITHOUT ANY WARRANTIES,
00023  * EXPRESSED OR IMPLIED.  USE IT AT YOUR OWN RISK.
00024  * 
00025  * <hr>
00026  * 
00027  */
00028 /*****************************************************************************/
00029 
00030 #include "statistics.h"
00031 
00032 using namespace std;
00033 
00034 namespace CVCL {
00035   
00036 ////////////////////////////////////////////////////////////////////////
00037 // Class Statistics
00038 ////////////////////////////////////////////////////////////////////////
00039 
00040 // Print all the collected data
00041 ostream& Statistics::printAll(ostream& os) const {
00042   // Flags
00043   os << endl
00044      << "********************************" << endl
00045      << "********* Statistics ***********" << endl
00046      << "********************************" << endl;
00047 
00048   StatFlagMap::const_iterator i = d_flags.begin(), iend = d_flags.end();
00049   if(i!=iend) {
00050     os << endl << "************ Flags *************" << endl << endl;
00051     for(; i != iend; ++i)
00052       os << (*i).first << " = " << (*i).second << endl;
00053   }
00054   StatCounterMap::const_iterator 
00055     j = d_counters.begin(), jend = d_counters.end();
00056   if(j!=jend) {
00057     os << endl << "*********** Counters ***********" << endl << endl;
00058     for(; j != jend; ++j)
00059       os << (*j).first << " = " << (*j).second << endl;
00060   }
00061   os << endl
00062      << "********************************" << endl
00063      << "****** End of Statistics *******" << endl
00064      << "********************************" << endl;
00065   return os;
00066 }
00067 
00068 } // end of namespace CVCL
00069 

Generated on Thu Apr 13 16:57:33 2006 for CVC Lite by  doxygen 1.4.4