]> git.tdb.fi Git - netvis.git/blobdiff - source/port.h
Track and display the activity of ports
[netvis.git] / source / port.h
index 4ce9427fc6df5b6913afd0743e8a8fb38dbe9a22..8877ed9067df827cf8a332503d0bf1b72b42b835 100644 (file)
@@ -11,6 +11,7 @@ Distributed unter the GPL
 #include <string>
 #include <msp/gl/color.h>
 #include <msp/gl/mesh.h>
+#include "activity.h"
 
 class NetVis;
 
@@ -23,6 +24,7 @@ private:
        std::string name;
        Msp::GL::Color color;
        Msp::GL::Mesh mesh;
+       Activity activity;
 
 public:
        Port(NetVis &, unsigned);
@@ -32,6 +34,11 @@ public:
        const std::string &get_name() const { return name; }
        const Msp::GL::Color &get_color() const { return color; }
 
+       void add_activity(unsigned);
+       float get_activity() const { return activity.get_average(); }
+
+       void tick(const Msp::Time::TimeDelta &);
+
        void render() const;
 };