Fixed whitespace in all files (no tabs)
[senf.git] / Socket / ProtocolClientSocketHandle.hh
1 // $Id$
2 //
3 // Copyright (C) 2006
4 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
5 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
6 //     Stefan Bund <stefan.bund@fokus.fraunhofer.de>
7 //
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.
12 //
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.
17 //
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.
22
23 /** \file
24     \brief ProtocolClientSocketHandle public header
25  */
26
27 #ifndef HH_ProtocolClientSocketHandle_
28 #define HH_ProtocolClientSocketHandle_ 1
29
30 // Custom includes
31 #include "ClientSocketHandle.hh"
32
33 #include "ProtocolClientSocketHandle.mpp"
34 ///////////////////////////////hh.p////////////////////////////////////////
35
36 namespace senf {
37
38     /// \addtogroup handle_group
39     /// @{
40
41     template <class Protocol> class ProtocolServerSocketHandle;
42
43     /** \brief Protocol specific socket handle (client interface)
44
45         The ProtocolClientSocketHandle is the client interface leaf class of the handle
46         hierarchy. This is the class to instantiate to open a new socket. This is also the \e only
47         class, which can be used to open a client socket.
48
49         The \a Protocol template argument defines the protocol of the socket. This protocol provides
50         the protocol interface of the socket as well as the complete socket policy of this protocol.
51
52         The ProtocolClientSocketHandle adds the protocol interface as an additional interface to the
53         socket handle. This interface is only accessible via the protocol class. All socket
54         functionality not available through the policy interface (see ClientSocketHandle) is
55         accessible via the protocol() member.
56
57         \see \ref protocol_group
58       */
59     template <class SocketProtocol>
60     class ProtocolClientSocketHandle
61         : public ClientSocketHandle<typename SocketProtocol::Policy>
62     {
63     public:
64         ///////////////////////////////////////////////////////////////////////////
65         // Types
66
67         typedef SocketProtocol Protocol; ///< The sockets protocol
68
69         ///////////////////////////////////////////////////////////////////////////
70         ///\name Structors and default members
71         ///@{
72
73         /** \brief Create new client socket
74
75             This constructor is one of the possible constructors. The exact Signature of the
76             constructor (or constructors) is defined by the \c init_client() member (or members) of
77             the \a Protocol class. ProtocolClientSocketHandle defines a number of constructors
78             taking up to 9 arguments which just forward to a corresponding \a Protocol\c
79             ::init_client() member. See the documentation of the respective Protocol class for a
80             detailed documentation of that protocols constructors.
81          */
82         ProtocolClientSocketHandle();
83
84 #       define BOOST_PP_ITERATION_PARAMS_1 (4, (1, 9, "Socket/ProtocolClientSocketHandle.mpp", 1))
85 #       include BOOST_PP_ITERATE()
86
87         ///@}
88         ///////////////////////////////////////////////////////////////////////////
89
90         Protocol const & protocol();    ///< Access the protocol interface
91                                         /**< The returned protocol class reference gives access to
92                                            the complete protocol interface as defined by that
93                                            class. See the respective protocol class documentation.
94                                            \returns \a Protocol class reference */
95
96         static ProtocolClientSocketHandle cast_static(FileHandle handle);
97         static ProtocolClientSocketHandle cast_dynamic(FileHandle handle);
98
99         void state(SocketStateMap & map, unsigned lod=0);
100         std::string dumpState(unsigned lod=0);
101
102     protected:
103         ProtocolClientSocketHandle(FileHandle other, bool isChecked);
104
105     private:
106         friend class ProtocolServerSocketHandle<Protocol>;
107     };
108
109     /// @}
110 }
111
112 ///////////////////////////////hh.e////////////////////////////////////////
113 //#include "ProtocolClientSocketHandle.cci"
114 //#include "ProtocolClientSocketHandle.ct"
115 #include "ProtocolClientSocketHandle.cti"
116 #include "ProtocolClientSocketHandle.mpp"
117 #endif
118
119 \f
120 // Local Variables:
121 // mode: c++
122 // fill-column: 100
123 // c-file-style: "senf"
124 // indent-tabs-mode: nil
125 // ispell-local-dictionary: "american"
126 // End: