X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fnet%2Fsocket.h;h=7a47793eab9515f9871446c03c5cc612753c6fa7;hb=cc2e643d6ec3025db3fb6f0a4c1f77af05cf1026;hp=2e736e9a21d04ffaac1f77a704ae50f3f4ed056b;hpb=5afa6e0e07b20ef58d262d69d96971df9a4be71f;p=libs%2Fnet.git diff --git a/source/net/socket.h b/source/net/socket.h index 2e736e9..7a47793 100644 --- a/source/net/socket.h +++ b/source/net/socket.h @@ -1,6 +1,7 @@ #ifndef MSP_NET_SOCKET_H_ #define MSP_NET_SOCKET_H_ +#include #include #include #include @@ -30,8 +31,8 @@ protected: struct Private; - Private *priv; - SockAddr *local_addr; + std::unique_ptr priv; + std::unique_ptr local_addr; Socket(const Private &); Socket(Family, int, int); @@ -41,16 +42,16 @@ private: public: ~Socket(); - virtual void set_block(bool); - virtual void set_inherit(bool); - const IO::Handle &get_handle(IO::Mode); - virtual const IO::Handle &get_event_handle(); + void set_block(bool) override; + void set_inherit(bool) override; + const IO::Handle &get_handle(IO::Mode) override; + const IO::Handle &get_event_handle() override; /** Associates the socket with a local address. There must be no existing users of the address. */ void bind(const SockAddr &); - bool is_bound() const { return local_addr; } + bool is_bound() const { return static_cast(local_addr); } const SockAddr &get_local_address() const; void set_timeout(const Time::TimeDelta &);