summaryrefslogtreecommitdiff
path: root/comm/Channel.h
diff options
context:
space:
mode:
authorsc2000-12-04 13:23:22 +0000
committersc2000-12-04 13:23:22 +0000
commit2455534347596bd4ccf415c9cdf6d2e42a98fb72 (patch)
tree09379b262ce739bfa86cf9c7610c83b471b89ffc /comm/Channel.h
parentee21a6940d4a8edb758187352ae717bbe7b1b825 (diff)
downloadivy-league-2455534347596bd4ccf415c9cdf6d2e42a98fb72.zip
ivy-league-2455534347596bd4ccf415c9cdf6d2e42a98fb72.tar.gz
ivy-league-2455534347596bd4ccf415c9cdf6d2e42a98fb72.tar.bz2
ivy-league-2455534347596bd4ccf415c9cdf6d2e42a98fb72.tar.xz
IvlFilDes -> IvlFd
Diffstat (limited to 'comm/Channel.h')
-rw-r--r--comm/Channel.h34
1 files changed, 15 insertions, 19 deletions
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; }