From 9cb57f9ccd5a2f0be829224fb057f86b1e9db981 Mon Sep 17 00:00:00 2001 From: Nicolay Korslund Date: Tue, 29 Dec 2009 16:40:02 +0100 Subject: [PATCH] Added boost/shared_ptr to memory_stream for future testing --- stream/servers/memory_stream.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/stream/servers/memory_stream.h b/stream/servers/memory_stream.h index 5bceb6bbd..f6e878dd1 100644 --- a/stream/servers/memory_stream.h +++ b/stream/servers/memory_stream.h @@ -3,10 +3,16 @@ #include #include "../stream.h" +#include namespace Mangle { namespace Stream { +// Do this before the class declaration, since the class itself +// depends on it +class MemoryStream; +typedef boost::shared_ptr MemoryStreamPtr; + /** A Stream wrapping a memory buffer This will create a fully seekable stream out any pointer/length @@ -67,9 +73,9 @@ class MemoryStream : public Stream No memory is copied during this operation, the new stream is just another 'view' into the same shared memory buffer. */ - MemoryStream *clone(bool setPos=false) const + MemoryStreamPtr clone(bool setPos=false) const { - MemoryStream *res = new MemoryStream(data, length); + MemoryStreamPtr res = new MemoryStream(data, length); if(setPos) res->seek(pos); return res; }