• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List
  • File Members

statistics.h

Go to the documentation of this file.
00001 // 
00002 //   Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software
00003 //   Foundation, Inc
00004 // 
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 3 of the License, or
00008 // (at your option) any later version.
00009 // 
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018 //
00019 
00020 #ifndef __STATISTICS_H__
00021 #define __STATISTICS_H__
00022 
00023 #include <vector>
00024 #include <sys/time.h>
00025 #include <network.h>
00026 #include <list>
00027 
00028 #include "netstats.h"
00029 
00030 namespace gnash 
00031 {
00032 
00033 class Statistics : public NetStats {
00034 public:
00035     Statistics();
00036     ~Statistics();
00037     typedef enum {
00038         NO_BROWSER,
00039         MOZILLA,
00040         FIREFOX,
00041         OPERA,
00042         KONQUEROR,
00043         GALEON,
00044         EPIPHANY,
00045         SAFARI,
00046         IE
00047     } browser_e;
00048     typedef enum {
00049         OSTYPE_NONE,
00050         OSTYPE_LINUX,
00051         OSTYPE_BSD,
00052         OSTYPE_DARWIN,
00053         OSTYPE_WIN32,
00054         OSTYPE_SOLARIS
00055     } ostype_e;
00056 
00057     // Add a sample
00058     int addStats();
00059     
00060     // these make calculations on the collected network data.
00061     float getFPS();
00062     int getBitRate();
00063     
00064     // Accessors
00065     void setIPaddr(in_addr_t x) { _ipaddr = x; };
00066     void setBrowser(browser_e x) { _browser = x; } ;
00067     void setOS(ostype_e x) { _os = x; } ;
00068     in_addr_t getIPaddr() { return _ipaddr; };
00069     browser_e getBrowser() { return _browser; };
00070     ostype_e getOS() { return _os; };
00071     
00072 //    void setFilespec(std::string &x) { _filespec = x; } ;
00073 //    std::string &getFilespec() { return _filespec; };
00074     // Dump the collected network statistics in a human readable form.
00075     void dump();
00076     void clear();
00077 private:
00078     in_addr_t           _ipaddr;
00079     browser_e           _browser;
00080     ostype_e            _os;
00081     std::list<NetStats *> _netstats;
00082     boost::uint32_t     _msg_count;
00083     std::vector<std::string> _filespec;
00084 };
00085  
00086 } // end of gnash namespace
00087 
00088 #endif // __STATISTICS_H__
00089 
00090 // local Variables:
00091 // mode: C++
00092 // indent-tabs-mode: t
00093 // End:

Generated on Fri Mar 16 2012 15:46:12 for Gnash by  doxygen 1.7.1