Search:

SENF Extensible Network Framework

  • Home
  • Download
  • Wiki
  • BerliOS
  • ChangeLog
  • Browse SVN
  • Bug Tracker
  • Overview
  • Examples
  • HowTos
  • Glossary
  • PPI
  • Packets
  • Scheduler
  • Socket
  • Utils
  • Console
  • Daemon
  • Logger
  • Termlib
  • Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • Directories
  • File List
  • File Members

ProtocolServerSocketHandle.mpp

Go to the documentation of this file.
00001 // $Id: ProtocolServerSocketHandle.mpp 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 
00027 #if !BOOST_PP_IS_ITERATING
00028 #ifndef MPP_SENF_Socket_ProtocolServerSocketHandle_
00029 
00030 // Custom includes
00031 #include <boost/preprocessor/iteration/iterate.hpp>
00032 #include <boost/preprocessor/enum.hpp>
00033 #include <boost/preprocessor/cat.hpp>
00034 
00035 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00036 // Local Macros
00037 
00038 #define mpp_PSSH_Arg(z,n,data) BOOST_PP_CAT(A,n) const & BOOST_PP_CAT(a,n)
00039 
00040 #define mpp_PSSH_TemplateParameters() BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), class A )
00041 #define mpp_PSSH_MethodParameters() BOOST_PP_ENUM(BOOST_PP_ITERATION(), mpp_PSSH_Arg, )
00042 #define mpp_PSSH_CallParameters() BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), a )
00043 
00044 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00045 #endif
00046 #else
00047 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00048 
00049 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00050 #if BOOST_PP_ITERATION_FLAGS()==1
00051 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00052 // senf::ProtocolServerSocketHandle<SocketProtocol>::
00053 // ProtocolServerSocketHandle (constructor) declaration
00054 
00055 template < mpp_PSSH_TemplateParameters() >
00056 explicit ProtocolServerSocketHandle( mpp_PSSH_MethodParameters() );
00057 
00058 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00059 #elif BOOST_PP_ITERATION_FLAGS()==2
00060 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00061 // senf::ProtocolServerSocketHandle<SocketProtocol>::
00062 // ProtocolServerSocketHandle (constructor) implementation
00063 
00064 template <class SocketProtocol>
00065 template < mpp_PSSH_TemplateParameters() >
00066 prefix_ senf::ProtocolServerSocketHandle<SocketProtocol>::
00067 ProtocolServerSocketHandle( mpp_PSSH_MethodParameters() )
00068     : ServerSocketHandle<typename SocketProtocol::Policy>(
00069         std::auto_ptr<senf::SocketBody>(new ProtocolSocketBody<SocketProtocol>(true)))
00070 {
00071     this->protocol().init_server( mpp_PSSH_CallParameters() );
00072 }
00073 
00074 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00075 #endif
00076 #endif
00077 #if !BOOST_PP_IS_ITERATING
00078 #ifdef MPP_SENF_Socket_ProtocolServerSocketHandle_
00079 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00080 // Undefine local Macros
00081 
00082 #undef mpp_PSSH_Arg
00083 #undef mpp_PSSH_TemplateParameters
00084 #undef mpp_PSSH_MethodParameters
00085 #undef mpp_PSSH_CallParameters
00086 
00087 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00088 #else
00089 #define MPP_SENF_Socket_ProtocolServerSocketHandle_ 1
00090 #endif
00091 #endif
00092 
00093 
00094 // Local Variables:
00095 // mode: c++
00096 // fill-column: 100
00097 // c-file-style: "senf"
00098 // indent-tabs-mode: nil
00099 // ispell-local-dictionary: "american"
00100 // End:

Contact: senf-dev@lists.berlios.de | © 2006-2010 Fraunhofer Institute for Open Communication Systems, Network Research