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" );
}
}
-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;
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
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" );
// 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"
<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>