Changed UnknownHostnameException's argument processing
[senf.git] / Socket / Protocols / INet / INetAddressing.hh
index 5bf7f45..929d888 100644 (file)
@@ -67,9 +67,9 @@ namespace senf {
                                              initialize the host and port members. Since it uses the
                                              INet4Address::from_string constructor, this call may
                                              block while waiting for the resolver.
-                                             \throws SyntaxException if the address syntax is
+                                             \throws AddressSyntaxException if the address syntax is
                                                  invalid
-                                             \throws INet4Address::UnknownHostnameException if the
+                                             \throws UnknownHostnameException if the
                                                  address cannot be resolved. */
 
         INet4SocketAddress(INet4Address const & addr, unsigned port); 
@@ -99,10 +99,6 @@ namespace senf {
 
         /// @}
 
-        struct SyntaxException : public std::exception
-        { virtual char const * what() const throw() 
-                { return "Invalid IPv4 socket address syntax"; } };
-
     private:
         struct ::sockaddr_in addr_;
     };
@@ -145,6 +141,8 @@ namespace senf {
         \ingroup addr_group
      */
     class INet6SocketAddress
+        : public boost::equality_comparable<INet6SocketAddress>, 
+          public senf::comparable_safe_bool<INet6SocketAddress>
     {
     public:
         ///////////////////////////////////////////////////////////////////////////
@@ -158,9 +156,9 @@ namespace senf {
         explicit INet6SocketAddress(std::string const & addr, 
                                     INet6Address::Resolve_t resolve = INet6Address::ResolveINet6);
                                         ///< Initialize/convert from string representation
-                                        /**< \throws SyntaxException if the address syntax is
+                                        /**< \throws AddressSyntaxException if the address syntax is
                                                  invalid
-                                             \throws INet6Address::UnknownHostnameException if the
+                                             \throws UnknownHostnameException if the
                                                  address cannot be resolved.
                                              \param[in] addr Address to parse
                                              \param[in] resolve If this is
@@ -175,7 +173,6 @@ namespace senf {
         ///////////////////////////////////////////////////////////////////////////
 
         bool operator==(INet6SocketAddress const & other) const; ///< Check addresses for equality
-        bool operator!=(INet6SocketAddress const & other) const; ///< Inverse of above
 
         void clear();                   ///< Clear socket address
 
@@ -189,6 +186,8 @@ namespace senf {
         std::string iface() const;      ///< Get interface name
         void iface(std::string const & iface); ///< Change interface
 
+        bool boolean_test() const;      ///< \c true, if address is not empty (i.e. [::]:0)
+
         ///\name Generic SocketAddress interface
         ///@{
 
@@ -198,10 +197,6 @@ namespace senf {
 
         ///@}
 
-        struct SyntaxException : public std::exception
-        { virtual char const * what() const throw() 
-                { return "Invalid IPv6 socket address syntax"; } };
-
     protected:
 
     private:
@@ -221,7 +216,7 @@ namespace senf {
     /** \brief Addressing policy supporting IPv4 addressing
 
         \par Address Type:
-            INet4Address
+            INet4SocketAddress
 
         This addressing policy implements addressing using Internet V4
         addresses.