From 2455534347596bd4ccf415c9cdf6d2e42a98fb72 Mon Sep 17 00:00:00 2001 From: sc Date: Mon, 4 Dec 2000 13:23:22 +0000 Subject: IvlFilDes -> IvlFd --- comm/Channel.h | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) (limited to 'comm/Channel.h') diff --git a/comm/Channel.h b/comm/Channel.h index 1a9bd64..01a395f 100644 --- a/comm/Channel.h +++ b/comm/Channel.h @@ -1,20 +1,17 @@ /* - * The Unix Channel + * Ivy League * - * by Michel Beaudouin-Lafon + * File descriptors, channels * - * Copyright 1990-1997 + * Copyright 1990-2000 * Laboratoire de Recherche en Informatique (LRI) + * Centre d'Etudes de la Navigation Aerienne (CENA) * - * File descriptors, channels + * original code by Michel Beaudouin-Lafon, + * heavily modified by Stephane Chatty and Stephane Sire * * $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_ @@ -44,7 +41,7 @@ enum IOMODE { IONone = 0, IORead = 1, IOWrite = 2, extern char* StrReprBuf; -class IvlFilDes { +class IvlFd { private: static void Use (int); static void Unuse (int); @@ -52,14 +49,13 @@ static void Unuse (int); protected: int Fd; public: -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 IvlFd () : Fd (-1) { } +inline IvlFd (const IvlFd& fd) { Use (Fd = fd.Fd); } +inline IvlFd (int fd) { Use (Fd = fd); } +inline ~IvlFd () { Unuse (Fd); } inline operator int () const { return Fd; } -inline IvlFilDes& operator = (const IvlFilDes& fd) { Unuse (Fd); Fd = fd.Fd; Use (Fd); return *this; } -inline int FilDes () { return Fd; } +inline IvlFd& operator = (const IvlFd& fd) { Unuse (Fd); Fd = fd.Fd; Use (Fd); return *this; } inline void Open (int fd) { Unuse (Fd); Use (Fd = fd); } inline void Close () { Unuse (Fd); Fd = -1; } inline bool Opened () { return bool (Fd >= 0); } @@ -78,7 +74,7 @@ inline int Write (byte* b, int n) { return write (Fd, (const char*) b, n); } class IvlChannel : public IvlIOS { friend class IvlBaseScheduler; protected: - IvlFilDes Fd; + IvlFd Fd; IOMODE Mode; IvlBaseScheduler* Mpx; @@ -104,7 +100,7 @@ inline void SetMode (IOMODE io) { Mode = io; } virtual void HandleWrite (); virtual void HandleRead (); -inline int FilDes () const { return Fd; } +inline int GetFd () 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; } -- cgit v1.1