X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fhost.h;h=928d7aaf79566ebebf5bdccae794fd5d1fff106a;hb=HEAD;hp=60dc5477dadcca1d48ebbd6d93183e83c8accb40;hpb=229e1d6ab66a9e987ffe3cd4a8de7c7f874f6de1;p=netvis.git diff --git a/source/host.h b/source/host.h index 60dc547..928d7aa 100644 --- a/source/host.h +++ b/source/host.h @@ -1,34 +1,52 @@ +/* $Id$ + +This file is part of NetVis +Copyright @ 2008 Mikko Rasa, Mikkosoft Productions +Distributed unter the GPL +*/ + #ifndef HOST_H_ #define HOST_H_ #include #include #include +#include "activity.h" +#include "address.h" #include "vector2.h" -class Connection; class NetVis; class Host { private: NetVis &netvis; - unsigned addr; + Address addr; std::string name; + std::string short_name; + bool local; Vector2 pos; - bool visible; - std::map connections; + bool active; + Activity activity; + float throttle; public: - Host(NetVis &, unsigned); - void set_position(const Vector2 &); - 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; } - 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.get_average(); } + float send_packet(); void tick(const Msp::Time::TimeDelta &); void render() const;