4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
6 // The contents of this file are subject to the Fraunhofer FOKUS Public License
7 // Version 1.0 (the "License"); you may not use this file except in compliance
8 // with the License. You may obtain a copy of the License at
9 // http://senf.berlios.de/license.html
11 // The Fraunhofer FOKUS Public License Version 1.0 is based on,
12 // but modifies the Mozilla Public License Version 1.1.
13 // See the full license text for the amendments.
15 // Software distributed under the License is distributed on an "AS IS" basis,
16 // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
17 // for the specific language governing rights and limitations under the License.
19 // The Original Code is Fraunhofer FOKUS code.
21 // The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V.
22 // (registered association), Hansastraße 27 c, 80686 Munich, Germany.
25 // Stefan Bund <g0dil@berlios.de>
29 \brief ssenf::ProtocolServerSocketHandle Boost.Preprocessor external iteration include
32 #if !BOOST_PP_IS_ITERATING
33 #ifndef MPP_SENF_Socket_ProtocolServerSocketHandle_
36 #include <boost/preprocessor/iteration/iterate.hpp>
37 #include <boost/preprocessor/enum.hpp>
38 #include <boost/preprocessor/cat.hpp>
40 //-/////////////////////////////////////////////////////////////////////////////////////////////////
43 #define mpp_PSSH_Arg(z,n,data) BOOST_PP_CAT(A,n) const & BOOST_PP_CAT(a,n)
45 #define mpp_PSSH_TemplateParameters() BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), class A )
46 #define mpp_PSSH_MethodParameters() BOOST_PP_ENUM(BOOST_PP_ITERATION(), mpp_PSSH_Arg, )
47 #define mpp_PSSH_CallParameters() BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), a )
49 //-/////////////////////////////////////////////////////////////////////////////////////////////////
52 //-/////////////////////////////////////////////////////////////////////////////////////////////////
54 //-/////////////////////////////////////////////////////////////////////////////////////////////////
55 #if BOOST_PP_ITERATION_FLAGS()==1
56 //-/////////////////////////////////////////////////////////////////////////////////////////////////
57 // senf::ProtocolServerSocketHandle<SocketProtocol>::
58 // ProtocolServerSocketHandle (constructor) declaration
60 template < mpp_PSSH_TemplateParameters() >
61 explicit ProtocolServerSocketHandle( mpp_PSSH_MethodParameters() );
63 //-/////////////////////////////////////////////////////////////////////////////////////////////////
64 #elif BOOST_PP_ITERATION_FLAGS()==2
65 //-/////////////////////////////////////////////////////////////////////////////////////////////////
66 // senf::ProtocolServerSocketHandle<SocketProtocol>::
67 // ProtocolServerSocketHandle (constructor) implementation
69 template <class SocketProtocol>
70 template < mpp_PSSH_TemplateParameters() >
71 prefix_ senf::ProtocolServerSocketHandle<SocketProtocol>::
72 ProtocolServerSocketHandle( mpp_PSSH_MethodParameters() )
73 : ServerSocketHandle<typename SocketProtocol::Policy>(
74 std::auto_ptr<senf::SocketBody>(new ProtocolSocketBody<SocketProtocol>(true)))
76 this->protocol().init_server( mpp_PSSH_CallParameters() );
79 //-/////////////////////////////////////////////////////////////////////////////////////////////////
82 #if !BOOST_PP_IS_ITERATING
83 #ifdef MPP_SENF_Socket_ProtocolServerSocketHandle_
84 //-/////////////////////////////////////////////////////////////////////////////////////////////////
85 // Undefine local Macros
88 #undef mpp_PSSH_TemplateParameters
89 #undef mpp_PSSH_MethodParameters
90 #undef mpp_PSSH_CallParameters
92 //-/////////////////////////////////////////////////////////////////////////////////////////////////
94 #define MPP_SENF_Socket_ProtocolServerSocketHandle_ 1
102 // c-file-style: "senf"
103 // indent-tabs-mode: nil
104 // ispell-local-dictionary: "american"