diff options
author | chatty | 2000-11-28 14:52:15 +0000 |
---|---|---|
committer | chatty | 2000-11-28 14:52:15 +0000 |
commit | bcb19dbd53973ff7efd9b2838de121d1e23430f4 (patch) | |
tree | 4aa6404ca732d1a32e11b0be1762dcb7ef9fbdb6 /dnn/Loop.h | |
parent | 325530e630c68c7c10a2f4339f5b43434fcd0329 (diff) | |
download | ivy-league-bcb19dbd53973ff7efd9b2838de121d1e23430f4.zip ivy-league-bcb19dbd53973ff7efd9b2838de121d1e23430f4.tar.gz ivy-league-bcb19dbd53973ff7efd9b2838de121d1e23430f4.tar.bz2 ivy-league-bcb19dbd53973ff7efd9b2838de121d1e23430f4.tar.xz |
Lots of files were added around '96
Diffstat (limited to 'dnn/Loop.h')
-rw-r--r-- | dnn/Loop.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/dnn/Loop.h b/dnn/Loop.h new file mode 100644 index 0000000..9009c39 --- /dev/null +++ b/dnn/Loop.h @@ -0,0 +1,82 @@ +/* + * DNN - Data News Network + * + * by Stephane Chatty and Stephane Sire + * + * Copyright 1993-1996 + * Centre d'Etudes de la Navigation Aerienne (CENA) + * + * Multiplexer. + * + * $Id$ + * $CurLog$ + */ + +#ifndef DnnMultiplexer_H_ +#define DnnMultiplexer_H_ + +#include "ccu/Initializer.h" +#include "ccu/List.h" + +enum MPX_RES { isMpxEmpty, isMpxTerminated, isMpxError, isMpxAborted }; + +typedef void (DnnMpxHook) (); + +class DnnBaseMultiplexer { +friend void DnnOpen (DnnBaseMultiplexer*); +friend MPX_RES DnnLoop (); +friend void DnnClose (); + +public: +static bool ClassInitialized; +static void ClassInit (); +static CcuInitializerFor <DnnBaseMultiplexer> Initializer; + +protected: +static CcuList* GlobalHooks; +static CcuList* GlobalFinalHooks; +virtual MPX_RES Loop () = 0; + +public: + DnnBaseMultiplexer (); +virtual ~DnnBaseMultiplexer (); + + MPX_RES Run (); +virtual void Stop () = 0; + +static void AddGlobalHook (DnnMpxHook*, bool = false); +static void RemoveGlobalHook (DnnMpxHook*, bool = false); +virtual void AddHook (DnnMpxHook*, bool = false) = 0; +virtual void RemoveHook (DnnMpxHook*, bool = false) = 0; +virtual void AddFinalHook (DnnMpxHook*) = 0; +virtual void RemoveFinalHook (DnnMpxHook*) = 0; +}; + +class DnnMultiplexer : public DnnBaseMultiplexer { +protected: + CcuList Hooks; + CcuList FinalHooks; + bool Looping; + + void ExecHooks (bool = false); + MPX_RES Loop (); + +public: + DnnMultiplexer (); + ~DnnMultiplexer (); + void Stop (); + void AddHook (DnnMpxHook*, bool = false); + void RemoveHook (DnnMpxHook*, bool = false); + void AddFinalHook (DnnMpxHook*); + void RemoveFinalHook (DnnMpxHook*); +}; + + +extern DnnBaseMultiplexer* DnnMpx; +extern void DnnOpen (DnnBaseMultiplexer* = 0); +extern MPX_RES DnnLoop (); +extern void DnnStop (); +extern void DnnClose (); + + +#endif /* DnnMultiplexer_H_ */ |