summaryrefslogtreecommitdiff
path: root/dnn
diff options
context:
space:
mode:
authorchatty2000-11-28 14:52:15 +0000
committerchatty2000-11-28 14:52:15 +0000
commit38e9ce178e63a0cdf8a060a4615b8a20ffbfafe2 (patch)
tree2313a6420e04902c7c81e70694b48e35cac36001 /dnn
parent7d3a3c409c6492db6a3caabc7e9037b79ae7422d (diff)
downloadivy-league-38e9ce178e63a0cdf8a060a4615b8a20ffbfafe2.zip
ivy-league-38e9ce178e63a0cdf8a060a4615b8a20ffbfafe2.tar.gz
ivy-league-38e9ce178e63a0cdf8a060a4615b8a20ffbfafe2.tar.bz2
ivy-league-38e9ce178e63a0cdf8a060a4615b8a20ffbfafe2.tar.xz
Split DnnEvent into DnnEvent and DnnBasicEvent
Diffstat (limited to 'dnn')
-rw-r--r--dnn/Event.cc36
-rw-r--r--dnn/Event.h14
2 files changed, 37 insertions, 13 deletions
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; }