X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fsockaddr.h;h=6e4025d298cc46d0fc16719dcebf1cdad334514a;hb=28e7bf7a13656620452e19d017ea5eedf14a8bc5;hp=0f7a7468170b816edda4f13580019fccee232e1b;hpb=1b2aabf076169e6d2049227188e464e95ac40514;p=libs%2Fnet.git diff --git a/source/sockaddr.h b/source/sockaddr.h index 0f7a746..6e4025d 100644 --- a/source/sockaddr.h +++ b/source/sockaddr.h @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of libmspnet -Copyright © 2008, 2011 Mikkosoft Productions, Mikko Rasa -Distributed under the LGPL -*/ - #ifndef MSP_NET_SOCKADDR_H_ #define MSP_NET_SOCKADDR_H_ @@ -19,26 +12,26 @@ namespace Net { class SockAddr { +protected: + SockAddr() { } public: - virtual Family get_family() const =0; - virtual std::string str() const =0; + virtual ~SockAddr() { } + + static SockAddr *create(const sockaddr &sa) { return create(reinterpret_cast(sa)); } + static SockAddr *create(const sockaddr_storage &); + + virtual SockAddr *copy() const = 0; + + 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 &) 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() { } }; } // namespace Net