summaryrefslogtreecommitdiff
path: root/comm/OLD/Event.h
diff options
context:
space:
mode:
Diffstat (limited to 'comm/OLD/Event.h')
-rw-r--r--comm/OLD/Event.h92
1 files changed, 92 insertions, 0 deletions
diff --git a/comm/OLD/Event.h b/comm/OLD/Event.h
new file mode 100644
index 0000000..27f3907
--- /dev/null
+++ b/comm/OLD/Event.h
@@ -0,0 +1,92 @@
+/*
+ * The Unix Channel
+ *
+ * by Michel Beaudouin-Lafon
+ *
+ * Copyright 1993
+ * Centre d'Etudes de la Navigation Aerienne (CENA)
+ *
+ * Events, by Stephane Chatty
+ *
+ * $Id$
+ * $CurLog$
+ */
+
+#ifndef UchEvent_H_
+#define UchEvent_H_
+
+#include "cplus_bugs.h"
+#include "global.h"
+#include "ccu/String.h"
+#include "ccu/List.h"
+
+#if 0
+class UchEventFeature {
+protected:
+ CcuString Name;
+ UchEventFeatureType& Type;
+
+public:
+inline UchEventFeature (const char* n, UchEventFeatureType& t) : Name (n), Type (t) {}
+inline ~UchEventFeature () {}
+};
+#endif
+
+struct UchEventFeature {
+ const char* Name;
+ int Size;
+};
+
+
+class UchEventFeatureList : public CcuListOf <UchEventFeature> {
+private:
+ void Load (int, UchEventFeature*);
+
+public:
+ UchEventFeatureList (int, UchEventFeature*);
+ UchEventFeatureList (const UchEventFeatureList&, int, UchEventFeature*);
+ ~UchEventFeatureList ();
+};
+
+
+class UchEventType {
+private:
+static void ClassInit ();
+
+protected:
+static CcuListOf <UchEventType>* AllTypes;
+ CcuString Name;
+#if 0
+ CcuListOf <UchEventFeature> Features;
+#endif
+ int NbFeatures;
+ int* FeaturesOffsets;
+
+public:
+ UchEventType (const char*, int, UchEventFeature []);
+ UchEventType (const char*, const UchEventFeatureList&);
+ ~UchEventType ();
+inline int operator == (const UchEventType& evt) const { return (this == &evt); }
+inline int GetTotalSize () const { return FeaturesOffsets [NbFeatures - 1]; }
+inline int GetOffset (int i) const { return i ? FeaturesOffsets [i-1] : 0; }
+inline int GetSize (int i) const { return FeaturesOffsets [i] - (i ? FeaturesOffsets [i-1] : 0); }
+#if 0
+inline void AddFeature (const char* fn, UchEventFeatureType& t) { Features->Append (new UchEventFeature (fn, t); }
+inline void RemoveFeature () { }
+#endif
+};
+
+class UchEvent {
+protected:
+ const UchEventType& Type;
+ char* Data;
+
+public:
+ UchEvent (const UchEventType*);
+ ~UchEvent ();
+ void SetFeature (int, const void*);
+ void GetFeature (int, void*);
+inline const UchEventType& GetType () const { return Type; }
+};
+
+#endif /* UchEvent_H_ */