diff options
author | chatty | 2000-11-28 17:07:45 +0000 |
---|---|---|
committer | chatty | 2000-11-28 17:07:45 +0000 |
commit | 6b9cabb662c23cd4954b212dde4122af6b045a23 (patch) | |
tree | b5f5da8cc2500cf053d1f1c6c5424dea3a78577d | |
parent | be47ddbcc65b100c3634b5a4c35a89c8eac94a7e (diff) | |
download | ivy-league-6b9cabb662c23cd4954b212dde4122af6b045a23.zip ivy-league-6b9cabb662c23cd4954b212dde4122af6b045a23.tar.gz ivy-league-6b9cabb662c23cd4954b212dde4122af6b045a23.tar.bz2 ivy-league-6b9cabb662c23cd4954b212dde4122af6b045a23.tar.xz |
* CHange handling of multiplexer
-rw-r--r-- | comm/TimeOut.cc | 14 | ||||
-rw-r--r-- | comm/TimeOut.h | 13 |
2 files changed, 14 insertions, 13 deletions
diff --git a/comm/TimeOut.cc b/comm/TimeOut.cc index 617004c..9f70636 100644 --- a/comm/TimeOut.cc +++ b/comm/TimeOut.cc @@ -3,7 +3,7 @@ * * by Michel Beaudouin-Lafon and Stephane Chatty * - * Copyright 1990-1993 + * Copyright 1990-1997 * Laboratoire de Recherche en Informatique (LRI) * Centre d'Etudes de la Navigation Aerienne * @@ -33,8 +33,8 @@ If \var{pulses} is negative, the timer will send signals forever. Timers are activated at creation time. They are disactivated, but not destroyed, after their last pulse. ?*/ -UchBaseTimeOut :: UchBaseTimeOut (UchBaseMultiplexer& m, Millisecond period, int pulses) -: CcuCoreTimer (period, pulses, m.GetTimerSet ()), +UchBaseTimeOut :: UchBaseTimeOut (Millisecond period, int pulses, UchBaseMultiplexer* m) +: CcuCoreTimer (period, pulses, m->GetTimerSet ()), MyMpx (m) { CcuSignalBlocker b (SigAlrm); @@ -55,14 +55,14 @@ UchBaseTimeOut :: ~UchBaseTimeOut () void UchBaseTimeOut :: StopAlarm () { - MyMpx.SuppressTimeOut (); + MyMpx->SuppressTimeOut (); } /*?hidden?*/ void UchBaseTimeOut :: SetAlarm (Millisecond delay) { - MyMpx.SetTimeOut (delay); + MyMpx->SetTimeOut (delay); } @@ -81,8 +81,8 @@ Create a timer associated to the multiplexer \var{m}, that will expire every \var{period} milliseconds and call the function \var{handler}. ?*/ -UchTimeOut :: UchTimeOut (UchBaseMultiplexer& m, Millisecond period, void (*handler) (Millisecond), int pulses) -: UchBaseTimeOut (m, period, pulses), +UchTimeOut :: UchTimeOut (Millisecond period, void (*handler) (Millisecond), int pulses, UchBaseMultiplexer* m) +: UchBaseTimeOut (period, pulses, m), Handler (handler) { } diff --git a/comm/TimeOut.h b/comm/TimeOut.h index 070e8af..aaaae63 100644 --- a/comm/TimeOut.h +++ b/comm/TimeOut.h @@ -3,7 +3,7 @@ * * by Michel Beaudouin-Lafon and Stephane Chatty * - * Copyright 1990-1993 + * Copyright 1990-1997 * Laboratoire de Recherche en Informatique (LRI) * Centre d'Etudes de la Navigation Aerienne * @@ -17,17 +17,18 @@ #define UchTimeOut_H_ #include "ccu/Timer.h" +#include "Multiplexer.h" class UchBaseTimeOut : public CcuCoreTimer { friend class UchBaseMultiplexer; protected: - UchBaseMultiplexer& MyMpx; + UchBaseMultiplexer* MyMpx; void SetAlarm (Millisecond); void StopAlarm (); public: - UchBaseTimeOut (UchBaseMultiplexer&, Millisecond, int = -1); + UchBaseTimeOut (Millisecond, int = -1, UchBaseMultiplexer* = UchMpx); ~UchBaseTimeOut (); }; @@ -37,7 +38,7 @@ protected: void Handle (Millisecond); public: - UchTimeOut (UchBaseMultiplexer&, Millisecond, void (*) (Millisecond), int = -1); + UchTimeOut (Millisecond, void (*) (Millisecond), int = -1, UchBaseMultiplexer* = UchMpx); ~UchTimeOut (); inline void SetHandler (void (*h) (Millisecond)) { Handler = h; } }; @@ -48,7 +49,7 @@ protected: \ S& Object; \ void (S::*Handler) (Millisecond); \ public: \ - R (UchBaseMultiplexer& m, Millisecond t, S& s, void (S::*sc) (Millisecond), int nb = -1) : UchBaseTimeOut (m, t, nb), Object (s), Handler (sc) {} \ + R (Millisecond t, S& s, void (S::*sc) (Millisecond), int nb = -1, UchBaseMultiplexer* m = UchMpx) : UchBaseTimeOut (t, nb, m), Object (s), Handler (sc) {} \ ~R () {} \ void Handle (Millisecond t) { (Object.*Handler) (t); } \ inline void SetHandler (void (S::*h) (Millisecond)) { Handler = h; } \ @@ -62,7 +63,7 @@ protected: void Handle (Millisecond ref) { (Object.*Handler) (ref); } public: - UchTimeOutFor (UchBaseMultiplexer& m, Millisecond t, T& o, void (T::*h) (Millisecond), int nb = -1) : UchBaseTimeOut (m, t, nb), Object (o), Handler (h) {} + UchTimeOutFor (Millisecond t, T& o, void (T::*h) (Millisecond), int nb = -1, UchBaseMultiplexer* m = UchMpx) : UchBaseTimeOut (t, nb, m), Object (o), Handler (h) {} ~UchTimeOutFor () {} inline void SetHandler (void(T::*h)(Millisecond)) { Handler = h; } }; |