summaryrefslogtreecommitdiff
path: root/comm/Multiplexer.h
diff options
context:
space:
mode:
authorsc2000-11-28 17:07:47 +0000
committersc2000-11-28 17:07:47 +0000
commitee937667fd0ecd82faab4c88d756b906fb625f1a (patch)
tree19e679318b5cb87e8be1a05a7bbc9ba5568d0814 /comm/Multiplexer.h
parent1326b11d65f7020f5f6c691305d2c090b064bd04 (diff)
downloadivy-league-ee937667fd0ecd82faab4c88d756b906fb625f1a.zip
ivy-league-ee937667fd0ecd82faab4c88d756b906fb625f1a.tar.gz
ivy-league-ee937667fd0ecd82faab4c88d756b906fb625f1a.tar.bz2
ivy-league-ee937667fd0ecd82faab4c88d756b906fb625f1a.tar.xz
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
Diffstat (limited to 'comm/Multiplexer.h')
-rw-r--r--comm/Multiplexer.h119
1 files changed, 0 insertions, 119 deletions
diff --git a/comm/Multiplexer.h b/comm/Multiplexer.h
deleted file mode 100644
index e955130..0000000
--- a/comm/Multiplexer.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * The Unix Channel
- *
- * by Michel Beaudouin-Lafon
- *
- * Copyright 1990-1993
- * Laboratoire de Recherche en Informatique (LRI)
- *
- * Channel sets, or multiplexers
- *
- * $Id$
- * $CurLog$
- */
-
-#ifndef UchMultiplexer_H_
-#define UchMultiplexer_H_
-
-#include "dnn/Loop.h"
-#include "Channel.h"
-#include <sys/types.h>
-#include "ccu/Timer.h"
-
-extern char* StrReprBuf;
-
-// This class defines channel sets for multiplexing i/o
-// Because of the coercion defined for FILDES -> int,
-// most arguments of type ints can be FILDES, UchChannel, ...
-// An array of pointers to channels is kept in the object;
-// The masks for reading/writing are kept consistent with the IOMode of
-// the channels, as long as it is not changed by a direct access to the channel
-// operator[] returns a pointer and cannot be used as an lhs of an assignment.
-//
-
-// WARNING: when the Multiplexer is deleted, the Channels it still
-// have in its channel set are not Removed; instead UchChannel::Removed
-// is called
-
-typedef DnnMpxHook UchMpxHook;
-
-class UchBaseMultiplexer : public DnnBaseMultiplexer {
-friend class UchBaseTimeOut;
-friend class UchBaseSignalHandler;
-friend class UchChannel;
-friend MPX_RES UchLoop ();
-
-protected:
- UchChannel** Channels;
- CcuTimerSet Timers;
- short ReadCount;
- short WriteCount;
- short SelectCount;
- bool Looping;
- bool SigFired;
- UchBaseSignalHandler** Handlers;
- int* NbSignals;
-
- bool Add (UchChannel*);
- bool Remove (int);
- void HandleSignal (UchBaseSignalHandler&);
- void HandleDeferredSignals ();
-inline CcuTimerSet* GetTimerSet () { return &Timers; }
-
-virtual void SetMasks (int, IOMODE);
-virtual void SetTimeOut (Millisecond) = 0;
-virtual void SuppressTimeOut () = 0;
-virtual void AddSignalHook ();
-
-public:
- UchBaseMultiplexer ();
- ~UchBaseMultiplexer ();
-
- UchChannel* operator [] (int);
-
- void RemoveAll ();
- void SetMode (int, IOMODE);
- MPX_RES Run ();
-
- void Abort ();
- void Close ();
-};
-
-
-class UchMultiplexer : public UchBaseMultiplexer {
-protected:
- fd_set ReadMask;
- fd_set WriteMask;
- fd_set SelectMask;
- CcuList Hooks;
- CcuList FinalHooks;
- bool Looping;
- Millisecond TimeOut;
-
- void SetMasks (int, IOMODE);
- void SetTimeOut (Millisecond);
- void SuppressTimeOut ();
- MPX_RES Loop ();
- void ExecHooks (bool = false);
-
-
-public:
- UchMultiplexer ();
- ~UchMultiplexer ();
-
- MPX_RES LoopScan (bool nointr = true);
- int Scan (bool nointr = true, bool poll = false);
- void Stop ();
- char* StrRepr (char* = StrReprBuf);
- void AddHook (DnnMpxHook*, bool = false);
- void RemoveHook (DnnMpxHook*, bool = false);
- void AddFinalHook (DnnMpxHook*);
- void RemoveFinalHook (DnnMpxHook*);
-};
-
-extern UchBaseMultiplexer* UchMpx;
-extern void UchOpen (UchBaseMultiplexer* = 0);
-extern MPX_RES UchLoop ();
-extern void UchStop ();
-
-#endif /* UchMultiplexer_H_ */