Get rid of obsolete StateMapOrdering for SocketHandle::dumpState
g0dil [Thu, 14 Jun 2007 12:34:24 +0000 (12:34 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@260 270642c3-0616-0410-b53a-bc976706d245

Socket/ProtocolServerSocketHandle.test.cc
Socket/SocketHandle.cc
Socket/SocketHandle.ih
Socket/SocketHandle.test.cc
Socket/SocketProtocol.hh
doclib/SConscript

index 384d989..e960e02 100644 (file)
@@ -66,9 +66,9 @@ BOOST_AUTO_UNIT_TEST(protocolServerSocketHandle)
         BOOST_CHECK_EQUAL( client.fd(), -1 );
 
         BOOST_CHECK_EQUAL( h.dumpState(),
-                           "handle: senf::ProtocolServerSocketHandle<(anonymous namespace)::MyProtocol>\n"
                            "file.handle: -1\n"
                            "file.refcount: 2\n"
+                           "handle: senf::ProtocolServerSocketHandle<(anonymous namespace)::MyProtocol>\n"
                            "socket.policy: senf::SocketPolicy<senf::test::SomeAddressingPolicy, senf::test::SomeFramingPolicy, senf::test::SomeCommunicationPolicy, senf::test::SomeReadPolicy, senf::test::SomeWritePolicy, senf::test::SomeBufferingPolicy>\n"
                            "socket.protocol: (anonymous namespace)::MyProtocol\n"
                            "socket.server: true\n" );
index 8b39e32..74803af 100644 (file)
@@ -87,42 +87,6 @@ namespace {
     }
 }
 
-prefix_ bool senf::detail::StateMapOrdering::operator()(std::string const & a1,
-                                                        std::string const & a2)
-    const
-{
-    std::string::const_iterator i1 (a1.begin());
-    std::string::const_iterator const i1_end (a1.end());
-    std::string::const_iterator i2 (a2.begin());
-    std::string::const_iterator const i2_end (a2.end());
-    for(; i1 != i1_end && i2 != i2_end && *i1 == *i2; ++i1, ++i2) ;
-    if (i1 == i1_end) {
-        if (i2 == i2_end)
-            // the strings are equal
-            return false;
-        if (contains(i2,i2_end,'.'))
-            // the longer string is a sub-'directory' of the shorter
-            /** \fixme shouldn't this be *i2 == '.' ? */
-            return true;
-        return *i1 < *i2;
-    }
-    else if (i2 == i2_end) { // && i1 != i1_end
-        if (contains(i1,i1_end,'.'))
-            // the longer string is a sub-'directory' of the shorter
-            /** \fixme shouldn't this be *i1 == '.' ? */
-            return false;
-        return *i1 < *i2;
-    }
-    if (contains(i1,i1_end,'.')) {
-        if (contains(i2,i2_end,'.'))
-            return *i1 < *i2;
-        return false;
-    }
-    else if (contains(i2,i2_end,'.'))
-        return true;
-    return *i1 < *i2;
-}
-
 prefix_ std::string senf::detail::dumpState(SocketStateMap const & map)
 {
     std::stringstream s;
index 1ca7cdd..cfa7bc8 100644 (file)
@@ -80,22 +80,9 @@ namespace senf {
                                            non-empty). */
         };
 
-        /** \brief Special ordering for the SocketStateMap
-            \internal
-
-            This special ordering will sort 'hierarchical' strings correctly. A hierarchical string
-            in this context is a string like a path- or hostname with '.' as the hierarchical
-            separator.
-         */
-        struct StateMapOrdering
-            : public std::binary_function<std::string,std::string,bool>
-        {
-            bool operator()(std::string const & a1, std::string const & a2) const;
-        };
-
     }
 
-    typedef std::map< std::string, detail::ConvertibleString, detail::StateMapOrdering > SocketStateMap;
+    typedef std::map< std::string, detail::ConvertibleString > SocketStateMap;
 
     namespace detail {
         /** \brief Helper to convert SocketStateMap to multiline string representation
index 39510d9..4ab96dd 100644 (file)
@@ -88,9 +88,9 @@ BOOST_AUTO_UNIT_TEST(socketHandle)
                        std::bad_cast );
 
     BOOST_CHECK_EQUAL( myh.dumpState(),
-                       "handle: senf::SocketHandle<senf::SocketPolicy<senf::test::SomeAddressingPolicy, senf::test::SomeFramingPolicy, senf::test::SomeCommunicationPolicy, senf::test::SomeReadPolicy, senf::test::SomeWritePolicy, senf::test::SomeBufferingPolicy> >\n"
                        "file.handle: -1\n"
                        "file.refcount: 3\n"
+                       "handle: senf::SocketHandle<senf::SocketPolicy<senf::test::SomeAddressingPolicy, senf::test::SomeFramingPolicy, senf::test::SomeCommunicationPolicy, senf::test::SomeReadPolicy, senf::test::SomeWritePolicy, senf::test::SomeBufferingPolicy> >\n"
                        "socket.policy: senf::SocketPolicy<senf::test::SomeAddressingPolicy, senf::test::SomeFramingPolicy, senf::test::SomeCommunicationPolicy, senf::test::SomeReadPolicy, senf::test::SomeWritePolicy, senf::test::SomeBufferingPolicy>\n"
                        "socket.protocol: senf::test::SomeProtocol\n"
                        "socket.server: false\n" );
index 25316de..6ce9c61 100644 (file)
@@ -90,7 +90,8 @@
 
 // Custom includes
 #include <boost/utility.hpp>
-/** \fixme this is not nice. The includes and predefs should be restructured */
+// Hrmpf ... I have tried very hard, but I just can't find a nice, generic way to clean
+// up this include
 #include "SocketHandle.ih"
 
 //#include "SocketProtocol.mpp"
index bb8c998..61b7eba 100644 (file)
@@ -69,6 +69,7 @@ div.tabs ul li.$projectname a { background-color: #EDE497; }
       <li><a class="ext" href="http://svn.berlios.de/wsvn/senf/?op=log&rev=0&sc=0&isdir=1">SVN ChangeLog</a></li>
       <li><a class="ext" href="http://developer.berlios.de/projects/senf">SENF @ BerliOS</a></li>
       <li><a class="ext" href="http://openfacts.berlios.de/index-en.phtml?title=SENF+Network+Framework">Wiki</a></li>
+      <li><a href="@TOPDIR@/doc/html/index.html">Home</a></li>
     </ul>
     <h2>${TITLE}</h2>
   </div>