From: g0dil Date: Thu, 14 Jun 2007 12:34:24 +0000 (+0000) Subject: Get rid of obsolete StateMapOrdering for SocketHandle::dumpState X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=c13146edc1b57cc60f102bcfd1a7a602ecec261f;p=senf.git Get rid of obsolete StateMapOrdering for SocketHandle::dumpState git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@260 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Socket/ProtocolServerSocketHandle.test.cc b/Socket/ProtocolServerSocketHandle.test.cc index 384d989..e960e02 100644 --- a/Socket/ProtocolServerSocketHandle.test.cc +++ b/Socket/ProtocolServerSocketHandle.test.cc @@ -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\n" "socket.protocol: (anonymous namespace)::MyProtocol\n" "socket.server: true\n" ); diff --git a/Socket/SocketHandle.cc b/Socket/SocketHandle.cc index 8b39e32..74803af 100644 --- a/Socket/SocketHandle.cc +++ b/Socket/SocketHandle.cc @@ -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; diff --git a/Socket/SocketHandle.ih b/Socket/SocketHandle.ih index 1ca7cdd..cfa7bc8 100644 --- a/Socket/SocketHandle.ih +++ b/Socket/SocketHandle.ih @@ -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 - { - 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 diff --git a/Socket/SocketHandle.test.cc b/Socket/SocketHandle.test.cc index 39510d9..4ab96dd 100644 --- a/Socket/SocketHandle.test.cc +++ b/Socket/SocketHandle.test.cc @@ -88,9 +88,9 @@ BOOST_AUTO_UNIT_TEST(socketHandle) std::bad_cast ); BOOST_CHECK_EQUAL( myh.dumpState(), - "handle: senf::SocketHandle >\n" "file.handle: -1\n" "file.refcount: 3\n" + "handle: senf::SocketHandle >\n" "socket.policy: senf::SocketPolicy\n" "socket.protocol: senf::test::SomeProtocol\n" "socket.server: false\n" ); diff --git a/Socket/SocketProtocol.hh b/Socket/SocketProtocol.hh index 25316de..6ce9c61 100644 --- a/Socket/SocketProtocol.hh +++ b/Socket/SocketProtocol.hh @@ -90,7 +90,8 @@ // Custom includes #include -/** \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" diff --git a/doclib/SConscript b/doclib/SConscript index bb8c998..61b7eba 100644 --- a/doclib/SConscript +++ b/doclib/SConscript @@ -69,6 +69,7 @@ div.tabs ul li.$projectname a { background-color: #EDE497; }
  • SVN ChangeLog
  • SENF @ BerliOS
  • Wiki
  • +
  • Home
  • ${TITLE}