]> git.tdb.fi Git - netvis.git/blobdiff - source/host.h
Initial revision
[netvis.git] / source / host.h
diff --git a/source/host.h b/source/host.h
new file mode 100644 (file)
index 0000000..60dc547
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef HOST_H_
+#define HOST_H_
+
+#include <map>
+#include <string>
+#include <msp/time/timedelta.h>
+#include "vector2.h"
+
+class Connection;
+class NetVis;
+
+class Host
+{
+private:
+       NetVis &netvis;
+       unsigned addr;
+       std::string name;
+       Vector2 pos;
+       bool visible;
+       std::map<Host *, Connection *> connections;
+
+public:
+       Host(NetVis &, unsigned);
+       void set_position(const Vector2 &);
+       unsigned get_address() const { return addr; }
+       const std::string &get_name() const { return name; }
+       const Vector2 &get_position() const { return pos; }
+       bool get_visible() const { return visible; }
+
+       void add_connection(Connection &);
+       Connection *get_connection(Host &);
+
+       void tick(const Msp::Time::TimeDelta &);
+       void render() const;
+};
+
+#endif