From: g0dil Date: Mon, 29 Jan 2007 22:51:07 +0000 (+0000) Subject: Fix 'compiled' check in SConstruct X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=15c5e1939d77dfea97da38df7526bcb84a53460b;p=senf.git Fix 'compiled' check in SConstruct Further Socket library documentation git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@187 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/SConstruct b/SConstruct index a2a3eba..87c1beb 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 3047ab4..fbc917d 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 96267f5..49eafe9 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: + + + + + + + + + + + + + +
ClientSocketHandle member Policy member
read() ReadPolicy::read (\ref senf::ReadPolicyBase)
readfrom() ReadPolicy::readfrom (\ref senf::ReadPolicyBase)
write() WritePolicy::write (\ref senf::WritePolicyBase)
writeto() WritePolicy::writeto (\ref senf::WritePolicyBase)
connect() AddressingPolicy::connect (\ref senf::AddressingPolicyBase)
bind() AddressingPolicy::bind (\ref senf::AddressingPolicyBase)
peer() AddressingPolicy::peer (\ref senf::AddressingPolicyBase)
local() AddressingPolicy::local (\ref senf::AddressingPolicyBase)
rcvbuf() BufferingPolicy::sndbuf (\ref senf::BufferingPolicyBase)
sndbuf() BufferingPolicy::rcvbuf (\ref senf::BufferingPolicyBase)
+ + 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() 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 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 a7279fc..643cee8 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. - - - - - - - - - - - - - - - - - - -
SocketHandle member Policy member
senf::ClientSocketHandle::read ReadPolicy::read (\ref senf::ReadPolicyBase)
senf::ClientSocketHandle::readfrom ReadPolicy::readfrom (\ref senf::ReadPolicyBase)
senf::ClientSocketHandle::write WritePolicy::write (\ref senf::WritePolicyBase)
senf::ClientSocketHandle::writeto WritePolicy::writeto (\ref senf::WritePolicyBase)
senf::ClientSocketHandle::connect AddressingPolicy::connect (\ref senf::AddressingPolicyBase)
senf::ClientSocketHandle::bind AddressingPolicy::bind (\ref senf::AddressingPolicyBase)
senf::ClientSocketHandle::peer AddressingPolicy::peer (\ref senf::AddressingPolicyBase)
senf::ClientSocketHandle::local AddressingPolicy::local (\ref senf::AddressingPolicyBase)
senf::ClientSocketHandle::rcvbuf BufferingPolicy::sndbuf (\ref senf::BufferingPolicyBase)
senf::ClientSocketHandle::sndbuf BufferingPolicy::rcvbuf (\ref senf::BufferingPolicyBase)
senf::ServerSocketHandle::bind AddressingPolicy::bind (\ref senf::AddressingPolicyBase)
senf::ServerSocketHandle::listen CommunicationPolicy::listen (\ref senf::CommunicationPolicyBase)
senf::ServerSocketHandle::local AddressingPolicy::local (\ref senf::AddressingPolicyBase)
senf::ServerSocketHandle::accept CommunicationPolicy::accept (\ref senf::CommunicationPolicyBase)
senf::ServerSocketHandle::acceptfrom CommunicationPolicy::accept (\ref senf::CommunicationPolicyBase)
- - 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 d1032b4..40ce4bb 100644 --- a/Socket/ServerSocketHandle.hh +++ b/Socket/ServerSocketHandle.hh @@ -41,6 +41,15 @@ namespace senf { template class ClientSocketHandle; /** \brief + + + + + + + +
senf::ServerSocketHandle::bind AddressingPolicy::bind (\ref senf::AddressingPolicyBase)
senf::ServerSocketHandle::listen CommunicationPolicy::listen (\ref senf::CommunicationPolicyBase)
senf::ServerSocketHandle::local AddressingPolicy::local (\ref senf::AddressingPolicyBase)
senf::ServerSocketHandle::accept CommunicationPolicy::accept (\ref senf::CommunicationPolicyBase)
senf::ServerSocketHandle::acceptfrom CommunicationPolicy::accept (\ref senf::CommunicationPolicyBase)
+ */ template class ServerSocketHandle diff --git a/Socket/SocketPolicy.hh b/Socket/SocketPolicy.hh index eb453af..c7ed63a 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 The Boost enable_if utility \n The Boost.MPL library \n The Boost.Preprocessor library diff --git a/Utils/intrusive_refcount.hh b/Utils/intrusive_refcount.hh index 60a60e6..754686d 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////////////////////////////////////////