summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchatty1994-05-10 09:52:27 +0000
committerchatty1994-05-10 09:52:27 +0000
commit8ad2474d8a297c4c85f715f3577c0609628ebce5 (patch)
tree6086447967cd766b27b1c1b1c058ddf1394e5146
parentbdf4adcfb3fe40dc16f8dadde4da416cc8a5b8d2 (diff)
downloadivy-league-8ad2474d8a297c4c85f715f3577c0609628ebce5.zip
ivy-league-8ad2474d8a297c4c85f715f3577c0609628ebce5.tar.gz
ivy-league-8ad2474d8a297c4c85f715f3577c0609628ebce5.tar.bz2
ivy-league-8ad2474d8a297c4c85f715f3577c0609628ebce5.tar.xz
Now derive from UchMessage
-rw-r--r--comm/OLD/Event.cc16
-rw-r--r--comm/OLD/Event.h8
2 files changed, 23 insertions, 1 deletions
diff --git a/comm/OLD/Event.cc b/comm/OLD/Event.cc
index 5fdef7c..716715f 100644
--- a/comm/OLD/Event.cc
+++ b/comm/OLD/Event.cc
@@ -13,6 +13,7 @@
*/
#include "Event.h"
+#include "Channel.h"
#include <memory.h>
UchEventFeatureList :: UchEventFeatureList (const UchEventFeatureList& base, int nbf, UchEventFeature* f)
@@ -119,3 +120,18 @@ UchEvent :: GetFeature (int i, void* data)
memcpy (data, Data+offset, size);
}
+void
+UchEvent :: WriteTo (UchIOS& s)
+{
+ // what about byte swapping?
+ s.WriteBuf ((const byte*) Data, Type.GetTotalSize ());
+}
+
+void
+UchEvent :: ReadFrom (UchIOS& s, lword)
+{
+ // what about byte swapping?
+ s.ReadBuf ((byte*) Data, Type.GetTotalSize ());
+}
+
+
diff --git a/comm/OLD/Event.h b/comm/OLD/Event.h
index 27f3907..5f5019d 100644
--- a/comm/OLD/Event.h
+++ b/comm/OLD/Event.h
@@ -20,6 +20,9 @@
#include "ccu/String.h"
#include "ccu/List.h"
+#include "Message.h"
+class UchIOS;
+
#if 0
class UchEventFeature {
protected:
@@ -76,11 +79,14 @@ inline void RemoveFeature () { }
#endif
};
-class UchEvent {
+class UchEvent : public UchMessage {
protected:
const UchEventType& Type;
char* Data;
+ void ReadFrom (UchIOS&, lword);
+ void WriteTo (UchIOS&);
+
public:
UchEvent (const UchEventType*);
~UchEvent ();