X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/431ac6bd7924ab99473c9a621a25ab0c555c3e60..d43e446400ac7b65d7d2dd3acd57f8f669484449:/hostdata.h?ds=sidebyside diff --git a/hostdata.h b/hostdata.h index 82e133f..59ca35d 100644 --- a/hostdata.h +++ b/hostdata.h @@ -2,28 +2,32 @@ #define HOSTDATA_H #include +#include #include class hostdata { public: static void create(); static void destroy(); + static size_t size() { return hosts.size(); } + static const hostdata& at(size_t i) { return hosts[i]; } hostdata(m_host_t host); ~hostdata(); - const char* get_name() const { return name; } + const char* get_name() const { return name; } const char* get_ctrl_mbox() const { return ctrl_mbox.c_str(); } const char* get_data_mbox() const { return data_mbox.c_str(); } private: - // linked list of hostdata's, used by create/destroy - static hostdata* instances; - hostdata* next; + // static list of hostdata's, used by create/destroy + static std::vector hosts; + struct m_host_less; const char* name; std::string ctrl_mbox; std::string data_mbox; + }; #endif // !HOSTDATA_H