"Fossies" - the Fresh Open Source Software Archive

Member "xosview-1.23/linux/netmeter.h" (11 Jul 2020, 783 Bytes) of package /linux/misc/xosview-1.23.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "netmeter.h" see the Fossies "Dox" file reference documentation.

    1 //
    2 //  Copyright (c) 1994, 1995, 2006 by Mike Romberg ( mike.romberg@noaa.gov )
    3 //
    4 //  This file may be distributed under terms of the GPL
    5 //
    6 
    7 #ifndef _NETMETER_H_
    8 #define _NETMETER_H_
    9 
   10 #include "fieldmetergraph.h"
   11 #include "xosview.h"
   12 #include <string>
   13 
   14 
   15 class NetMeter : public FieldMeterGraph {
   16 public:
   17   NetMeter(XOSView *parent, float max);
   18   ~NetMeter( void );
   19 
   20   const char *name( void ) const { return "NetMeter"; }
   21   void checkevent( void );
   22   void checkResources( void );
   23 
   24 private:
   25   void getProcStats( unsigned long long &totin, unsigned long long &totout );
   26   void getSysStats( unsigned long long &totin, unsigned long long &totout );
   27   float _maxpackets;
   28   std::string _netIface;
   29   bool _usesysfs, _ignored;
   30   unsigned long long _lastBytesIn, _lastBytesOut;
   31 };
   32 
   33 
   34 #endif