X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FReadWritePolicy.hh;h=023b3f66476b80ed156da6190c8bcff0421d91ca;hb=a1fdb7bb122f0b05be809a922d4b7ef5e125fa67;hp=e8846694ad25e879a4491aa4fce381b81cee029b;hpb=1d6a05a5ebfab82985d40e694f8257397ca5036c;p=senf.git diff --git a/Socket/ReadWritePolicy.hh b/Socket/ReadWritePolicy.hh index e884669..023b3f6 100644 --- a/Socket/ReadWritePolicy.hh +++ b/Socket/ReadWritePolicy.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 @@ -26,8 +26,8 @@ \todo ReadWritePolicy.test.cc */ -#ifndef HH_ReadWritePolicy_ -#define HH_ReadWritePolicy_ 1 +#ifndef HH_SENF_Socket_ReadWritePolicy_ +#define HH_SENF_Socket_ReadWritePolicy_ 1 // Custom includes #include "SocketPolicy.hh" @@ -58,17 +58,23 @@ namespace senf { \param[in] buffer address of buffer to write data to \param[in] size size of buffer \returns number of bytes read */ - template - static unsigned readfrom(ClientSocketHandle handle, char * buffer, unsigned size, - typename Policy::AddressingPolicy::Address & address, +# ifndef DOXYGEN + template + static unsigned readfrom(ClientSocketHandle handle, char * buffer, unsigned size, + typename SPolicy::AddressingPolicy::Address & address, typename IfCommunicationPolicyIs< - Policy,UnconnectedCommunicationPolicy>::type * = 0); + SPolicy,UnconnectedCommunicationPolicy>::type * = 0); +# else + template + static unsigned readfrom(ClientSocketHandle handle, char * buffer, unsigned size, + typename Policy::AddressingPolicy::Address & address); ///< read data from socket returning peer address /**< \param[in] handle socket handle to read from \param[in] buffer address of buffer to write data to \param[in] size size of buffer \param[out] address peer address \returns number of bytes read */ +# endif private: static unsigned do_readfrom(FileHandle handle, char * buffer, unsigned size, @@ -91,10 +97,15 @@ namespace senf { */ struct WriteablePolicy : public WritePolicyBase { - template - static unsigned write(ClientSocketHandle handle, char const * buffer, unsigned size, +# ifndef DOXYGEN + template + static unsigned write(ClientSocketHandle handle, char const * buffer, unsigned size, typename IfCommunicationPolicyIs< - Policy,ConnectedCommunicationPolicy>::type * = 0); + SPolicy,ConnectedCommunicationPolicy>::type * = 0); +# else + template + static unsigned write(ClientSocketHandle handle, char const * buffer, + unsigned size); ///< write data to socket /**< This member is only enabled if the socket uses connected communication. Otherwise the communication @@ -105,13 +116,20 @@ namespace senf { \param[in] buffer address of buffer to send \param[in] size number of bytes to write \returns number of bytes written */ - template - static unsigned writeto(ClientSocketHandle handle, +# endif +# ifndef DOXYGEN + template + static unsigned writeto(ClientSocketHandle handle, typename boost::call_traits< - typename Policy::AddressingPolicy::Address>::param_type addr, + typename SPolicy::AddressingPolicy::Address>::param_type addr, char const * buffer, unsigned size, typename IfCommunicationPolicyIs< - Policy,UnconnectedCommunicationPolicy>::type * = 0); + SPolicy,UnconnectedCommunicationPolicy>::type * = 0); +# else + template + static unsigned writeto(ClientSocketHandle handle, + typename Policy::AddressingPolicy::Address const & addr, + char const * buffer, unsigned size); ///< write data to socket sending to given peer /**< This member is only enabled if the socket uses unconnected communication. Otherwise no target may be @@ -123,6 +141,7 @@ namespace senf { \param[in] addr peer to send data to \returns number of bytes written */ +# endif private: static unsigned do_write(FileHandle handle, char const * buffer, unsigned size); @@ -158,4 +177,5 @@ namespace senf { // indent-tabs-mode: nil // ispell-local-dictionary: "american" // compile-command: "scons -u test" +// comment-column: 40 // End: