Fix documentation build under maverick (doxygen 1.7.1)
[senf.git] / senf / PPI / SocketSink.ct
1 // $Id$
2 //
3 // Copyright (C) 2007
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 SocketSink non-inline template implementation  */
25
26 //#include "SocketSink.ih"
27
28 // Custom includes
29
30 #define prefix_
31 //-/////////////////////////////////////////////////////////////////////////////////////////////////
32
33 //-/////////////////////////////////////////////////////////////////////////////////////////////////
34 // senf::ppi::module::ActiveSocketSink<Writer>
35
36 template <class Writer>
37 prefix_ senf::ppi::module::ActiveSocketSink<Writer>::ActiveSocketSink()
38 {
39     registerEvent( event_, &ActiveSocketSink::write );
40     route(input, event_);
41 }
42
43 template <class Writer>
44 prefix_ senf::ppi::module::ActiveSocketSink<Writer>::ActiveSocketSink(Writer const & writer)
45     : writer_ (writer)
46 {
47     registerEvent( event_, &ActiveSocketSink::write );
48     route(input, event_);
49 }
50
51 template <class Writer>
52 prefix_ senf::ppi::module::ActiveSocketSink<Writer>::ActiveSocketSink(Handle const &  handle)
53     : handle_(handle), event_(handle_, IOEvent::Write), writer_()
54 {
55     registerEvent( event_, &ActiveSocketSink::write );
56     route(input, event_);
57 }
58
59 template <class Writer>
60 prefix_ senf::ppi::module::ActiveSocketSink<Writer>::ActiveSocketSink(Handle const & handle,
61                                                                     Writer const & writer)
62     : handle_(handle), event_(handle_, IOEvent::Write), writer_(writer)
63 {
64     registerEvent( event_, &ActiveSocketSink::write );
65     route(input, event_);
66 }
67
68 //-/////////////////////////////////////////////////////////////////////////////////////////////////
69 // private members
70
71 template <class Writer>
72 prefix_ void senf::ppi::module::ActiveSocketSink<Writer>::write()
73 {
74     writer_(handle_,input());
75 }
76
77 //-/////////////////////////////////////////////////////////////////////////////////////////////////
78 // senf::ppi::module::PassiveSocketSink<Writer>
79
80 template <class Writer>
81 prefix_ senf::ppi::module::PassiveSocketSink<Writer>::PassiveSocketSink()
82 {
83     noroute(input);
84     input.onRequest(&PassiveSocketSink::write);
85     checkThrottle();
86 }
87
88 template <class Writer>
89 prefix_ senf::ppi::module::PassiveSocketSink<Writer>::PassiveSocketSink(Writer const & writer)
90     : writer_ (writer)
91 {
92     noroute(input);
93     input.onRequest(&PassiveSocketSink::write);
94     checkThrottle();
95 }
96
97 template <class Writer>
98 prefix_ senf::ppi::module::PassiveSocketSink<Writer>::PassiveSocketSink(Handle const & handle)
99     : handle_(handle), writer_()
100 {
101     noroute(input);
102     input.onRequest(&PassiveSocketSink::write);
103     checkThrottle();
104 }
105
106 template <class Writer>
107 prefix_ senf::ppi::module::PassiveSocketSink<Writer>::PassiveSocketSink(Handle const & handle,
108                                                                       Writer const & writer)
109     : handle_(handle), writer_(writer)
110 {
111     noroute(input);
112     input.onRequest(&PassiveSocketSink::write);
113     checkThrottle();
114 }
115
116 //-/////////////////////////////////////////////////////////////////////////////////////////////////
117 // private members
118
119 template <class Writer>
120 prefix_ void senf::ppi::module::PassiveSocketSink<Writer>::write()
121 {
122     writer_(handle_,input());
123 }
124
125 template <class Writer>
126 prefix_ void senf::ppi::module::PassiveSocketSink<Writer>::checkThrottle()
127 {
128     if (handle_.valid())
129         input.unthrottle();
130     else
131         input.throttle();
132 }
133
134 //-/////////////////////////////////////////////////////////////////////////////////////////////////
135 #undef prefix_
136
137 \f
138 // Local Variables:
139 // mode: c++
140 // fill-column: 100
141 // comment-column: 40
142 // c-file-style: "senf"
143 // indent-tabs-mode: nil
144 // ispell-local-dictionary: "american"
145 // compile-command: "scons -u test"
146 // End: