]> git.tdb.fi Git - netvis.git/blobdiff - source/host.h
Resolve IP addresses to hostnames
[netvis.git] / source / host.h
index 60dc5477dadcca1d48ebbd6d93183e83c8accb40..2910ad694577f2412d459d95205cb54c2f415d08 100644 (file)
@@ -1,3 +1,10 @@
+/* $Id$
+
+This file is part of NetVis
+Copyright @ 2008 Mikko Rasa, Mikkosoft Productions
+Distributed unter the GPL
+*/
+
 #ifndef HOST_H_
 #define HOST_H_
 
@@ -6,7 +13,6 @@
 #include <msp/time/timedelta.h>
 #include "vector2.h"
 
-class Connection;
 class NetVis;
 
 class Host
@@ -15,23 +21,32 @@ private:
        NetVis &netvis;
        unsigned addr;
        std::string name;
+       std::string short_name;
+       bool local;
        Vector2 pos;
-       bool visible;
-       std::map<Host *, Connection *> connections;
+       bool active;
+       float activity;
+       float throttle;
 
 public:
        Host(NetVis &, unsigned);
-       void set_position(const Vector2 &);
        unsigned get_address() const { return addr; }
+       void set_name(const std::string &);
        const std::string &get_name() const { return name; }
+       void set_local(bool);
+
+       void set_position(const Vector2 &);
        const Vector2 &get_position() const { return pos; }
-       bool get_visible() const { return visible; }
 
-       void add_connection(Connection &);
-       Connection *get_connection(Host &);
+       void set_active(bool);
+       bool get_active() const { return active; }
+       void add_activity(unsigned);
+       float get_activity() const { return activity; }
+       float send_packet();
 
        void tick(const Msp::Time::TimeDelta &);
        void render() const;
+       void render_label() const;
 };
 
 #endif