]> git.tdb.fi Git - netvis.git/blob - source/port.h
8877ed9067df827cf8a332503d0bf1b72b42b835
[netvis.git] / source / port.h
1 /* $Id$
2
3 This file is part of NetVis
4 Copyright @ 2008 Mikko Rasa, Mikkosoft Productions
5 Distributed unter the GPL
6 */
7
8 #ifndef PORT_H_
9 #define PORT_H_
10
11 #include <string>
12 #include <msp/gl/color.h>
13 #include <msp/gl/mesh.h>
14 #include "activity.h"
15
16 class NetVis;
17
18 class Port
19 {
20 private:
21         NetVis &netvis;
22         unsigned number;
23         bool registered;
24         std::string name;
25         Msp::GL::Color color;
26         Msp::GL::Mesh mesh;
27         Activity activity;
28
29 public:
30         Port(NetVis &, unsigned);
31
32         unsigned get_number() const { return number; }
33         bool is_registered() const { return registered; }
34         const std::string &get_name() const { return name; }
35         const Msp::GL::Color &get_color() const { return color; }
36
37         void add_activity(unsigned);
38         float get_activity() const { return activity.get_average(); }
39
40         void tick(const Msp::Time::TimeDelta &);
41
42         void render() const;
43 };
44
45 #endif