00001 // $Id: ProtocolServerSocketHandle.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 00027 #ifndef HH_SENF_Socket_ProtocolServerSocketHandle_ 00028 #define HH_SENF_Socket_ProtocolServerSocketHandle_ 1 00029 00030 // Custom includes 00031 #include "ServerSocketHandle.hh" 00032 #include <senf/config.hh> 00033 #include <senf/Utils/Tags.hh> 00034 00035 #include "ProtocolServerSocketHandle.mpp" 00036 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00037 00038 namespace senf { 00039 00041 //\{ 00042 00043 template <class Protocol> class ProtocolClientSocketHandle; 00044 00065 template <class SocketProtocol> 00066 class ProtocolServerSocketHandle 00067 : public ServerSocketHandle<typename SocketProtocol::Policy> 00068 { 00069 public: 00070 //-//////////////////////////////////////////////////////////////////////// 00071 // Types 00072 00073 typedef SocketProtocol Protocol; 00074 00075 //-//////////////////////////////////////////////////////////////////////// 00077 //\{ 00078 00089 ProtocolServerSocketHandle(); 00090 00091 # define BOOST_PP_ITERATION_PARAMS_1 (4, (1, 9, SENF_ABSOLUTE_INCLUDE_PATH(Socket/ProtocolServerSocketHandle.mpp), 1)) 00092 # include BOOST_PP_ITERATE() 00093 00103 ProtocolServerSocketHandle(senf::NoInit_t); 00104 //\} 00105 //-//////////////////////////////////////////////////////////////////////// 00106 00107 Protocol & protocol(); 00108 00113 ProtocolClientSocketHandle<SocketProtocol> accept(); 00114 00115 static ProtocolServerSocketHandle cast_static(FileHandle handle); 00116 static ProtocolServerSocketHandle cast_dynamic(FileHandle handle); 00117 00118 void state(SocketStateMap & map, unsigned lod=0); 00119 std::string dumpState(unsigned lod=0); 00120 00121 protected: 00122 ProtocolServerSocketHandle(FileHandle other, bool isChecked); 00123 00124 private: 00125 00126 }; 00127 00128 //\} 00129 } 00130 00131 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00132 //#include "ProtocolServerSocketHandle.cci" 00133 //#include "ProtocolServerSocketHandle.ct" 00134 #include "ProtocolServerSocketHandle.cti" 00135 #endif 00136 00137 00138 // Local Variables: 00139 // mode: c++ 00140 // fill-column: 100 00141 // c-file-style: "senf" 00142 // indent-tabs-mode: nil 00143 // ispell-local-dictionary: "american" 00144 // compile-command: "scons -u test" 00145 // comment-column: 40 00146 // End: