X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fsockaddr.h;h=ff2f88a9b7be650064d4528f18ba3ff88ddd510e;hb=bdd968802348fae7a7a407616cb3744e4877601a;hp=62e559c23f73df62bde597d40ec1daee6668144a;hpb=2aab4004e71a2e5c773289e0be5e58aec6a8d339;p=libs%2Fnet.git diff --git a/source/sockaddr.h b/source/sockaddr.h index 62e559c..ff2f88a 100644 --- a/source/sockaddr.h +++ b/source/sockaddr.h @@ -12,26 +12,23 @@ namespace Net { class SockAddr { +protected: + SockAddr() { } public: - virtual Family get_family() const =0; - virtual std::string str() const =0; - - /** - Fills the given struct sockaddr with information from this SockAddr. - - @return Number of bytes used - */ - virtual unsigned fill_sockaddr(sockaddr &) const =0; - virtual unsigned fill_sockaddr(sockaddr_storage &) const; - - virtual SockAddr *copy() const =0; - virtual ~SockAddr() { } static SockAddr *create(const sockaddr &sa) { return create(reinterpret_cast(sa)); } static SockAddr *create(const sockaddr_storage &); -protected: - SockAddr() { } + + virtual SockAddr *copy() const = 0; + + virtual Family get_family() const = 0; + virtual std::string str() const = 0; + + /** Fills a struct sockaddr with information from this SockAddr. Returns + the number of bytes used. */ + virtual unsigned fill_sockaddr(sockaddr &) const = 0; + virtual unsigned fill_sockaddr(sockaddr_storage &) const; }; } // namespace Net