diff options
author | Calvin Morrison <mutantturkey@gmail.com> | 2014-11-05 22:25:50 -0500 |
---|---|---|
committer | Calvin Morrison <mutantturkey@gmail.com> | 2014-11-05 22:25:50 -0500 |
commit | 9115e4f438379c8a8edd4e4069fe56cd2ab46c4b (patch) | |
tree | bba6a0f2135bf837dd5cb9647872587e28c4988a /statistics.hpp | |
parent | 71d3b718ba0f1f4c3a7aad11b5c297ead5cfd95a (diff) |
turn that C++ into C
Diffstat (limited to 'statistics.hpp')
-rw-r--r-- | statistics.hpp | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/statistics.hpp b/statistics.hpp deleted file mode 100644 index c916ecb..0000000 --- a/statistics.hpp +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef CBM_STATISTICS_H -#define CBM_STATISTICS_H - -#include <list> -#include <string> -#include <sys/time.h> - -namespace statistics { - -struct Statistics { - struct timeval timestamp; - unsigned long long rx_bytes, rx_packets, rx_errs, rx_drop, rx_fifo, - rx_frame, rx_compressed, rx_multicast, - tx_bytes, tx_packets, tx_errs, tx_drop, tx_fifo, - tx_frame, tx_compressed, tx_multicast; -}; - -class Interface { - public: - Interface(const std::string& name); - - const std::string& getName() const; - - void setUpdated(bool updated); - bool getUpdated() const; - - void update(const Statistics& statistics); - - double getReceiveSpeed() const; - double getTransmitSpeed() const; - - private: - std::string name_; - bool updated_; - Statistics statistics_[2]; - double receiveSpeed_, transmitSpeed_; -}; - -class Reader { - public: - void update(); - - typedef std::list<Interface> Interfaces; - const Interfaces& getInterfaces() const; - - private: - Interfaces interfaces_; -}; - -} // namespace statistics - -#endif |