00001 // $Id: ProtocolClientSocketHandle.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_ProtocolClientSocketHandle_ 00028 #define HH_SENF_Socket_ProtocolClientSocketHandle_ 1 00029 00030 // Custom includes 00031 #include "ClientSocketHandle.hh" 00032 #include <senf/config.hh> 00033 #include <senf/Utils/Tags.hh> 00034 00035 #include "ProtocolClientSocketHandle.mpp" 00036 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00037 00038 namespace senf { 00039 00041 //\{ 00042 00043 template <class Protocol> class ProtocolServerSocketHandle; 00044 00061 template <class SocketProtocol> 00062 class ProtocolClientSocketHandle 00063 : public ClientSocketHandle<typename SocketProtocol::Policy> 00064 { 00065 public: 00066 //-//////////////////////////////////////////////////////////////////////// 00067 // Types 00068 00069 typedef SocketProtocol Protocol; 00070 00071 //-//////////////////////////////////////////////////////////////////////// 00073 //\{ 00074 00084 ProtocolClientSocketHandle(); 00085 00086 # define BOOST_PP_ITERATION_PARAMS_1 (4, (1, 9, SENF_ABSOLUTE_INCLUDE_PATH(Socket/ProtocolClientSocketHandle.mpp), 1)) 00087 # include BOOST_PP_ITERATE() 00088 00097 ProtocolClientSocketHandle(senf::NoInit_t); 00098 00099 //\} 00100 //-//////////////////////////////////////////////////////////////////////// 00101 00102 Protocol & protocol(); 00103 00108 static ProtocolClientSocketHandle cast_static(FileHandle handle); 00109 static ProtocolClientSocketHandle cast_dynamic(FileHandle handle); 00110 00111 void state(SocketStateMap & map, unsigned lod=0); 00112 std::string dumpState(unsigned lod=0); 00113 00114 protected: 00115 ProtocolClientSocketHandle(FileHandle other, bool isChecked); 00116 00117 private: 00118 friend class ProtocolServerSocketHandle<Protocol>; 00119 }; 00120 00121 //\} 00122 } 00123 00124 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00125 //#include "ProtocolClientSocketHandle.cci" 00126 //#include "ProtocolClientSocketHandle.ct" 00127 #include "ProtocolClientSocketHandle.cti" 00128 #include "ProtocolClientSocketHandle.mpp" 00129 #endif 00130 00131 00132 // Local Variables: 00133 // mode: c++ 00134 // fill-column: 100 00135 // c-file-style: "senf" 00136 // indent-tabs-mode: nil 00137 // ispell-local-dictionary: "american" 00138 // compile-command: "scons -u test" 00139 // comment-column: 40 00140 // End: