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 HH_SocketProtocol_
24 #define HH_SocketProtocol_ 1
27 #include <boost/utility.hpp>
28 // FIXME: this is really bad. The includes and predefs should be restructured
29 #include "SocketHandle.ih"
31 //#include "SocketProtocol.mpp"
32 ///////////////////////////////hh.p////////////////////////////////////////
37 class SocketPolicyBase;
39 class SocketProtocol : boost::noncopyable
42 ///////////////////////////////////////////////////////////////////////////
45 ///////////////////////////////////////////////////////////////////////////
46 ///\name Structors and default members
50 virtual ~SocketProtocol() = 0;
52 // default default constructor
54 // no conversion constructors
57 ///////////////////////////////////////////////////////////////////////////
59 SocketBody & body() const;
60 virtual SocketPolicyBase const & policy() const = 0;
62 ///////////////////////////////////////////////////////////////////////////
65 virtual std::auto_ptr<SocketProtocol> clone() const = 0;
66 virtual unsigned available() const = 0;
67 virtual bool eof() const = 0;
68 virtual void state(SocketStateMap & map, unsigned lod) const;
73 // backpointer to owning SocketBody instance
75 friend class SocketBody;
78 template <class SocketPolicy>
79 class ConcreteSocketProtocol
80 : public virtual SocketProtocol
83 ///////////////////////////////////////////////////////////////////////////
86 typedef SocketPolicy Policy;
88 ///////////////////////////////////////////////////////////////////////////
89 ///\name Structors and default members
92 ~ConcreteSocketProtocol() = 0;
94 // no default constructor
96 // no conversion constructors
99 ///////////////////////////////////////////////////////////////////////////
101 Policy const & policy() const;
112 ///////////////////////////////hh.e////////////////////////////////////////
113 #include "SocketProtocol.cci"
114 //#include "SocketProtocol.ct"
115 #include "SocketProtocol.cti"
121 // c-file-style: "satcom"