diff options
author | Mike Buland <eichlan@xagasoft.com> | 2011-06-08 05:37:45 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2011-06-08 05:37:45 +0000 |
commit | 5f2c95f9116f24ecd64b6361b6e22ce983732997 (patch) | |
tree | fb27ff3927d1843b759d99506e2e3a03c88d0ab8 /src/buffer.h | |
parent | 6fcf117c7543a6adec19a6afea0da7df087170ab (diff) | |
download | libbu++-5f2c95f9116f24ecd64b6361b6e22ce983732997.tar.gz libbu++-5f2c95f9116f24ecd64b6361b6e22ce983732997.tar.bz2 libbu++-5f2c95f9116f24ecd64b6361b6e22ce983732997.tar.xz libbu++-5f2c95f9116f24ecd64b6361b6e22ce983732997.zip |
Hopefully nobody was using the buffer size parameter, if so, it's moved.
Buffer now takes an extra parameter: what to buffer, read, write, or both.
This winds up being important when dealing with blocking sockets and the like.
Diffstat (limited to 'src/buffer.h')
-rw-r--r-- | src/buffer.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/buffer.h b/src/buffer.h index 17c6d73..91ec9c2 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
@@ -15,9 +15,16 @@ namespace Bu | |||
15 | class Buffer : public Bu::Filter | 15 | class Buffer : public Bu::Filter |
16 | { | 16 | { |
17 | public: | 17 | public: |
18 | Buffer( Bu::Stream &rNext, int iBufSize=4096 ); | 18 | Buffer( Bu::Stream &rNext, int iWhat=Both, int iBufSize=4096 ); |
19 | virtual ~Buffer(); | 19 | virtual ~Buffer(); |
20 | 20 | ||
21 | enum | ||
22 | { | ||
23 | Write = 1, | ||
24 | Read = 2, | ||
25 | Both = 3 | ||
26 | }; | ||
27 | |||
21 | virtual void start(); | 28 | virtual void start(); |
22 | virtual Bu::size stop(); | 29 | virtual Bu::size stop(); |
23 | 30 | ||
@@ -44,6 +51,7 @@ namespace Bu | |||
44 | int iReadPos; | 51 | int iReadPos; |
45 | int iWriteBufFill; | 52 | int iWriteBufFill; |
46 | int iWritePos; | 53 | int iWritePos; |
54 | int iWhat; | ||
47 | }; | 55 | }; |
48 | }; | 56 | }; |
49 | 57 | ||