diff options
Diffstat (limited to 'dnn/Event.h')
-rw-r--r-- | dnn/Event.h | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/dnn/Event.h b/dnn/Event.h new file mode 100644 index 0000000..cacb2e8 --- /dev/null +++ b/dnn/Event.h @@ -0,0 +1,97 @@ +/* + * DNN - Data News Network + * + * by Stephane Chatty + * + * Copyright 1993-1994 + * Centre d'Etudes de la Navigation Aerienne (CENA) + * + * Events. + * + * $Id$ + * $CurLog$ + */ + +#ifndef DnnEvent_H_ +#define DnnEvent_H_ + +#include "cplus_bugs.h" +#include "ccu/String.h" +#include "ccu/List.h" + +class UchIOS; + +#if 0 + +class DnnEventFeature { +protected: + CcuString Name; + DnnEventFeatureType& Type; + +public: +inline DnnEventFeature (const char* n, DnnEventFeatureType& t) : Name (n), Type (t) {} +inline ~DnnEventFeature () {} +}; + +#else + +struct DnnEventFeature { + const char* Name; + int Size; +}; + +#endif + + +class DnnEventFeatureList : public CcuListOf <DnnEventFeature> { +private: + void Load (int, DnnEventFeature*); + +public: + DnnEventFeatureList (int, DnnEventFeature*); + DnnEventFeatureList (const DnnEventFeatureList&, int, DnnEventFeature*); + ~DnnEventFeatureList (); +}; + + +class DnnEventType { +private: +static void ClassInit (); + +protected: +static CcuListOf <DnnEventType>* AllTypes; + CcuString Name; +#if 0 + CcuListOf <DnnEventFeature> Features; +#endif + int NbFeatures; + int* FeaturesOffsets; + +public: + DnnEventType (const char*, int, DnnEventFeature []); + DnnEventType (const char*, const DnnEventFeatureList&); + ~DnnEventType (); +inline int operator == (const DnnEventType& 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, DnnEventFeatureType& t) { Features->Append (new DnnEventFeature (fn, t); } +inline void RemoveFeature () { } +#endif +}; + +class DnnEvent { +protected: + const DnnEventType& Type; + char* Data; + +public: + DnnEvent (const DnnEventType*); + ~DnnEvent (); + void SetFeature (int, const void*); + void GetFeature (int, void*); +inline const DnnEventType* GetType () const { return &Type; } +}; + +#endif /* DnnEvent_H_ */ |