Fix documentation build under maverick (doxygen 1.7.1)
[senf.git] / senf / Socket / Protocols / DVB / DVBDemuxHandles.hh
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 //     Thorsten Horstmann <tho@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 DVBDemuxHandles public header */
25
26 #ifndef HH_SENF_Socket_Protocols_DVB_DVBDemuxHandles_
27 #define HH_SENF_Socket_Protocols_DVB_DVBDemuxHandles_ 1
28
29 // Custom includes
30 #include <senf/Socket/FramingPolicy.hh>
31 #include <senf/Socket/CommunicationPolicy.hh>
32 #include <senf/Socket/ReadWritePolicy.hh>
33 #include <senf/Socket/ProtocolClientSocketHandle.hh>
34 #include "DVBDemuxSocketProtocol.hh"
35
36 //#include "DVBDemuxHandles.mpp"
37 #include <boost/enable_shared_from_this.hpp>
38 #include <boost/shared_ptr.hpp>
39 #include <iostream>
40 //-/////////////////////////////////////////////////////////////////////////////////////////////////
41
42 namespace senf {
43
44     /// \addtogroup concrete_protocol_group
45     //\{
46
47     typedef MakeSocketPolicy<
48         NoAddressingPolicy,
49         DatagramFramingPolicy,
50         UnconnectedCommunicationPolicy,
51         ReadablePolicy,
52         NotWriteablePolicy
53         >::policy DVBDemux_Policy;   ///< Socket Policy for xxxx
54
55     /** \brief Baseclass of various DVBProtocolWrappers which are defined in DVBProtocolWrapper.hh
56      */
57     class DVBProtocolWrapper :public boost::enable_shared_from_this<DVBProtocolWrapper> {
58         public:
59             DVBProtocolWrapper() {}
60             virtual ~DVBProtocolWrapper() {}
61     };
62     /** \brief Baseclass for DVBSocketProtocols which want use Wrappers for console.
63     */
64     class DVBSocketProtocol : public virtual SocketProtocol {
65 private:
66         boost::shared_ptr<DVBProtocolWrapper> wrap_;
67 public:
68         DVBSocketProtocol() {}
69         ~DVBSocketProtocol() {}
70
71         void addWrapper(boost::shared_ptr<DVBProtocolWrapper> wrap)/**< Binds a wrapper to a DVBProtocol,
72                                                                         so if it is closed the functionality of the wrapper is automatically removed from console.*/
73         {
74             wrap_ = wrap;
75         }
76         virtual void close()
77         {
78             wrap_.reset();
79             SocketProtocol::close();
80
81         }
82     };
83
84
85     class DVBDemuxSectionSocketProtocol
86         : public ConcreteSocketProtocol<DVBDemux_Policy, DVBDemuxSectionSocketProtocol>,
87           public DVBDemuxSocketProtocol,
88           public DVBSocketProtocol
89     {
90
91     public:
92         //-////////////////////////////////////////////////////////////////////////
93         // internal interface
94
95         ///\name Constructors
96         //\{
97
98         void init_client(unsigned short adapter=0, unsigned short device=0) const;       ///< xxx
99                                         /**< \note This member is implicitly called from the
100                                              ProtocolClientSocketHandle::ProtocolClientSocketHandle()
101                                              constructor */
102
103         //\}
104         ///\name Abstract Interface Implementation
105         //\{
106
107         unsigned available() const;
108
109         //\}
110
111         void setSectionFilter(unsigned short int pid,
112                 unsigned char filter= 0x3e,
113                 unsigned int flags= DMX_IMMEDIATE_START | DMX_CHECK_CRC,
114                 unsigned char mask = 0xff,
115                 unsigned char mode =0x00,
116                 unsigned int timeout =0x00) const;
117
118     };
119
120     typedef ProtocolClientSocketHandle<DVBDemuxSectionSocketProtocol> DVBDemuxSectionHandle;
121
122     // ----------------------------------------------------------------
123
124     /** \brief xxx
125      */
126     class DVBDemuxPESSocketProtocol
127         : public ConcreteSocketProtocol<DVBDemux_Policy,DVBDemuxPESSocketProtocol>,
128           public DVBDemuxSocketProtocol,
129           public DVBSocketProtocol
130     {
131     public:
132         //-////////////////////////////////////////////////////////////////////////
133         // internal interface
134
135         ///\name Constructors
136         //\{
137
138         void init_client(unsigned short adapter=0, unsigned short device=0) const;       ///< xxx
139                                         /**< \note This member is implicitly called from the
140                                              ProtocolClientSocketHandle::ProtocolClientSocketHandle()
141                                              constructor */
142
143         //\}
144         ///\name Abstract Interface Implementation
145         //\{
146
147         unsigned available() const;
148
149         //\}
150
151         void setPESFilter(unsigned short int pid, dmx_input_t input, dmx_output_t output, dmx_pes_type_t pesType, unsigned int flags)const;
152     };
153
154     typedef ProtocolClientSocketHandle<DVBDemuxPESSocketProtocol> DVBDemuxPESHandle;
155
156
157     // ----------------------------------------------------------------
158
159
160     /** \brief xxx
161          */
162     class DVBDvrSocketProtocol
163         : public ConcreteSocketProtocol<DVBDemux_Policy, DVBDvrSocketProtocol>,
164           public DVBDemuxSocketProtocol
165     {
166     public:
167         //-////////////////////////////////////////////////////////////////////////
168         // internal interface
169
170         ///\name Constructors
171         //\{
172
173         void init_client(unsigned short adapter=0, unsigned short device=0) const;       ///< xxx
174                                         /**< \note This member is implicitly called from the
175                                              ProtocolClientSocketHandle::ProtocolClientSocketHandle()
176                                              constructor */
177
178         //\}
179         ///\name Abstract Interface Implementation
180         //\{
181
182         unsigned available() const;
183
184         //\}
185      };
186
187      typedef ProtocolClientSocketHandle<DVBDvrSocketProtocol> DVBDvrHandle;
188
189     //\}
190
191 }
192
193 //-/////////////////////////////////////////////////////////////////////////////////////////////////
194 //#include "DVBDemuxHandles.cci"
195 //#include "DVBDemuxHandles.ct"
196 //#include "DVBDemuxHandles.cti"
197 #endif
198
199 \f
200 // Local Variables:
201 // mode: c++
202 // fill-column: 100
203 // c-file-style: "senf"
204 // indent-tabs-mode: nil
205 // ispell-local-dictionary: "american"
206 // compile-command: "scons -u test"
207 // comment-column: 40
208 // End: