ConnectedUDPSocketHandle.hh

Go to the documentation of this file.
00001 // $Id: ConnectedUDPSocketHandle.hh 1742 2010-11-04 14:51:56Z g0dil $
00002 //
00003 // Copyright (C) 2006
00004 // Fraunhofer (FOKUS)
00005 // Competence Center NETwork research (NET), St. Augustin, GERMANY
00006 //     Stefan Bund <g0dil@berlios.de>
00007 //
00008 // This program is free software; you can redistribute it and/or modify
00009 // it under the terms of the GNU General Public License as published by
00010 // the Free Software Foundation; either version 2 of the License, or
00011 // (at your option) any later version.
00012 //
00013 // This program is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 //
00018 // You should have received a copy of the GNU General Public License
00019 // along with this program; if not, write to the
00020 // Free Software Foundation, Inc.,
00021 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 
00030 #ifndef HH_SENF_Socket_Protocols_INet_ConnectedUDPSocketHandle_
00031 #define HH_SENF_Socket_Protocols_INet_ConnectedUDPSocketHandle_ 1
00032 
00033 // Custom includes
00034 #include "INetAddressing.hh"
00035 #include "UDPSocketProtocol.hh"
00036 #include <senf/Socket/Protocols/BSDSocketProtocol.hh>
00037 #include <senf/Socket/Protocols/DatagramSocketProtocol.hh>
00038 #include <senf/Socket/FramingPolicy.hh>
00039 #include <senf/Socket/CommunicationPolicy.hh>
00040 #include <senf/Socket/ReadWritePolicy.hh>
00041 #include <senf/Socket/ProtocolClientSocketHandle.hh>
00042 
00043 //#include "ConnectedUDPSocketHandle.mpp"
00044 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00045 
00046 namespace senf {
00047 
00049     //\{
00050 
00051     typedef MakeSocketPolicy<
00052         INet4AddressingPolicy,
00053         DatagramFramingPolicy,
00054         ConnectedCommunicationPolicy,
00055         ReadablePolicy,
00056         WriteablePolicy
00057         >::policy ConnectedUDPv4Socket_Policy;   
00058 
00079     class ConnectedUDPv4SocketProtocol
00080         : public ConcreteSocketProtocol<ConnectedUDPv4Socket_Policy, ConnectedUDPv4SocketProtocol>,
00081           public UDPSocketProtocol,
00082           public BSDSocketProtocol,
00083           public DatagramSocketProtocol,
00084           public AddressableBSDSocketProtocol
00085     {
00086     public:
00087         //-////////////////////////////////////////////////////////////////////////
00088         // internal interface
00089 
00091         //\{
00092 
00093         void init_client() const;       
00094 
00097         void init_client(INet4SocketAddress const & address) const;
00099 
00107         //\}
00108     };
00109 
00110     typedef ProtocolClientSocketHandle<
00111         ConnectedUDPv4SocketProtocol> ConnectedUDPv4ClientSocketHandle;
00112 
00113     typedef MakeSocketPolicy<
00114         ConnectedUDPv4Socket_Policy,
00115         INet6AddressingPolicy
00116         >::policy  ConnectedUDPv6Socket_Policy;
00117 
00138     class ConnectedUDPv6SocketProtocol
00139         : public ConcreteSocketProtocol<ConnectedUDPv6Socket_Policy, ConnectedUDPv6SocketProtocol>,
00140           public UDPSocketProtocol,
00141           public BSDSocketProtocol,
00142           public DatagramSocketProtocol,
00143           public AddressableBSDSocketProtocol
00144     {
00145     public:
00146         //-////////////////////////////////////////////////////////////////////////
00147         // internal interface
00148 
00150         //\{
00151 
00152         void init_client() const;       
00153 
00156         void init_client(INet6SocketAddress const & address) const;
00158 
00166         //\}
00167     };
00168 
00169     typedef ProtocolClientSocketHandle<
00170         ConnectedUDPv6SocketProtocol> ConnectedUDPv6ClientSocketHandle;
00171 
00172     //\}
00173 
00174 }
00175 
00176 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00177 //#include "ConnectedUDPSocketHandle.cci"
00178 //#include "ConnectedUDPSocketHandle.ct"
00179 //#include "ConnectedUDPSocketHandle.cti"
00180 #endif
00181 
00182 
00183 // Local Variables:
00184 // mode: c++
00185 // fill-column: 100
00186 // c-file-style: "senf"
00187 // indent-tabs-mode: nil
00188 // ispell-local-dictionary: "american"
00189 // compile-command: "scons -u test"
00190 // comment-column: 40
00191 // End: