4 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
5 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
6 // Stefan Bund <stefan.bund@fokus.fraunhofer.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.
23 #ifndef IH_SocketHandle_
24 #define IH_SocketHandle_ 1
29 #include <boost/scoped_ptr.hpp>
30 #include "FileHandle.hh"
32 ///////////////////////////////ih.p////////////////////////////////////////
41 class ConvertibleString : public std::string
45 ConvertibleString(bool v);
47 ConvertibleString(T const & other);
49 ConvertibleString & operator+= (ConvertibleString const & other);
52 struct StateMapOrdering
53 : public std::binary_function<std::string,std::string,bool>
55 bool operator()(std::string a1, std::string a2) const;
60 typedef std::map< std::string, detail::ConvertibleString, detail::StateMapOrdering > SocketStateMap;
63 std::string dumpState(SocketStateMap const & map);
70 ///////////////////////////////////////////////////////////////////////////
73 typedef boost::intrusive_ptr<SocketBody> ptr;
75 ///////////////////////////////////////////////////////////////////////////
76 ///\name Structors and default members
79 explicit SocketBody(std::auto_ptr<SocketProtocol> protocol, bool isServer);
80 SocketBody(std::auto_ptr<SocketProtocol> protocol, bool isServer, int fd);
83 // no conversion constructors
86 ///////////////////////////////////////////////////////////////////////////
88 SocketProtocol const & protocol() const;
91 void state(SocketStateMap & map, unsigned lod);
94 virtual void v_close();
95 virtual void v_terminate();
96 virtual bool v_eof() const;
98 boost::scoped_ptr<SocketProtocol> protocol_;
104 ///////////////////////////////ih.e////////////////////////////////////////
110 // c-file-style: "satcom"