4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief ProtocolClientSocketHandle Boost.Preprocessor external iteration include
27 #if !BOOST_PP_IS_ITERATING && !defined(MPP_ProtocolClientSocketHandle_)
28 #define MPP_ProtocolClientSocketHandle_ 1
31 #include <boost/preprocessor/iteration/iterate.hpp>
32 #include <boost/preprocessor/enum.hpp>
33 #include <boost/preprocessor/cat.hpp>
35 // ///////////////////////////mpp.p////////////////////////////////////////
36 #elif BOOST_PP_IS_ITERATING // ////////////////////////////////////////////
37 // ////////////////////////////////////////////////////////////////////////
40 #define mpp_Arg(z,n,data) BOOST_PP_CAT(A,n) const & BOOST_PP_CAT(a,n)
41 #define mpp_TemplateParameters() BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), class A )
42 #define mpp_MethodParameters() BOOST_PP_ENUM(BOOST_PP_ITERATION(), mpp_Arg, )
43 #define mpp_CallParameters() BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), a )
45 // ////////////////////////////////////////////////////////////////////////
46 #if BOOST_PP_ITERATION_FLAGS()==1 // //////////////////////////////////////
47 // ////////////////////////////////////////////////////////////////////////
48 // senf::ProtocolClientSocketHandle<SocketProtocol>::
49 // ProtocolClientSocketHandle (constructor) declaration
51 template < mpp_TemplateParameters() >
52 explicit ProtocolClientSocketHandle( mpp_MethodParameters() );
54 // ////////////////////////////////////////////////////////////////////////
55 #elif BOOST_PP_ITERATION_FLAGS()==2 // ////////////////////////////////////
56 // ////////////////////////////////////////////////////////////////////////
57 // senf::ProtocolClientSocketHandle<SocketProtocol>::
58 // ProtocolClientSocketHandle (constructor) implementation
60 template <class SocketProtocol>
61 template < mpp_TemplateParameters() >
62 prefix_ senf::ProtocolClientSocketHandle<SocketProtocol>::
63 ProtocolClientSocketHandle( mpp_MethodParameters() )
64 : ClientSocketHandle<typename SocketProtocol::Policy>(
65 std::auto_ptr<senf::SocketBody>(new ProtocolSocketBody<SocketProtocol>(false)))
67 this->protocol().init_client( mpp_CallParameters() );
70 // ////////////////////////////////////////////////////////////////////////
71 #endif // /////////////////////////////////////////////////////////////////
72 // ////////////////////////////////////////////////////////////////////////
73 // Undefine local Macros
76 #undef mpp_TemplateParameters
77 #undef mpp_MethodParameters
78 #undef mpp_CallParameters
80 // ////////////////////////////////////////////////////////////////////////
81 #endif // /////////////////////////////////////////////////////////////////
82 // ///////////////////////////mpp.e////////////////////////////////////////
88 // c-file-style: "senf"
89 // indent-tabs-mode: nil
90 // ispell-local-dictionary: "american"
91 // compile-command: "scons -u test"