From 87b538c70c76a6c5e0fd3ed6a9b40ca3873e51b6 Mon Sep 17 00:00:00 2001 From: chatty Date: Mon, 13 Feb 1995 16:57:18 +0000 Subject: NewMessage -> DecodeMessage ConvertAnswer -> DecodeAnswer Changed args of Activate Events now derive from UchEventMsg --- comm/OLD/ReqMgr.cc | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/comm/OLD/ReqMgr.cc b/comm/OLD/ReqMgr.cc index 8a238c2..a7d1ec8 100644 --- a/comm/OLD/ReqMgr.cc +++ b/comm/OLD/ReqMgr.cc @@ -188,7 +188,7 @@ UchMsgMgr :: DumpCode (const char* file, int dest) void UchMsgMgr :: DumpClientCode (ofstream& f) { - f << "UchMessage*\n" << Name << "Service :: ConvertAnswer (UchMsgBuffer& b)\n{\n"; + f << "UchMessage*\n" << Name << "Service :: DecodeAnswer (UchMsgBuffer& b)\n{\n"; f << "\tlword type;\n"; f << "\tb.PeekLong (type, lwsize);\n\n"; f << "\tUchMessage* a = 0;\n"; @@ -203,7 +203,7 @@ UchMsgMgr :: DumpClientCode (ofstream& f) f << "\tif (a)\n\t\tb.ReadMsg (*a);\n\treturn a;\n}\n\n"; - f << "bool\n" << Name << "Service :: NewMessage (UchMsgBuffer& b, bool)\n{\n"; + f << "UchMessage*\n" << Name << "Service :: DecodeMessage (UchMsgBuffer& b)\n{\n"; f << "\tlword type;\n"; f << "\tb.PeekLong (type, lwsize);\n\n"; f << "\tUchMessage* m = 0;\n"; @@ -215,15 +215,15 @@ UchMsgMgr :: DumpClientCode (ofstream& f) f << "\t\tbreak;\n"; } f << "\t}\n"; - f << "\tif (m) {\n\t\tb.ReadMsg (*m);\n\t\tPutEvent (m);\n\t\treturn true;\n"; - f << "\t} else\n\t\treturn false;\n}\n\n"; + f << "\tif (m)\n\t\tb.ReadMsg (*m);\n"; + f << "\treturn m;\n}\n\n"; } void UchMsgMgr :: DumpServerCode (ofstream& f) { - f << "bool\n" << Name << "Client :: NewMessage (UchMsgBuffer& b, bool)\n{\n"; + f << "UchMessage*\n" << Name << "Client :: DecodeMessage (UchMsgBuffer& b)\n{\n"; f << "\tlword type;\n"; f << "\tb.PeekLong (type, lwsize);\n\n"; f << "\tUchMessage* m = 0;\n"; @@ -235,8 +235,8 @@ UchMsgMgr :: DumpServerCode (ofstream& f) f << "\t\tbreak;\n"; } f << "\t}\n"; - f << "\tif (m) {\n\t\tb.ReadMsg (*m);\n\t\tm->Activate (*this);\n\t\treturn true;\n"; - f << "\t} else\n\t\treturn false;\n}\n\n"; + f << "\tif (m)\n\t\tb.ReadMsg (*m);\n"; + f << "\treturn m;\n}\n\n"; f << "UchClient*\n" << Name << "Server :: CreateClient (int fd)\n{\n"; f << "\treturn new " << Name << "Client (*this, fd);\n}\n\n"; @@ -265,7 +265,12 @@ MsgType :: DumpDecl (ofstream& f, int dest) } /* name and base class */ - f << "class " << classname << " : public UchMessage {\n"; + f << "class " << classname << " : public "; + if (Kind == isEvent) + f << "UchEventMsg"; + else + f << "UchMessage"; + f << " {\n"; /* field containing the type */ f << "protected:\n"; @@ -310,7 +315,7 @@ MsgType :: DumpDecl (ofstream& f, int dest) if (receiver) { f << "\tvoid\tReadFrom (UchIOS&, lword);\n"; if (Kind == isRequest) - f << "\tvoid\tActivate (UchMsgStream&);\n"; + f << "\nbool\tActivate (UchMsgStream&, bool);\n"; } /* getters defined in the file */ @@ -352,7 +357,12 @@ MsgType :: DumpCode (ofstream& f, int dest) /* the default constructor*/ if (!DefaultConstructor && (Fields.IsEmpty () || receiver)) { - f << classname << " :: " << classname << " ()\n: UchMessage (),\n"; + f << classname << " :: " << classname << " ()\n: "; + if (Kind == isEvent) + f << "UchEventMsg"; + else + f << "UchMessage"; + f << " (),\n"; f << " Type (" << EnumPrefix [Kind] << Name << ")\n{\n}\n\n"; } @@ -370,7 +380,12 @@ MsgType :: DumpCode (ofstream& f, int dest) f << (*fields)->GetType () << " i" << i; ++i; } - f << ")\n: UchMessage (),\n Type (" << EnumPrefix [Kind] << Name << ")"; + f << ")\n: "; + if (Kind == isEvent) + f << "UchEventMsg"; + else + f << "UchMessage"; + f << " (),\n Type (" << EnumPrefix [Kind] << Name << ")"; fields.Reset (); i = 0; while (++fields) { -- cgit v1.1