X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPPI%2FSocketSource.hh;h=c41e314dc6e3e31cc31f3b8d82b1e3e79c6fcfd0;hb=ff4249b4a9c23236b2e56dcd593c91a5c58f7b75;hp=7c06aff6b329888397166195e8a15d522c1071bc;hpb=9d13f0ba899d246a930acbe0d06ba00a962a2de6;p=senf.git diff --git a/senf/PPI/SocketSource.hh b/senf/PPI/SocketSource.hh index 7c06aff..c41e314 100644 --- a/senf/PPI/SocketSource.hh +++ b/senf/PPI/SocketSource.hh @@ -139,16 +139,48 @@ namespace module { void handle(Handle handle); ///< Set handle /**< Assigning an empty or in-valid() handle will disable the module until a new, valid handle is assigned. */ - - bool enabled(); ///< Check is the IOEvent of the Source is enabled - void enabled( bool state); ///< Change the state of the Source's IOEvent - private: + Handle handle_; + IOEvent event_; + Reader reader_; + void read(); + }; + + + template > + class ActiveBurstSocketSource + : public Module + { + SENF_PPI_MODULE(ActiveBurstSocketSource); + + public: + typedef typename Reader::Handle Handle; ///< Handle type requested by the reader + connector::ActiveOutput output; + ///< Output connector to which the data received is written + + ActiveBurstSocketSource(unsigned max_burst); + explicit ActiveBurstSocketSource(Reader reader, unsigned max_burst); + explicit ActiveBurstSocketSource(Handle handle, unsigned max_burst); + ActiveBurstSocketSource(Handle handle, Reader reader, unsigned max_burst); + + Reader & reader(); ///< Access Reader helper + Handle handle(); ///< Access handle + void handle(Handle handle); ///< Set handle + /**< Assigning an empty or in-valid() handle will disable + the module until a new, valid handle is assigned. */ + + unsigned maxBurst() const; + void maxBurst(unsigned max_burst); + + private: Handle handle_; IOEvent event_; Reader reader_; + unsigned maxBurst_; + + void read(); }; }}}