set keyword svn property on more files
[senf.git] / Socket / Protocols / UN / UNAddressing.hh
index f30cfdd..c2a3232 100644 (file)
@@ -1,6 +1,9 @@
 // $Id$
 //
 // Copyright (C) 2007 
+// Fraunhofer Institute for Open Communication Systems (FOKUS) 
+// Kompetenzzentrum NETwork research (NET)
+//     David Wagner <dw6@berlios.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
 #include <sys/un.h>
 #include <boost/cstdint.hpp>
 #include <boost/operators.hpp>
-#include "boost/filesystem/path.hpp"
 #include "../../../Socket/SocketPolicy.hh"
 #include "../../../Socket/ClientSocketHandle.hh"
 #include "../../../Socket/CommunicationPolicy.hh"
 #include "../../../Socket/Protocols/GenericAddressingPolicy.hh"
-#include "UNAddress.hh"
+#include "../../../Utils/safe_bool.hh"
 
 //#include "UNAddressing.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
+
 namespace senf {
+
     /** \brief Unix domain socket address
 
         UNSocketAddress wraps the standard sockaddr_un datatype. It provides simple accessor methods
@@ -48,27 +52,37 @@ namespace senf {
         \implementation This implementation is based on sockaddr_un.
 
         \ingroup addr_group
+
+        \fixme Why both std::string constructor and from_string member ?
      */
     class UNSocketAddress
-        : public ComparableSafeBool<UNSocketAddress>
+        : public comparable_safe_bool<UNSocketAddress>
     {
     public:
-
-        //UNSocketAddress(); 
-        explicit UNSocketAddress(boost::filesystem::path p);
+        UNSocketAddress(); 
+        explicit UNSocketAddress(std::string p);
                                         ///< Construct an address constant from given path
-        static UNSocketAddress from_string(std::string const s); ///< Create UNSocketAddress from string
-        static UNSocketAddress from_path(boost::filesystem::path const p); ///< Create UNSocketAddress from path
-        std::string path() const ;  ///< Return path as string
-        struct sockaddr_un sockaddr(); 
+        static UNSocketAddress from_string(std::string const s); 
+                                        ///< Create UNSocketAddress from string
+
+        bool operator==(UNSocketAddress const & other) const;
+                                        ///< Compare UNSocketAddress for equality
+
+        std::string path() const ;      ///< Return path as string
+
+        bool boolean_test() const;      ///< \c true, if address is not empty
+        
+        void clear();                   ///< Clear address
+
         struct sockaddr * sockaddr_p() ;
         struct sockaddr const * sockaddr_p() const;
-        unsigned sockaddr_len();
+        unsigned sockaddr_len() const;
+
     private:
-        struct sockaddr_un sockAddr;
+        struct sockaddr_un addr_;
     };
 
-    /** \brief Write path  os
+    /** \brief Write path to os
 
         \related UNSocketAddress
      */
@@ -89,7 +103,6 @@ namespace senf {
         GenericAddressingPolicy which see for a detailed
         documentation.
      */
-
     struct UNAddressingPolicy
         : public AddressingPolicyBase,
           private GenericAddressingPolicy<UNSocketAddress>
@@ -101,7 +114,10 @@ namespace senf {
         using GenericAddressingPolicy<UNSocketAddress>::connect;
         using GenericAddressingPolicy<UNSocketAddress>::bind;
     };
+
+    ///@}
 }
+
 ///////////////////////////////hh.e////////////////////////////////////////
 //#include "UNAddressing.cci"
 //#include "UNAddressing.ct"