Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

stats.h

Go to the documentation of this file.
00001 #ifndef STATS_H
00002 #define STATS_H
00003 // $Id: stats.h,v 1.3 2001/04/12 14:55:55 dvermeir Exp $
00004 #include <map>
00005 #include <vector>
00006 #include "configuration.h"
00007 #include "logrecord.h"
00008 
00010 /* Selected logrecords can be added using Stats::add, the contents
00011    of the database can be printed using operator<<(ostream&,const Stats&).
00012 */
00013 class Stats {
00014 public:
00016 
00019   Stats(const Configuration&);
00021 
00023   void add(const LogRecord&);
00024 
00026 
00028   void print_dates(ostream&) const;
00029   void print_paths(ostream&) const;
00030   void print_domains(ostream&) const;
00031 
00033   /* What information (dates, paths or domains) is printed, depends on configuration_.
00034   */
00035   friend ostream&
00036   operator<<(ostream&,const Stats&);
00037 private:
00039 
00043   typedef map<vector<int>,unsigned int>         DateCount;
00045 
00049   typedef map<vector<string>,unsigned int>      PathCount;
00051 
00056   typedef map<vector<string>,unsigned int>      DomainCount;
00057 
00058   DateCount             dates_; 
00059   PathCount             paths_; 
00060   DomainCount           domains_;       
00062   Configuration         configuration_; 
00063 };
00064 #endif

httpstats-stage01 [ 7 April, 2001]