Fix 'compiled' check in SConstruct
g0dil [Mon, 29 Jan 2007 22:51:07 +0000 (22:51 +0000)]
Further Socket library documentation

git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@187 270642c3-0616-0410-b53a-bc976706d245

SConstruct
Scheduler/Scheduler.cc
Socket/ClientSocketHandle.hh
Socket/Mainpage.dox
Socket/ServerSocketHandle.hh
Socket/SocketPolicy.hh
Utils/intrusive_refcount.hh

index a2a3eba..87c1beb 100644 (file)
@@ -7,10 +7,10 @@ import SENFSCons
 ###########################################################################
 
 svninfo = dict(
-    [ tuple(map(lambda y:y.strip(),x.split(":",1)))
+    [ map(lambda y:y.strip(),x.split(":",1))
       for x in os.popen("svn info").read().split("\n")
       if ':' in x ] )
-svninfo['commited'] = not(os.popen("svn status").read())
+svninfo['commited'] = not(os.popen("svn status -q").read())
 
 SENFSCons.UseBoost()
 SENFSCons.UseSTLPort()
index 3047ab4..fbc917d 100644 (file)
 // You should use sigaction to register the signal handlers and define
 // a sa_mask so all Scheduler-registered signals are automatically
 // *blocked* whenever one of the signals is called (including the
-// called signal!). This ensures, that no two signals can be delivered
-// on top of each other. And of course any signal registered with the
-// scheduler must be blocked as soon as it is registered with the
-// scheduler.
+// called signal!) (This also means, we will have to re-register all
+// signals if we change the registration of some signal since the
+// sa_mask changes). This ensures, that no two signals can be
+// delivered on top of each other. And of course any signal registered
+// with the scheduler must be blocked as soon as it is registered with
+// the scheduler.
 
 // Definition of non-inline non-template functions
 
@@ -209,6 +211,10 @@ prefix_ void senf::Scheduler::process()
            if (spec.cb_hup)
                spec.cb_hup(EV_HUP);
            else if (ev.events & EPOLLERR) {
+               /// \fixme This is stupid, if cb_write and cb_read are
+               /// the same. The same below. We really have to
+               /// exactly define sane semantics of what to do on
+               /// EPOLLHUP and EPOLLERR.
                if (spec.cb_write) spec.cb_write(EV_HUP);
                if (spec.cb_read) spec.cb_read(EV_HUP);
            }
index 96267f5..49eafe9 100644 (file)
@@ -43,8 +43,59 @@ namespace senf {
 
     /** \brief Generic SocketHandle with client interface
        
+       This class provides the client side policy interface of the
+       socket abstraction. ClientSocketHandle defines the complete
+       policy interface. It does not implement any functionality
+       itself however. All calls are forward to the following policy
+       classes:
+
+       <table class="senf">
+       <tr><th>ClientSocketHandle member</th> <th>Policy member</th></tr>
+       <tr><td>read()</td>       <td>ReadPolicy::read (\ref senf::ReadPolicyBase)</td></tr>
+       <tr><td>readfrom()</td>   <td>ReadPolicy::readfrom (\ref senf::ReadPolicyBase)</td></tr>
+       <tr><td>write()</td>      <td>WritePolicy::write (\ref senf::WritePolicyBase)</td></tr>
+       <tr><td>writeto()</td>    <td>WritePolicy::writeto (\ref senf::WritePolicyBase)</td></tr>
+       <tr><td>connect()</td>    <td>AddressingPolicy::connect (\ref senf::AddressingPolicyBase)</td></tr>
+       <tr><td>bind()</td>       <td>AddressingPolicy::bind (\ref senf::AddressingPolicyBase)</td></tr>
+       <tr><td>peer()</td>       <td>AddressingPolicy::peer (\ref senf::AddressingPolicyBase)</td></tr>
+       <tr><td>local()</td>      <td>AddressingPolicy::local (\ref senf::AddressingPolicyBase)</td></tr>
+       <tr><td>rcvbuf()</td>     <td>BufferingPolicy::sndbuf (\ref senf::BufferingPolicyBase)</td></tr>
+       <tr><td>sndbuf()</td>     <td>BufferingPolicy::rcvbuf (\ref senf::BufferingPolicyBase)</td></tr>
+       </table>
+
+       It is important to note, that not all members are always
+       accessible. Which are depends on the \c Policy template
+       argument. If any of the policy axis is left unspecified the
+       corresponding members will not be callable (you will get a
+       compile time error). Even if every policy axis is defined,
+       some members might (and will) not exist depending on the exact
+       policy. To find out, which members are available, you have to
+       check the documentation of the policy classes. You can also
+       find a summary of all active members in the leaf protocol
+       class documentation.
+
        \todo Move all not template-parameter dependent code into a
        non-template base class
+
+       \idea Give SocketHandle (and therefore ClientSocketHandle and
+       ServerSocketHandle) a \c protocol() template member and an
+       additional template arg \c Policies. This arg should be a
+       typelist of Poclicy classes which can be accessed. You use
+       protocol<ProtocolClass>() to access a protocol class. \c
+       Policies can of course be underspecified or even empty.
+
+       \idea add more flexible read/write members for a)
+       boost::arrays and arrays of other types b) std::vector (which
+       uses contiguous memory ..) c) other random-access containers
+       (we should use some configurable trait class to identify
+       containers with contiguous storage). Probably we should just
+       use a generic Boost.Range interface. Here we again come to the
+       point: make all except the most basic members be non-member
+       algorithms ? this would make the configuration of such
+       extenden members more flexible.
+
+       \see \ref policy_group
+             \ref protocol_group
       */
     template <class Policy>
     class ClientSocketHandle
@@ -80,7 +131,7 @@ namespace senf {
         ///////////////////////////////////////////////////////////////////////////
 
         ///////////////////////////////////////////////////////////////////////////
-        ///\name reading and writing
+        ///\name Reading and Writing
         ///@{
 
         // read from socket (connected or unconnected)
index a7279fc..643cee8 100644 (file)
     Therefore you need to be careful of what you are doing. The first
     step is to find out, which policy you will have to implement. For
     this, find the senf::ClientSocketHandle and/or
-    senf::ServerSocketHandle members you want to change. The following
-    table shows, which policy axis is responsible for which
-    members. The policy axis base class documentation contains further
-    information on how to implement that policy.
-
-    <table class="senf">
-      <tr><th>SocketHandle member</th>                  <th>Policy member</th></tr>
-      <tr><td>senf::ClientSocketHandle::read</td>       <td>ReadPolicy::read (\ref senf::ReadPolicyBase)</td></tr>
-      <tr><td>senf::ClientSocketHandle::readfrom</td>   <td>ReadPolicy::readfrom (\ref senf::ReadPolicyBase)</td></tr>
-      <tr><td>senf::ClientSocketHandle::write</td>      <td>WritePolicy::write (\ref senf::WritePolicyBase)</td></tr>
-      <tr><td>senf::ClientSocketHandle::writeto</td>    <td>WritePolicy::writeto (\ref senf::WritePolicyBase)</td></tr>
-      <tr><td>senf::ClientSocketHandle::connect</td>    <td>AddressingPolicy::connect (\ref senf::AddressingPolicyBase)</td></tr>
-      <tr><td>senf::ClientSocketHandle::bind</td>       <td>AddressingPolicy::bind (\ref senf::AddressingPolicyBase)</td></tr>
-      <tr><td>senf::ClientSocketHandle::peer</td>       <td>AddressingPolicy::peer (\ref senf::AddressingPolicyBase)</td></tr>
-      <tr><td>senf::ClientSocketHandle::local</td>      <td>AddressingPolicy::local (\ref senf::AddressingPolicyBase)</td></tr>
-      <tr><td>senf::ClientSocketHandle::rcvbuf</td>     <td>BufferingPolicy::sndbuf (\ref senf::BufferingPolicyBase)</td></tr>
-      <tr><td>senf::ClientSocketHandle::sndbuf</td>     <td>BufferingPolicy::rcvbuf (\ref senf::BufferingPolicyBase)</td></tr>
-      <tr><td>senf::ServerSocketHandle::bind</td>       <td>AddressingPolicy::bind (\ref senf::AddressingPolicyBase)</td></tr>
-      <tr><td>senf::ServerSocketHandle::listen</td>     <td>CommunicationPolicy::listen (\ref senf::CommunicationPolicyBase)</td></tr>
-      <tr><td>senf::ServerSocketHandle::local</td>      <td>AddressingPolicy::local (\ref senf::AddressingPolicyBase)</td></tr>
-      <tr><td>senf::ServerSocketHandle::accept</td>     <td>CommunicationPolicy::accept (\ref senf::CommunicationPolicyBase)</td></tr>
-      <tr><td>senf::ServerSocketHandle::acceptfrom</td> <td>CommunicationPolicy::accept (\ref senf::CommunicationPolicyBase)</td></tr>
-    </table>
-
-    As you can see from this list, not all policy axis directly
-    contribute to the SocketHandle interface. However, some policy
-    members additionally depend on other policy axis (example:
-    AddressingPolicy::connect is only defined if the communication
-    policy is ConnectedCommunication).
+    senf::ServerSocketHandle members you want to change (see \ref
+    senf::ClientSocketHandle and \ref senf::ServerSocketHandle).  Not
+    all policy axis directly contribute to the SocketHandle
+    interface. However, some policy members additionally depend on
+    other policy axis (example: AddressingPolicy::connect is only
+    defined if the communication policy is
+    ConnectedCommunication).
 
     \see policy_group
  */
index d1032b4..40ce4bb 100644 (file)
@@ -41,6 +41,15 @@ namespace senf {
     template <class Policy> class ClientSocketHandle;
 
     /** \brief
+
+       <table>
+       <tr><td>senf::ServerSocketHandle::bind</td>       <td>AddressingPolicy::bind (\ref senf::AddressingPolicyBase)</td></tr>
+       <tr><td>senf::ServerSocketHandle::listen</td>     <td>CommunicationPolicy::listen (\ref senf::CommunicationPolicyBase)</td></tr>
+       <tr><td>senf::ServerSocketHandle::local</td>      <td>AddressingPolicy::local (\ref senf::AddressingPolicyBase)</td></tr>
+       <tr><td>senf::ServerSocketHandle::accept</td>     <td>CommunicationPolicy::accept (\ref senf::CommunicationPolicyBase)</td></tr>
+       <tr><td>senf::ServerSocketHandle::acceptfrom</td> <td>CommunicationPolicy::accept (\ref senf::CommunicationPolicyBase)</td></tr>
+       </table>
+       
       */
     template <class Policy>
     class ServerSocketHandle
index eb453af..c7ed63a 100644 (file)
     senf::ConnectedCommunicationPolicyIs is based on the \c
     boost::enable_if template).
 
-    \see \ref policy_framework \n
-        \ref extend_policy \n
+    \see \ref extend_policy \n
          <a class="ext" href="http://www.boost.org/libs/utility/enable_if.html">The Boost enable_if utility</a> \n
          <a class="ext" href="http://www.boost.org/libs/mpl/doc/index.html">The Boost.MPL library</a> \n
          <a class="ext" href="http://www.boost.org/libs/preprocessor/doc/index.html">The Boost.Preprocessor library</a>
index 60a60e6..754686d 100644 (file)
@@ -60,7 +60,6 @@ namespace senf {
 
     void intrusive_ptr_add_ref(intrusive_refcount* p);
     void intrusive_ptr_release(intrusive_refcount* p);
-
 }
 
 ///////////////////////////////hh.e////////////////////////////////////////