summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchatty2000-11-28 17:07:44 +0000
committerchatty2000-11-28 17:07:44 +0000
commit79b01a9f6289424502115c88f1027d24587fc742 (patch)
tree91aaedcf6e383290f9c319bbd7b38406f829ef72
parent013f8cd1dfcb7d7291f7c0a1f973d27b9288a435 (diff)
downloadivy-league-79b01a9f6289424502115c88f1027d24587fc742.zip
ivy-league-79b01a9f6289424502115c88f1027d24587fc742.tar.gz
ivy-league-79b01a9f6289424502115c88f1027d24587fc742.tar.bz2
ivy-league-79b01a9f6289424502115c88f1027d24587fc742.tar.xz
* Created from bits of MsgStream.h
-rw-r--r--comm/BufStream.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/comm/BufStream.h b/comm/BufStream.h
new file mode 100644
index 0000000..a221bfa
--- /dev/null
+++ b/comm/BufStream.h
@@ -0,0 +1,62 @@
+/*
+ * The Unix Channel
+ *
+ * by Michel Beaudouin-Lafon
+ *
+ * Copyright 1990-1997
+ * Laboratoire de Recherche en Informatique (LRI)
+ *
+ * Buffered streams
+ *
+ * $Id$
+ * $CurLog$
+ */
+
+#ifndef BufStream_H_
+#define BufStream_H_
+
+#include "Stream.h"
+#include "MsgBuffer.h"
+
+class UchBufStream : public UchStream {
+protected:
+ UchMsgBuffer InBuffer;
+ UchMsgBuffer OutBuffer;
+ int OutSize;
+ bool Sync;
+
+ UchBufStream (const UchBufStream&);
+ int ReadInput ();
+ void HandleWrite ();
+
+ void WriteLong (lword);
+ void WriteShort (sword);
+ void WriteByte (byte);
+ void WriteChar (char);
+ void WriteString (const char*);
+ void WriteBuf (const byte*, int);
+
+
+ bool ReadLong (lword&);
+ bool ReadShort (sword&);
+ bool ReadByte (byte&);
+ bool ReadChar (char&);
+ int ReadString (char*, int);
+ int ReadString (CcuString&);
+ bool ReadBuf (byte*, int);
+
+public:
+ UchBufStream (UchAddress* = 0, UchAddress* = 0);
+ ~UchBufStream ();
+
+ void InputBuffer (int min, int grow, int max);
+ void OutputBuffer (int min, int grow, int max);
+inline bool GetSyncMode () { return Sync; }
+inline void SetSyncMode (bool s) { Sync = s; Flush (); }
+inline void FlushSize (int n) { OutSize = n; }
+virtual void Flush ();
+
+virtual void Closing (bool);
+};
+
+#endif /* BufStream_H_ */