From f2840f6b8f06b392ccdb55c9a0cb3ba070bb9bbb Mon Sep 17 00:00:00 2001 From: g0dil <g0dil@wiback.org> Date: Tue, 21 Jul 2009 15:07:44 +0000 Subject: [PATCH] PPI: Add DgramReader MaxSize template argument --- PPI/SocketSource.ct | 8 ++++---- PPI/SocketSource.hh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PPI/SocketSource.ct b/PPI/SocketSource.ct index e2256615..bc60d299 100644 --- a/PPI/SocketSource.ct +++ b/PPI/SocketSource.ct @@ -31,13 +31,13 @@ ///////////////////////////////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; } diff --git a/PPI/SocketSource.hh b/PPI/SocketSource.hh index 3c78d585..ceb5bc83 100644 --- a/PPI/SocketSource.hh +++ b/PPI/SocketSource.hh @@ -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: -- GitLab