Fix documentation build under maverick (doxygen 1.7.1)
[senf.git] / senf / Socket / ProtocolServerSocketHandle.hh
1 // $Id$
2 //
3 // Copyright (C) 2006
4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 //     Stefan Bund <g0dil@berlios.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 ProtocolServerSocketHandle public header
25  */
26
27 #ifndef HH_SENF_Socket_ProtocolServerSocketHandle_
28 #define HH_SENF_Socket_ProtocolServerSocketHandle_ 1
29
30 // Custom includes
31 #include "ServerSocketHandle.hh"
32 #include <senf/config.hh>
33 #include <senf/Utils/Tags.hh>
34
35 #include "ProtocolServerSocketHandle.mpp"
36 //-/////////////////////////////////////////////////////////////////////////////////////////////////
37
38 namespace senf {
39
40     /// \addtogroup handle_group
41     //\{
42
43     template <class Protocol> class ProtocolClientSocketHandle;
44
45     /** \brief Protocol specific socket handle (server interface)
46
47         The ProtocolServerSocketHandle is the server interface leaf class of the handle
48         hierarchy. This is the class to instantiate to open a new socket. This is also the \e only
49         class, which can be used to open a server socket.
50
51         The \a Protocol template argument defines the protocol of the socket. This protocol provides
52         the protocol interface of the socket as well as the complete socket policy of this protocol.
53
54         The ProtocolServerSocketHandle adds the protocol interface as an additional interface to the
55         socket handle. This interface is only accessible via the protocol class. All socket
56         functionality not available through the policy interface (see ServerSocketHandle) is
57         accessible via the protocol() member.
58
59         A ProtocolServerSocketHandle is only meaningful for connection oriented addressable
60         protocols (CommunicationPolicy is ConnectedCommunicationPolicy and AddressingPolicy is not
61         NoAddressingPolicy).
62
63         \see \ref protocol_group
64       */
65     template <class SocketProtocol>
66     class ProtocolServerSocketHandle
67         : public ServerSocketHandle<typename SocketProtocol::Policy>
68     {
69     public:
70         //-////////////////////////////////////////////////////////////////////////
71         // Types
72
73         typedef SocketProtocol Protocol; ///< The socket protocol
74
75         //-////////////////////////////////////////////////////////////////////////
76         ///\name Structors and default members
77         //\{
78
79         /** \brief Create new server socket
80
81             This constructor is one of the possible constructors. The exact Signature of the
82             constructor (or constructors) is defined by the \c init_server() member (or members) of
83             the \a Protocol class. ProtocolClientSocketHandle defines a number of constructors
84             taking up to 9 arguments which just forward to a corresponding \a Protocol\c
85             ::init_server() member. See the documentation of the respective Protocol class for a
86             detailed documentation of that protocols constructors.
87          */
88
89         ProtocolServerSocketHandle();
90
91 #       define BOOST_PP_ITERATION_PARAMS_1 (4, (1, 9, SENF_ABSOLUTE_INCLUDE_PATH(Socket/ProtocolServerSocketHandle.mpp), 1))
92 #       include BOOST_PP_ITERATE()
93
94         /** \brief Create uninitialized socket variable
95
96             This special constructor is called when passing
97             ProtocolServerSocketHandle::Uninitialized as only argument to the constructor. This will
98             create an in-\ref valid() socket handle which can however be assigned later with another
99             socket instance.
100
101             \implementation The socket handle will have no \c body allocated.
102          */
103         ProtocolServerSocketHandle(senf::NoInit_t);
104         //\}
105         //-////////////////////////////////////////////////////////////////////////
106
107         Protocol & protocol();          ///< Access the protocol interface
108                                         /**< The returned protocol class reference gives access to
109                                            the complete protocol interface as defined by that
110                                            class. See the respective protocol class documentation.
111                                            \returns \a Protocol class reference */
112
113         ProtocolClientSocketHandle<SocketProtocol> accept();
114
115         static ProtocolServerSocketHandle cast_static(FileHandle handle);
116         static ProtocolServerSocketHandle cast_dynamic(FileHandle handle);
117
118         void state(SocketStateMap & map, unsigned lod=0);
119         std::string dumpState(unsigned lod=0);
120
121     protected:
122         ProtocolServerSocketHandle(FileHandle other, bool isChecked);
123
124     private:
125
126     };
127
128     //\}
129 }
130
131 //-/////////////////////////////////////////////////////////////////////////////////////////////////
132 //#include "ProtocolServerSocketHandle.cci"
133 //#include "ProtocolServerSocketHandle.ct"
134 #include "ProtocolServerSocketHandle.cti"
135 #endif
136
137 \f
138 // Local Variables:
139 // mode: c++
140 // fill-column: 100
141 // c-file-style: "senf"
142 // indent-tabs-mode: nil
143 // ispell-local-dictionary: "american"
144 // compile-command: "scons -u test"
145 // comment-column: 40
146 // End: