more usable unix sockets classes
[senf.git] / Socket / Protocols / UN / UNAddressing.hh
index 25b02d9..1116d1b 100644 (file)
@@ -1,6 +1,7 @@
-// $Id$
-//
 // Copyright (C) 2007 
+// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
+// Kompetenzzentrum NETwork research (NET)
+//     David Wagner <david.wagner@fokus.fraunhofer.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
@@ -35,6 +36,7 @@
 #include "../../../Socket/ClientSocketHandle.hh"
 #include "../../../Socket/CommunicationPolicy.hh"
 #include "../../../Socket/Protocols/GenericAddressingPolicy.hh"
+#include "../../../Utils/safe_bool.hh"
 #include "UNAddress.hh"
 
 //#include "UNAddressing.mpp"
@@ -42,7 +44,7 @@
 namespace senf {
     /** \brief Unix domain socket address
 
-        UNSocketAddress wraps the standard sockaddr_in datatype. It provides simple accessor methods
+        UNSocketAddress wraps the standard sockaddr_un datatype. It provides simple accessor methods
         to access the path. 
         
         \implementation This implementation is based on sockaddr_un.
@@ -50,7 +52,7 @@ namespace senf {
         \ingroup addr_group
      */
     class UNSocketAddress
-        : public ComparableSafeBool<UNSocketAddress>
+        : public comparable_safe_bool<UNSocketAddress>
     {
     public:
 
@@ -59,14 +61,13 @@ namespace senf {
                                         ///< 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
-        static std::string path();  ///< Return path as string
-        static sockaddr_un sockaddr(); 
-
-        struct sockaddr * sockaddr_p();
+        std::string path() const ;  ///< Return path as string
+        struct sockaddr_un sockaddr(); 
+        struct sockaddr * sockaddr_p() ;
         struct sockaddr const * sockaddr_p() const;
         unsigned sockaddr_len() const;
     private:
-        static struct sockaddr_un sockAddr;
+        struct sockaddr_un sockAddr;
     };
 
     /** \brief Write path  os
@@ -90,7 +91,6 @@ namespace senf {
         GenericAddressingPolicy which see for a detailed
         documentation.
      */
-
     struct UNAddressingPolicy
         : public AddressingPolicyBase,
           private GenericAddressingPolicy<UNSocketAddress>