From 38e9ce178e63a0cdf8a060a4615b8a20ffbfafe2 Mon Sep 17 00:00:00 2001 From: chatty Date: Tue, 28 Nov 2000 14:52:15 +0000 Subject: Split DnnEvent into DnnEvent and DnnBasicEvent --- dnn/Event.cc | 36 ++++++++++++++++++++++++++---------- dnn/Event.h | 14 +++++++++++--- 2 files changed, 37 insertions(+), 13 deletions(-) (limited to 'dnn') diff --git a/dnn/Event.cc b/dnn/Event.cc index 3868985..600b174 100644 --- a/dnn/Event.cc +++ b/dnn/Event.cc @@ -3,7 +3,7 @@ * * by Stephane Chatty * - * Copyright 1993-1995 + * Copyright 1993-1997 * Centre d'Etudes de la Navigation Aerienne (CENA) * * Events. @@ -108,11 +108,26 @@ DnnEventType :: ~DnnEventType () delete [] FeaturesOffsets; } +DnnEvent :: DnnEvent () +{ +} + +/* useless, for compatibility only */ +DnnEvent :: DnnEvent (const DnnEventType*) +{ +} + +DnnEvent :: ~DnnEvent () +{ +} + + /*? Build an event of type \var{t}. ?*/ -DnnEvent :: DnnEvent (const DnnEventType* t) -: Type (*t) +DnnBasicEvent :: DnnBasicEvent (const DnnEventType* t) +: DnnEvent (), + Type (*t) { int sz = t->GetTotalSize (); if (sz > 0) @@ -122,8 +137,9 @@ DnnEvent :: DnnEvent (const DnnEventType* t) } -DnnEvent :: DnnEvent (const DnnEventType* t, bool alloc) -: Type (*t) +DnnBasicEvent :: DnnBasicEvent (const DnnEventType* t, bool alloc) +: DnnEvent (), + Type (*t) { if (alloc) { int sz = t->GetTotalSize (); @@ -137,14 +153,14 @@ DnnEvent :: DnnEvent (const DnnEventType* t, bool alloc) } /*?nodoc?*/ -DnnEvent :: ~DnnEvent () +DnnBasicEvent :: ~DnnBasicEvent () { if (Data && Data != (char*) (&Data+sizeof (char*))) delete [] Data; } void -DnnEvent :: SetFeature (int i, const void* data) +DnnBasicEvent :: SetFeature (int i, const void* data) { int offset = Type.GetOffset (i); int size = Type.GetSize (i); @@ -152,7 +168,7 @@ DnnEvent :: SetFeature (int i, const void* data) } void -DnnEvent :: GetFeature (int i, void* data) +DnnBasicEvent :: GetFeature (int i, void* data) { int offset = Type.GetOffset (i); int size = Type.GetSize (i); @@ -161,14 +177,14 @@ DnnEvent :: GetFeature (int i, void* data) #if 0 void -DnnEvent :: WriteTo (DnnIOS& s) +DnnBasicEvent :: WriteTo (DnnIOS& s) { // what about byte swapping? s.WriteBuf ((const byte*) Data, Type.GetTotalSize ()); } void -DnnEvent :: ReadFrom (DnnIOS& s, lword) +DnnBasicEvent :: ReadFrom (DnnIOS& s, lword) { // what about byte swapping? s.ReadBuf ((byte*) Data, Type.GetTotalSize ()); diff --git a/dnn/Event.h b/dnn/Event.h index da03c8e..b2c7341 100644 --- a/dnn/Event.h +++ b/dnn/Event.h @@ -10,6 +10,7 @@ * * $Id$ * $CurLog$ + * Split DnnEvent into DnnEvent and DnnBasicEvent */ #ifndef DnnEvent_H_ @@ -80,14 +81,21 @@ inline void RemoveFeature () { } }; class DnnEvent { +public: + DnnEvent (); + DnnEvent (const DnnEventType*); // useless, for compatibility only +virtual ~DnnEvent (); +}; + +class DnnBasicEvent : public DnnEvent { protected: const DnnEventType& Type; char* Data; - DnnEvent (const DnnEventType*, bool); + DnnBasicEvent (const DnnEventType*, bool); public: - DnnEvent (const DnnEventType*); -virtual ~DnnEvent (); + DnnBasicEvent (const DnnEventType*); + ~DnnBasicEvent (); void SetFeature (int, const void*); void GetFeature (int, void*); inline const DnnEventType* GetType () const { return &Type; } -- cgit v1.1