diff options
author | chatty | 1994-03-14 08:40:16 +0000 |
---|---|---|
committer | chatty | 1994-03-14 08:40:16 +0000 |
commit | 33c173febd67cf6b558eb86ba552dc9369ab4b24 (patch) | |
tree | 0af984e138144b6ff9d8ec98b0ea7245dd003bef /dnn/Event.h | |
parent | 1ed65383fc2b49e22929862dd5705c93f79a60c2 (diff) | |
download | ivy-league-33c173febd67cf6b558eb86ba552dc9369ab4b24.zip ivy-league-33c173febd67cf6b558eb86ba552dc9369ab4b24.tar.gz ivy-league-33c173febd67cf6b558eb86ba552dc9369ab4b24.tar.bz2 ivy-league-33c173febd67cf6b558eb86ba552dc9369ab4b24.tar.xz |
Initial revision
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_ */ |