From ee937667fd0ecd82faab4c88d756b906fb625f1a Mon Sep 17 00:00:00 2001 From: sc Date: Tue, 28 Nov 2000 17:07:47 +0000 Subject: Integration into IvyLeague Uvh -> Ivl Multiplexer.* is renamed into Scheduler.* A few name conflicts in the merger with ex-DNN have been solved Imakefile is replaced by Makefile Created InetAddress.* and UnixAddress.* from Address.* Created IrdaAddress.* OLD/TextStream has been updated --- comm/Channel.h | 55 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 26 deletions(-) (limited to 'comm/Channel.h') diff --git a/comm/Channel.h b/comm/Channel.h index 32271cf..1a9bd64 100644 --- a/comm/Channel.h +++ b/comm/Channel.h @@ -10,6 +10,11 @@ * * $Id$ * $CurLog$ + * Removed virtual IvlChannel::Copy () + * Removed virutal IvlChannel::HandleSelect () + * Smart(ies) removed by Stephane Sire + * Removed ReadHandler and WriteHandler + * NFILE -> 64, en attendant mieux */ #ifndef Channel_H_ @@ -20,11 +25,11 @@ #endif #include "cplus_bugs.h" -#include "ccu/bool.h" +#include "ivl/bool.h" #include "IOS.h" -class UchMsgBuffer; -class CcuString; +class IvlMsgBuffer; +class IvlString; // we need read and write system calls #include @@ -39,7 +44,7 @@ enum IOMODE { IONone = 0, IORead = 1, IOWrite = 2, extern char* StrReprBuf; -class UchFilDes { +class IvlFilDes { private: static void Use (int); static void Unuse (int); @@ -47,13 +52,13 @@ static void Unuse (int); protected: int Fd; public: -inline UchFilDes () : Fd (-1) { } -inline UchFilDes (const UchFilDes& fd) { Use (Fd = fd.Fd); } -inline UchFilDes (int fd) { Use (Fd = fd); } -inline ~UchFilDes () { Unuse (Fd); } +inline IvlFilDes () : Fd (-1) { } +inline IvlFilDes (const IvlFilDes& fd) { Use (Fd = fd.Fd); } +inline IvlFilDes (int fd) { Use (Fd = fd); } +inline ~IvlFilDes () { Unuse (Fd); } inline operator int () const { return Fd; } -inline UchFilDes& operator = (const UchFilDes& fd) { Unuse (Fd); Fd = fd.Fd; Use (Fd); return *this; } +inline IvlFilDes& operator = (const IvlFilDes& fd) { Unuse (Fd); Fd = fd.Fd; Use (Fd); return *this; } inline int FilDes () { return Fd; } inline void Open (int fd) { Unuse (Fd); Use (Fd = fd); } inline void Close () { Unuse (Fd); Fd = -1; } @@ -70,32 +75,31 @@ inline int Write (byte* b, int n) { return write (Fd, (const char*) b, n); } // potentially bypass immutability. // -class UchChannel : public UchIOS { -friend class UchBaseMultiplexer; +class IvlChannel : public IvlIOS { +friend class IvlBaseScheduler; protected: - UchFilDes Fd; + IvlFilDes Fd; IOMODE Mode; - UchBaseMultiplexer* Mpx; + IvlBaseScheduler* Mpx; virtual void Added (); virtual void Removed (); public: - UchChannel (); - UchChannel (int, IOMODE = IOReadWrite); - UchChannel (const UchChannel& ch); - ~UchChannel (); - + IvlChannel (); + IvlChannel (int, IOMODE = IOReadWrite); + IvlChannel (const IvlChannel& ch); + ~IvlChannel (); inline void Open (int fd) { if (Fd < 0) Fd.Open (fd); } inline void Close () { if (Fd.Opened ()) Fd.Close (); } inline IOMODE IOMode () const { return Mode; } inline void SetMode (IOMODE io) { Mode = io; } - int Read (UchMsgBuffer&); - int Write (UchMsgBuffer&); - bool ReadBuffer (UchMsgBuffer&); - bool WriteBuffer (UchMsgBuffer&); - void Add (UchBaseMultiplexer*); + int Read (IvlMsgBuffer&); + int Write (IvlMsgBuffer&); + bool ReadBuffer (IvlMsgBuffer&); + bool WriteBuffer (IvlMsgBuffer&); + void Add (IvlBaseScheduler*); void Remove (); virtual void HandleWrite (); virtual void HandleRead (); @@ -104,10 +108,9 @@ inline int FilDes () const { return Fd; } inline int Read (byte* b, int n) { return read (Fd, (char*) b, n); } inline int Write (const byte* b, int n) { return write (Fd, (const char*) b, n); } inline operator int () { return Fd; } -inline UchBaseMultiplexer* GetMultiplexer () const { return Mpx; } +inline IvlBaseScheduler* GetScheduler () const { return Mpx; } inline char* StrRepr (char* s = StrReprBuf) { return Fd.StrRepr (s); } - virtual void WriteLong (lword); virtual void WriteShort (sword); virtual void WriteByte (byte); @@ -120,7 +123,7 @@ virtual bool ReadShort (sword&); virtual bool ReadByte (byte&); virtual bool ReadChar (char&); virtual int ReadString (char*, int); -virtual int ReadString (CcuString&); +virtual int ReadString (IvlString&); virtual bool ReadBuf (byte*, int); }; -- cgit v1.1