X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fhost.h;h=928d7aaf79566ebebf5bdccae794fd5d1fff106a;hb=c1ea3cf06729622e2287e1604b1847d14fd2089c;hp=2910ad694577f2412d459d95205cb54c2f415d08;hpb=a56b7174bc4d39064e5fb8d22953963f224315db;p=netvis.git diff --git a/source/host.h b/source/host.h index 2910ad6..928d7aa 100644 --- a/source/host.h +++ b/source/host.h @@ -11,6 +11,8 @@ Distributed unter the GPL #include #include #include +#include "activity.h" +#include "address.h" #include "vector2.h" class NetVis; @@ -19,21 +21,23 @@ class Host { private: NetVis &netvis; - unsigned addr; + Address addr; std::string name; std::string short_name; bool local; Vector2 pos; bool active; - float activity; + Activity activity; float throttle; public: - Host(NetVis &, unsigned); - unsigned get_address() const { return addr; } + Host(NetVis &, const Address &); + + const Address &get_address() const { return addr; } void set_name(const std::string &); const std::string &get_name() const { return name; } void set_local(bool); + bool is_local() const { return local; } void set_position(const Vector2 &); const Vector2 &get_position() const { return pos; } @@ -41,12 +45,11 @@ public: void set_active(bool); bool get_active() const { return active; } void add_activity(unsigned); - float get_activity() const { return activity; } + float get_activity() const { return activity.get_average(); } float send_packet(); void tick(const Msp::Time::TimeDelta &); void render() const; - void render_label() const; }; #endif