X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FClientSocketHandle.hh;h=93cd2521017ac1a73558a9fa918db6c18645b7e2;hb=6f50bf49e282c0528f51faa0a245bbfa2b867399;hp=2b6f4250a92dda1f3c386e50b38ac3e9d34ca731;hpb=145f6a7d0f3a6aaa77b3625351c952d24cb0b8a1;p=senf.git diff --git a/Socket/ClientSocketHandle.hh b/Socket/ClientSocketHandle.hh index 2b6f425..93cd252 100644 --- a/Socket/ClientSocketHandle.hh +++ b/Socket/ClientSocketHandle.hh @@ -1,9 +1,9 @@ // $Id$ // // Copyright (C) 2006 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Stefan Bund +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -30,6 +30,8 @@ // Custom includes #include #include +#include +#include #include "SocketHandle.hh" //#include "ClientSocketHandle.mpp" @@ -46,20 +48,21 @@ namespace senf { 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: + any functionality itself however. The following table shows, to which policy members each + group of ClientSocketHandle members is forwardd. The last collumn shows, on which other + policies this member-group depends in the default policy classes. If you define + your own policy classes, the dependencies are up to you. - - - - - - - - - - - + + + + + + + + +
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)
ClientSocketHandle member Policy member Other policies
read() ReadPolicy::read (\ref senf::ReadPolicyBase)
readfrom() ReadPolicy::readfrom (\ref senf::ReadPolicyBase) UnconnectedCommunicationPolicy
write() WritePolicy::write (\ref senf::WritePolicyBase) ConnectedCommunicationPolicy
writeto() WritePolicy::writeto (\ref senf::WritePolicyBase) UnconnectedCommunicationPolicy
connect() AddressingPolicy::connect (\ref senf::AddressingPolicyBase)
bind() AddressingPolicy::bind (\ref senf::AddressingPolicyBase)
peer() AddressingPolicy::peer (\ref senf::AddressingPolicyBase)
local() AddressingPolicy::local (\ref senf::AddressingPolicyBase)
It is important to note, that not all members are always accessible. Which are depends on @@ -81,10 +84,6 @@ namespace senf { \see \ref policy_group \n \ref protocol_group - - \fixme Add enable_if conditions so anything convertible to unsigned will not be interpreted - as a Range template argument but will use the unsigned variant of - read/readfrom/write/writeto. */ template class ClientSocketHandle @@ -122,13 +121,22 @@ namespace senf { ClientSocketHandle(); // conversion constructors +# ifndef DOXYGEN template ClientSocketHandle(ClientSocketHandle other, typename SocketHandle::template IsCompatible::type * = 0); +# else + ClientSocketHandle(ClientSocketHandle other); +# endif +# ifndef DOXYGEN template typename SocketHandle::template IsCompatible::type const & operator=(ClientSocketHandle other); +# else + template + OtherPolicy const & operator=(ClientSocketHandle other); +# endif ///@} /////////////////////////////////////////////////////////////////////////// @@ -169,6 +177,11 @@ namespace senf { */ std::string read (unsigned limit=0); template +# ifndef DOXYGEN + typename boost::range_iterator::type + read (ForwardWritableRange const & range, + typename boost::disable_if< boost::is_convertible >::type * = 0); +# else typename boost::range_iterator::type read (ForwardWritableRange const & range); ///< Read data into range @@ -183,6 +196,13 @@ namespace senf { last read character \see \ref read() \n Boost.Range */ +# endif +# ifndef DOXYGEN + template + typename boost::range_iterator::type + read (ForwardWritableRange & range, + typename boost::disable_if< boost::is_convertible >::type * = 0); +# else template typename boost::range_iterator::type read (ForwardWritableRange & range); @@ -190,6 +210,7 @@ namespace senf { /**< \see read(ForwardWritableRange const &) \n read() \n Boost.Range */ +# endif template void read (Sequence & container, unsigned limit); ///< Read data into container @@ -399,24 +420,6 @@ namespace senf { ///@} - /////////////////////////////////////////////////////////////////////////// - ///\name Buffering - ///@{ - - unsigned rcvbuf (); ///< Check size of receive buffer - /**< \returns size of receive buffer in bytes */ - void rcvbuf (unsigned size); - ///< Set size of receive buffer - /**< \param[in] size size of receive buffer in bytes */ - - unsigned sndbuf (); ///< Check size of send buffer - /**< \returns size of send buffer in bytes */ - void sndbuf (unsigned size); - ///< Set size of send buffer - /**< \param[in] size size of send buffer in bytes */ - - ///@} - static ClientSocketHandle cast_static(FileHandle handle); static ClientSocketHandle cast_dynamic(FileHandle handle); @@ -426,8 +429,7 @@ namespace senf { protected: ClientSocketHandle(FileHandle other, bool isChecked); - explicit ClientSocketHandle(std::auto_ptr protocol, - int fd = -1); + explicit ClientSocketHandle(std::auto_ptr body); private: unsigned available();