From 597a1487c716b799428f4b4a4903e65df4c93ba9 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 15 Sep 2008 20:03:56 +0000 Subject: Whoa! Loads of NIDS work. It actually compiles, runs, and I'm optimizing the hell out of it. Good times, everyone. This is a major chunk for congo, and the new optimizations should be good. --- src/nidsstream.h | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'src/nidsstream.h') diff --git a/src/nidsstream.h b/src/nidsstream.h index 08b45eb..8021dee 100644 --- a/src/nidsstream.h +++ b/src/nidsstream.h @@ -2,16 +2,46 @@ #define BU_NIDS_STREAM_H #include "bu/stream.h" +#include "bu/nids.h" namespace Bu { class NidsStream : public Bu::Stream { + friend class Nids; + private: + /** + * These can only be created by the Nids class. + */ + NidsStream( Nids &rNids ); + NidsStream( const NidsStream &rSrc ); + public: - NidsStream(); virtual ~NidsStream(); + virtual void close(); + virtual size_t read( void *pBuf, size_t nBytes ); + virtual size_t write( const void *pBuf, size_t nBytes ); + using Stream::write; + virtual long tell(); + virtual void seek( long offset ); + virtual void setPos( long pos ); + virtual void setPosEnd( long pos ); + virtual bool isEOS(); + virtual bool isOpen(); + virtual void flush(); + virtual bool canRead(); + virtual bool canWrite(); + virtual bool isReadable(); + virtual bool isWritable(); + virtual bool isSeekable(); + virtual bool isBlocking(); + virtual void setBlocking( bool bBlocking=true ); + private: + Nids &rNids; + typedef struct Bu::Hash BlockHash; + BlockHash hBlock; }; }; -- cgit v1.2.3