1 // Copyright 2009 The Archiveopteryx Developers <info@aox.org> 2 3 #ifndef GRAPH_H 4 #define GRAPH_H 5 6 #include "estring.h" 7 #include "connection.h" 8 9 10 class GraphableNumber 11 : public Garbage 12 { 13 public: 14 GraphableNumber( const EString & ); 15 16 void setValue( uint ); 17 uint maximumSince( uint ) const; 18 uint minimumSince( uint ) const; 19 uint averageSince( uint ) const; 20 uint lastValue() const; 21 22 EString name() const; 23 uint oldestTime() const; 24 uint youngestTime() const; 25 uint value( uint ); 26 27 private: 28 class GraphableNumberData * d; 29 void clearOldHistory( uint ); 30 }; 31 32 33 class GraphableCounter 34 : public GraphableNumber 35 { 36 public: 37 GraphableCounter( const EString & ); 38 39 void tick(); 40 }; 41 42 43 class GraphableDataSet 44 : public GraphableNumber 45 { 46 public: 47 GraphableDataSet( const EString & ); 48 49 void addNumber( uint ); 50 51 private: 52 class GraphableDataSetData * d; 53 }; 54 55 56 class GraphDumper 57 : public Connection 58 { 59 public: 60 GraphDumper( int ); 61 62 void react( Event ); 63 }; 64 65 66 #endif 67