PPI: Add DgramReader MaxSize template argument
g0dil [Tue, 21 Jul 2009 15:07:44 +0000 (15:07 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1275 270642c3-0616-0410-b53a-bc976706d245

PPI/SocketSource.ct
PPI/SocketSource.hh

index e225661..bc60d29 100644 (file)
 ///////////////////////////////ct.p////////////////////////////////////////
 
 ///////////////////////////////////////////////////////////////////////////
-// senf::ppi::DgramReader<Packet>
+// senf::ppi::DgramReader<Packet,MaxSize>
 
-template <class Packet>
-prefix_ Packet senf::ppi::DgramReader<Packet>::operator()(Handle handle)
+template <class Packet, unsigned MaxSize>
+prefix_ Packet senf::ppi::DgramReader<Packet,MaxSize>::operator()(Handle handle)
 {
     Packet packet (Packet::create(senf::noinit));
-    handle.read(packet.data(),0u);
+    handle.read(packet.data(),MaxSize);
     return packet;
 }
 
index 3c78d58..ceb5bc8 100644 (file)
@@ -49,7 +49,7 @@ namespace ppi {
         defaults to DataPacket (type DataPacketType), which will place the data uninterpreted 
         into a packet data structure.
      */
-    template <class Packet=DataPacket>
+    template <class Packet=DataPacket, unsigned MaxSize=0u>
     class DgramReader
     {
     public: