diff --git a/SConstruct b/SConstruct index a2a3eba83f112f422173b4249ed487c3dc28994b..87c1bebe7661de6994fbb8d2c7efe03bdc25c3d1 100644 --- a/SConstruct +++ b/SConstruct @@ -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() diff --git a/Scheduler/Scheduler.cc b/Scheduler/Scheduler.cc index 3047ab4fb5e62de0bba9543ca6aae54db250e250..fbc917d971843920f9bb8724d3907e865d074266 100644 --- a/Scheduler/Scheduler.cc +++ b/Scheduler/Scheduler.cc @@ -62,10 +62,12 @@ // 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); } diff --git a/Socket/ClientSocketHandle.hh b/Socket/ClientSocketHandle.hh index 96267f5df7bb7712a0b134df0bd5695f9dc4f136..49eafe9afffd23125151e690dba074d719dd1eb6 100644 --- a/Socket/ClientSocketHandle.hh +++ b/Socket/ClientSocketHandle.hh @@ -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) diff --git a/Socket/Mainpage.dox b/Socket/Mainpage.dox index a7279fcd8bf117a43d76dafc1649df135052b048..643cee8408efabe30ca303e5e2ff2189d6bc4430 100644 --- a/Socket/Mainpage.dox +++ b/Socket/Mainpage.dox @@ -142,35 +142,13 @@ 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 */ diff --git a/Socket/ServerSocketHandle.hh b/Socket/ServerSocketHandle.hh index d1032b49589d3b3172198a777991d9d984befb20..40ce4bb85d5868ec28983c210ad1b1443733a6fb 100644 --- a/Socket/ServerSocketHandle.hh +++ b/Socket/ServerSocketHandle.hh @@ -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 diff --git a/Socket/SocketPolicy.hh b/Socket/SocketPolicy.hh index eb453aff28e7a4ae32fdebed4b8468ab7a66e77a..c7ed63ab6b614b59cb1741dd1fe09416a47cfad7 100644 --- a/Socket/SocketPolicy.hh +++ b/Socket/SocketPolicy.hh @@ -206,8 +206,7 @@ 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> diff --git a/Utils/intrusive_refcount.hh b/Utils/intrusive_refcount.hh index 60a60e69bc70e3687a01ba9e05d3eb817074da2b..754686d453e654be36353acfce92f2538fc505c0 100644 --- a/Utils/intrusive_refcount.hh +++ b/Utils/intrusive_refcount.hh @@ -60,7 +60,6 @@ namespace senf { void intrusive_ptr_add_ref(intrusive_refcount* p); void intrusive_ptr_release(intrusive_refcount* p); - } ///////////////////////////////hh.e////////////////////////////////////////