aboutsummaryrefslogtreecommitdiff
path: root/src/conduit.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/conduit.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/conduit.h b/src/conduit.h
index cc88667..72b8d52 100644
--- a/src/conduit.h
+++ b/src/conduit.h
@@ -10,6 +10,9 @@
10 10
11#include "bu/stream.h" 11#include "bu/stream.h"
12#include "bu/string.h" 12#include "bu/string.h"
13#include "bu/queuebuf.h"
14#include "bu/itomutex.h"
15#include "bu/itocondition.h"
13 16
14namespace Bu 17namespace Bu
15{ 18{
@@ -20,6 +23,41 @@ namespace Bu
20 */ 23 */
21 class Conduit : public Stream 24 class Conduit : public Stream
22 { 25 {
26 public:
27 Conduit( int iBlockSize=256 );
28 virtual ~Conduit();
29
30 virtual void close();
31 virtual Bu::size read( void *pBuf, Bu::size nBytes );
32 virtual Bu::size peek( void *pBuf, Bu::size nBytes );
33 virtual Bu::size peek( void *pBuf, Bu::size nBytes, Bu::size nSkip );
34 virtual Bu::size write( const void *pBuf, Bu::size nBytes );
35 virtual Bu::size tell();
36 virtual void seek( Bu::size offset );
37 virtual void setPos( Bu::size pos );
38 virtual void setPosEnd( Bu::size pos );
39 virtual bool isEos();
40 virtual bool isOpen();
41 virtual void flush();
42 virtual bool canRead();
43 virtual bool canWrite();
44 virtual bool isReadable();
45 virtual bool isWritable();
46 virtual bool isSeekable();
47 virtual bool isBlocking();
48 virtual void setBlocking( bool bBlocking=true );
49 virtual void setSize( Bu::size iSize );
50
51 virtual size getSize() const;
52 virtual size getBlockSize() const;
53 virtual Bu::String getLocation() const;
54
55 private:
56 QueueBuf qb;
57 mutable ItoMutex im;
58 ItoCondition cBlock;
59 bool bBlocking;
60 bool bOpen;
23 }; 61 };
24} 62}
25 63