]> git.tdb.fi Git - netvis.git/blob - source/host.h
2910ad694577f2412d459d95205cb54c2f415d08
[netvis.git] / source / host.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 HOST_H_
9 #define HOST_H_
10
11 #include <map>
12 #include <string>
13 #include <msp/time/timedelta.h>
14 #include "vector2.h"
15
16 class NetVis;
17
18 class Host
19 {
20 private:
21         NetVis &netvis;
22         unsigned addr;
23         std::string name;
24         std::string short_name;
25         bool local;
26         Vector2 pos;
27         bool active;
28         float activity;
29         float throttle;
30
31 public:
32         Host(NetVis &, unsigned);
33         unsigned get_address() const { return addr; }
34         void set_name(const std::string &);
35         const std::string &get_name() const { return name; }
36         void set_local(bool);
37
38         void set_position(const Vector2 &);
39         const Vector2 &get_position() const { return pos; }
40
41         void set_active(bool);
42         bool get_active() const { return active; }
43         void add_activity(unsigned);
44         float get_activity() const { return activity; }
45         float send_packet();
46
47         void tick(const Msp::Time::TimeDelta &);
48         void render() const;
49         void render_label() const;
50 };
51
52 #endif