X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FMainpage.dox;h=5d5d59d79d815082a3ae71c21efab7c01afd3180;hb=2913eecdc2ee7a52ced3e8bfb256a58b9ac6510a;hp=0d47e2d3d5f65d8786482f11713ef1d68f991e60;hpb=217dd10cd636d614ee110f0be293d5d5b5fa646d;p=senf.git
diff --git a/PPI/Mainpage.dox b/PPI/Mainpage.dox
index 0d47e2d..5d5d59d 100644
--- a/PPI/Mainpage.dox
+++ b/PPI/Mainpage.dox
@@ -70,10 +70,10 @@
(network connection, writing packets to disk, generating new packets) whereas processing modules
process packets internally. In the target scenario, TAP, ASI Out, Raw
Socket and in a limited way Generator are I/O modules whereas PEP,
- DiffServ, DVB Enc, GRE/UDLR, TCP Filter and
- Stufferare processing modules. ASI/MPEG and Net are external I/O
- ports which are integrated via the TAP, ASI Out and Raw Sock modules
- using external events.
+ DiffServ, DVB Enc, GRE/UDLR, TCP Filter and Stuffer
+ are processing modules. ASI/MPEG and Net are external I/O ports which are
+ integrated via the TAP, ASI Out and Raw Sock modules using external
+ events.
The following example module declares three I/O connectors (see below): payload,
stuffing and output. These connectors are defined as public data
@@ -83,18 +83,20 @@
class RateStuffer
: public senf::ppi::Module
{
+ senf::ppi::IntervalTimer timer_;
+
public:
- ActiveInput payload;
- ActiveInput stuffing;
- ActiveOutput output;
+ senf::ppi::ActiveInput payload;
+ senf::ppi::ActiveInput stuffing;
+ senf::ppi::ActiveOutput output;
RateStuffer(unsigned packetsPerSecond)
+ : timer_(1000u, packetsPerSecond)
{
route(payload, output);
route(stuffing, output);
- registerEvent(&RateStuffer::tick,
- senf::ppi::IntervalTimer(1000u, packetsPerSecond));
+ registerEvent(&RateStuffer::tick, timer_);
}
private:
@@ -124,7 +126,7 @@
: public senf::ppi::Module
{
public:
- PassiveOutput output;
+ senf::ppi::PassiveOutput output;
CopyPacketGenerator(Packet::ptr template)
: template_ (template)
@@ -244,14 +246,17 @@
class ActiveSocketInput
: public senf::ppi::Module
{
- static PacketParser defaultParser_;
-
- public:
- ActiveOutput output;
-
typedef senf::ClientSocketHandle<
senf::MakeSocketPolicy< senf::ReadablePolicy,
senf::DatagramFramingPolicy > > Socket;
+ static PacketParser defaultParser_;
+
+ Socket socket_;
+ DataParser const & parser_;
+ senf::ppi:IOSignaler event_;
+
+ public:
+ senf::ppi::ActiveOutput output;
// I hestitate taking parser by const & since a const & can be bound to
// a temporary even though a const & is all we need. The real implementation
@@ -260,16 +265,13 @@
ActiveSocketInput(Socket socket, DataParser & parser = SocketInput::defaultParser_)
: socket_ (socket),
parser_ (parser)
- event_ (registerEvent( &ActiveSocketInput::data,
- senf::ppi::IOSignaler(socket, senf::ppi::IOSignaler::Read) ))
+ event_ (socket, senf::ppi::IOSignaler::Read)
{
+ registerEvent( &ActiveSocketInput::data, event_ );
route(event_, output);
}
private:
- Socket socket_;
- DataParser const & parser_;
- senf::ppi:IOSignaler::EventBinding event_;
void data()
{
@@ -297,7 +299,8 @@
\li Exception handling. It would be great to have a sane default exception handling freeing us
from most manual work. However, I don't think this is feasible.
- \see \ref ppi_implementation
+ \see \ref ppi_implementation \n
+ Implementation plan
*/
/** \page ppi_implementation Implementation Overview