X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FSocketWriter.hh;h=f2f861106d76ae45d2a7305bc5f7399584a0384f;hb=81ffa1c459b96dd44472bcef37e1e373934ee138;hp=b25079887720ee8334544ab66d0b273b9180b247;hpb=0c6e42841266e5983ef9a9836b8f1bb98de684ba;p=senf.git diff --git a/PPI/SocketWriter.hh b/PPI/SocketWriter.hh index b250798..f2f8611 100644 --- a/PPI/SocketWriter.hh +++ b/PPI/SocketWriter.hh @@ -25,9 +25,14 @@ #define HH_SocketWriter_ 1 // Custom includes -#include "Packets/Packet.hh" +#include "Packets/Packets.hh" +#include "Socket/ClientSocketHandle.hh" +#include "Socket/SocketPolicy.hh" +#include "Socket/ReadWritePolicy.hh" +#include "Socket/FramingPolicy.hh" +#include "Socket/CommunicationPolicy.hh" #include "Module.hh" -#include "Connector.hh" +#include "Connectors.hh" //#include "SocketWriter.mpp" ///////////////////////////////hh.p//////////////////////////////////////// @@ -37,17 +42,18 @@ namespace ppi { /** \brief Write helper for module::ActiveSocketWriter / module::PassiveSocketWriter - This write helper will write the packets completely as datagrmas to the given socket. + This write helper will write the packets completely as datagrams to the given socket. */ class PacketWriter { public: typedef senf::ClientSocketHandle< senf::MakeSocketPolicy< senf::WriteablePolicy, - senf::DatagramFramingPolicy > > Handle; + senf::DatagramFramingPolicy, + senf::ConnectedCommunicationPolicy>::policy > Handle; ///< Handle type supported by this writer - void operator()(Handle handle, Packet::ptr packet); + void operator()(Handle handle, Packet packet); ///< Write \a packet to \a handle /**< Write the complete \a packet as a datagram to \a handle. @@ -74,7 +80,7 @@ namespace module { public: typedef unspecified Handle; // type of handle requested SomeWriter(); // default constructible - void operator()(Handle handle, Packet::ptr packet); // insertion function + void operator()(Handle handle, Packet packet); // insertion function }; \endcode */ @@ -82,7 +88,7 @@ namespace module { class ActiveSocketWriter : public Module { public: - typedef typename Writer:Handle Handle; ///< Handle type requested by writer + typedef typename Writer::Handle Handle; ///< Handle type requested by writer connector::ActiveInput input; ///< Input connector from which data is received @@ -106,7 +112,7 @@ namespace module { public: typedef unspecified Handle; // type of handle requested SomeWriter(); // default constructible - void operator()(Handle handle, Packet::ptr packet); // insertion function + void operator()(Handle handle, Packet packet); // insertion function }; \endcode */ @@ -114,21 +120,27 @@ namespace module { class PassiveSocketWriter : public Module { public: - typedef typename Writer:Handle Handle; ///< Handle type requested by writer + typedef typename Writer::Handle Handle; ///< Handle type requested by writer connector::PassiveInput input; ///< Input connector from which data is received - ActiveSocketWriter(Handle handle); ///< Create new writer for the given handle + PassiveSocketWriter(Handle handle); ///< Create new writer for the given handle /**< Data will be written to \a handle using \a Writer. \param[in] handle Handle to write data to */ + + private: + void write(); + + Handle handle_; + Writer writer_; }; }}} ///////////////////////////////hh.e//////////////////////////////////////// -//#include "SocketWriter.cci" -//#include "SocketWriter.ct" +#include "SocketWriter.cci" +#include "SocketWriter.ct" //#include "SocketWriter.cti" #endif @@ -139,4 +151,6 @@ namespace module { // c-file-style: "senf" // indent-tabs-mode: nil // ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 // End: