PPI: Checkin of first compiling (yet not working) version
[senf.git] / PPI / SocketReader.hh
index 6a57f1b..723daef 100644 (file)
 #define HH_SocketReader_ 1
 
 // Custom includes
-#include "Packets/Packet.hh"
-#include "Packets/DataPacket.hh"
+#include "Packets/Packets.hh"
+#include "Socket/ClientSocketHandle.hh"
+#include "Socket/SocketPolicy.hh"
+#include "Socket/ReadWritePolicy.hh"
+#include "Socket/FramingPolicy.hh"
 #include "Module.hh"
-#include "Connector.hh"
+#include "Connectors.hh"
+#include "IOEvent.hh"
 
 //#include "SocketReader.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
@@ -49,10 +53,10 @@ namespace ppi {
     public:
         typedef senf::ClientSocketHandle<
             senf::MakeSocketPolicy< senf::ReadablePolicy,
-                                    senf::DatagramFramingPolicy > > Handle;
+                                    senf::DatagramFramingPolicy >::policy > Handle;
                                         ///< Handle type supported by this reader
 
-        Packet::ptr operator()(Handle handle);
+        Packet operator()(Handle handle);
                                         ///< Read packet from \a handle
                                         /**< Read a datagram from \a handle and interpret is as
                                              packet of type \c Packet.
@@ -77,7 +81,7 @@ namespace module {
           class SomeReader
           {
           public:
-              typedef unspecified_type Handle;        // type of handle reqeusted
+              typedef unspecified_type Handle;        // type of handle requested
               SomeReader();                           // default constructible
               Packet::ptr operator()(Handle handle);  // extraction function
           };
@@ -89,19 +93,26 @@ namespace module {
     public:
         typedef typename Reader::Handle Handle; ///< Handle type requested by the reader
 
-        connector::ActiveOutput output; ///< Output connector to which the data recevied is writtten
+        connector::ActiveOutput output; ///< Output connector to which the data received is written
         
         ActiveSocketReader(Handle handle); ///< Create new reader for the given handle
                                         /**< Data will be read from \a handle and be parsed by \a
                                              Reader.
                                              \param[in] handle Handle to read data from */
+
+    private:
+        void read();
+        
+        Handle handle_;
+        IOEvent event_;
+        Reader reader_;
     };
 
 }}}
 
 ///////////////////////////////hh.e////////////////////////////////////////
 //#include "SocketReader.cci"
-//#include "SocketReader.ct"
+#include "SocketReader.ct"
 //#include "SocketReader.cti"
 #endif
 
@@ -112,4 +123,6 @@ namespace module {
 // c-file-style: "senf"
 // indent-tabs-mode: nil
 // ispell-local-dictionary: "american"
+// compile-command: "scons -u test"
+// comment-column: 40
 // End: