From bcb19dbd53973ff7efd9b2838de121d1e23430f4 Mon Sep 17 00:00:00 2001 From: chatty Date: Tue, 28 Nov 2000 14:52:15 +0000 Subject: Lots of files were added around '96 --- dnn/Loop.h | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 dnn/Loop.h (limited to 'dnn/Loop.h') 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 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_ */ -- cgit v1.1