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; }