summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchatty2000-11-28 17:07:44 +0000
committerchatty2000-11-28 17:07:44 +0000
commit6e0af74f4518bfbf7cb3455767d831b347ea8c78 (patch)
tree39ae1431713fb2bc31cdf5ed5b004ae54550ef06
parent914fe0ed606bdfbcafc9fe74596bbe7fe09a8e68 (diff)
downloadivy-league-6e0af74f4518bfbf7cb3455767d831b347ea8c78.zip
ivy-league-6e0af74f4518bfbf7cb3455767d831b347ea8c78.tar.gz
ivy-league-6e0af74f4518bfbf7cb3455767d831b347ea8c78.tar.bz2
ivy-league-6e0af74f4518bfbf7cb3455767d831b347ea8c78.tar.xz
* Smart(ies) removed by Stephane Sire
* added Hooks
-rw-r--r--comm/Multiplexer.h33
1 files changed, 18 insertions, 15 deletions
diff --git a/comm/Multiplexer.h b/comm/Multiplexer.h
index ee52c91..e955130 100644
--- a/comm/Multiplexer.h
+++ b/comm/Multiplexer.h
@@ -15,9 +15,8 @@
#ifndef UchMultiplexer_H_
#define UchMultiplexer_H_
-//#include "dnn/Multiplexer.h"
-#include "Loop.h"
-#include "../UCH/Channel.h"
+#include "dnn/Loop.h"
+#include "Channel.h"
#include <sys/types.h>
#include "ccu/Timer.h"
@@ -33,7 +32,7 @@ extern char* StrReprBuf;
//
// WARNING: when the Multiplexer is deleted, the Channels it still
-// has in its channel set are not Removed; instead UchChannel::Removed
+// have in its channel set are not Removed; instead UchChannel::Removed
// is called
typedef DnnMpxHook UchMpxHook;
@@ -42,20 +41,21 @@ class UchBaseMultiplexer : public DnnBaseMultiplexer {
friend class UchBaseTimeOut;
friend class UchBaseSignalHandler;
friend class UchChannel;
+friend MPX_RES UchLoop ();
protected:
- bool Add (UchChannel*);
- bool Remove (int);
-
UchChannel** Channels;
CcuTimerSet Timers;
short ReadCount;
short WriteCount;
short SelectCount;
- bool SigFired;
- int* NbSignals;
+ bool Looping;
+ bool SigFired;
UchBaseSignalHandler** Handlers;
+ int* NbSignals;
+ bool Add (UchChannel*);
+ bool Remove (int);
void HandleSignal (UchBaseSignalHandler&);
void HandleDeferredSignals ();
inline CcuTimerSet* GetTimerSet () { return &Timers; }
@@ -70,18 +70,16 @@ public:
~UchBaseMultiplexer ();
UchChannel* operator [] (int);
-
+
void RemoveAll ();
void SetMode (int, IOMODE);
MPX_RES Run ();
-#if 0
void Abort ();
void Close ();
-#endif
-
};
+
class UchMultiplexer : public UchBaseMultiplexer {
protected:
fd_set ReadMask;
@@ -98,11 +96,13 @@ protected:
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);
@@ -111,6 +111,9 @@ public:
void RemoveFinalHook (DnnMpxHook*);
};
-#endif /* Multiplexer_H_ */
-
+extern UchBaseMultiplexer* UchMpx;
+extern void UchOpen (UchBaseMultiplexer* = 0);
+extern MPX_RES UchLoop ();
+extern void UchStop ();
+#endif /* UchMultiplexer_H_ */