X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fnet%2Finet.h;h=d970559dab23fb628e61837275c1e0ba8ba807c5;hb=3f46fef7032d97b0dd82971ffece1062fd6b05b8;hp=639e64cbb1eca5ec8c9fc2e0d5247c91600adf38;hpb=debe1004676d5431e571d9c4361072661dcc88c4;p=libs%2Fnet.git diff --git a/source/net/inet.h b/source/net/inet.h index 639e64c..d970559 100644 --- a/source/net/inet.h +++ b/source/net/inet.h @@ -1,6 +1,7 @@ #ifndef MSP_NET_INET_H_ #define MSP_NET_INET_H_ +#include "mspnet_api.h" #include "sockaddr.h" namespace Msp { @@ -9,23 +10,26 @@ namespace Net { /** Address class for IPv4 sockets. */ -class InetAddr: public SockAddr +class MSPNET_API InetAddr: public SockAddr { private: - unsigned char addr[4]; - unsigned port; + unsigned char addr[4] = { }; + unsigned port = 0; public: - InetAddr(); + InetAddr() = default; InetAddr(const SysAddr &); - virtual InetAddr *copy() const { return new InetAddr(*this); } + static InetAddr wildcard(unsigned); + static InetAddr localhost(unsigned); - virtual SysAddr to_sys() const; + InetAddr *copy() const override { return new InetAddr(*this); } - virtual Family get_family() const { return INET; } + SysAddr to_sys() const override; + + Family get_family() const override { return INET; } unsigned get_port() const { return port; } - virtual std::string str() const; + std::string str() const override; }; } // namespace Net