]> git.tdb.fi Git - netvis.git/blob - source/host.h
60dc5477dadcca1d48ebbd6d93183e83c8accb40
[netvis.git] / source / host.h
1 #ifndef HOST_H_
2 #define HOST_H_
3
4 #include <map>
5 #include <string>
6 #include <msp/time/timedelta.h>
7 #include "vector2.h"
8
9 class Connection;
10 class NetVis;
11
12 class Host
13 {
14 private:
15         NetVis &netvis;
16         unsigned addr;
17         std::string name;
18         Vector2 pos;
19         bool visible;
20         std::map<Host *, Connection *> connections;
21
22 public:
23         Host(NetVis &, unsigned);
24         void set_position(const Vector2 &);
25         unsigned get_address() const { return addr; }
26         const std::string &get_name() const { return name; }
27         const Vector2 &get_position() const { return pos; }
28         bool get_visible() const { return visible; }
29
30         void add_connection(Connection &);
31         Connection *get_connection(Host &);
32
33         void tick(const Msp::Time::TimeDelta &);
34         void render() const;
35 };
36
37 #endif