2009-12-19 07:26:01 +00:00
|
|
|
#ifndef MANGLE_STREAM_IWRAPPER_H
|
|
|
|
#define MANGLE_STREAM_IWRAPPER_H
|
|
|
|
|
2009-12-28 13:09:17 +00:00
|
|
|
#include "../stream.h"
|
2009-12-19 07:26:01 +00:00
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
namespace Mangle {
|
|
|
|
namespace Stream {
|
|
|
|
|
2009-12-28 13:09:17 +00:00
|
|
|
/** A generic wrapper class for a Stream::Stream object.
|
2009-12-19 07:26:01 +00:00
|
|
|
|
|
|
|
This is used by other implementations.
|
|
|
|
*/
|
2009-12-28 13:09:17 +00:00
|
|
|
class _SWrapper
|
2009-12-19 07:26:01 +00:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
bool autoDel;
|
|
|
|
|
|
|
|
protected:
|
2009-12-28 13:09:17 +00:00
|
|
|
Stream *inp;
|
2009-12-19 07:26:01 +00:00
|
|
|
|
|
|
|
public:
|
2009-12-28 13:09:17 +00:00
|
|
|
_SWrapper(Stream *_inp, bool _autoDel = false)
|
2009-12-19 07:26:01 +00:00
|
|
|
: inp(_inp), autoDel(_autoDel) { assert(inp != NULL); }
|
|
|
|
|
2009-12-28 13:09:17 +00:00
|
|
|
virtual ~_SWrapper() { if(autoDel) delete inp; }
|
2009-12-19 07:26:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}} // namespaces
|
|
|
|
#endif
|