PPI: Remove specializations from documentation
[senf.git] / PPI / DebugModules.hh
1 // $Id$
2 //
3 // Copyright (C) 2007 
4 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
5 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
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 DebugModules public header */
25
26 #ifndef HH_DebugModules_
27 #define HH_DebugModules_ 1
28
29 // Custom includes
30 #include <deque>
31 #include "Utils/SafeBool.hh"
32 #include "Packets/Packets.hh"
33 #include "Module.hh"
34
35 //#include "DebugModules.mpp"
36 ///////////////////////////////hh.p////////////////////////////////////////
37
38 /** \namespace senf::ppi::module::debug
39     \brief Debug modules
40
41     This namespace collects several modules helpful for PPI debugging. The modules allow to manually
42     pass packets into a network and read back the output packets.
43
44     
45  */
46
47 namespace senf {
48 namespace ppi {
49 namespace module {
50 namespace debug {
51     
52     /** \brief
53      */
54     class ActivePacketSource
55         : public Module, 
56           public SafeBool<ActivePacketSource>
57     {
58         SENF_PPI_MODULE(ActivePacketSource);
59
60     public:
61         connector::ActiveOutput output;
62
63         ActivePacketSource();
64
65         void submit(Packet packet);
66
67         bool boolean_test() const;
68     };
69
70     class PassivePacketSource
71         : public Module
72     {
73         SENF_PPI_MODULE(PassivePacketSource);
74
75         typedef std::deque<Packet> Queue;
76
77     public:
78         typedef Queue::size_type size_type;
79         
80         PassivePacketSource();
81         
82         connector::PassiveOutput output;
83         
84         void submit(Packet packet);
85
86         bool empty();
87         size_type size();
88
89     private:
90         void request();
91         void init();
92         
93         Queue packets_;
94     };
95
96     class ActivePacketSink
97         : public Module,
98           public SafeBool<ActivePacketSink>
99     {
100         SENF_PPI_MODULE(ActivePacketSink);
101
102     public:
103         connector::ActiveInput input;
104
105         ActivePacketSink();
106
107         Packet request();
108
109         bool boolean_test() const;
110     };
111
112     class PassivePacketSink
113         : public Module
114     {
115         SENF_PPI_MODULE(PassivePacketSink);
116
117         typedef std::deque<Packet> Queue;
118
119     public:
120         typedef Queue::size_type size_type;
121         typedef Queue::const_iterator iterator;
122
123         connector::PassiveInput input;
124         
125         PassivePacketSink();
126
127         bool empty();
128         size_type size();
129         iterator begin();
130         iterator end();
131
132         Packet front();
133         Packet pop_front();
134
135         void clear();
136
137     private:
138         void request();
139         
140         Queue packets_;
141     };
142
143 }}}}
144
145 ///////////////////////////////hh.e////////////////////////////////////////
146 #include "DebugModules.cci"
147 //#include "DebugModules.ct"
148 //#include "DebugModules.cti"
149 #endif
150
151 \f
152 // Local Variables:
153 // mode: c++
154 // fill-column: 100
155 // comment-column: 40
156 // c-file-style: "senf"
157 // indent-tabs-mode: nil
158 // ispell-local-dictionary: "american"
159 // compile-command: "scons -u test"
160 // End: