From 8ad2474d8a297c4c85f715f3577c0609628ebce5 Mon Sep 17 00:00:00 2001 From: chatty Date: Tue, 10 May 1994 09:52:27 +0000 Subject: Now derive from UchMessage --- comm/OLD/Event.cc | 16 ++++++++++++++++ comm/OLD/Event.h | 8 +++++++- 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'comm') 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 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 (); -- cgit v1.1