From ba066c34dde204aa192d03a23a81356374d93731 Mon Sep 17 00:00:00 2001 From: chatty Date: Wed, 7 Apr 1993 11:50:31 +0000 Subject: Initial revision --- comm/OLD/Event.h | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 comm/OLD/Event.h (limited to 'comm/OLD/Event.h') 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 { +private: + void Load (int, UchEventFeature*); + +public: + UchEventFeatureList (int, UchEventFeature*); + UchEventFeatureList (const UchEventFeatureList&, int, UchEventFeature*); + ~UchEventFeatureList (); +}; + + +class UchEventType { +private: +static void ClassInit (); + +protected: +static CcuListOf * AllTypes; + CcuString Name; +#if 0 + CcuListOf 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_ */ -- cgit v1.1