From d73a544e118c8dcf0c391ea1e853c37db9943c3b Mon Sep 17 00:00:00 2001 From: chatty Date: Tue, 10 May 1994 10:02:51 +0000 Subject: replaced TRUE/FALSE by true/false MsgBuffer -> IOS --- comm/OLD/ReqMgr.cc | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'comm') diff --git a/comm/OLD/ReqMgr.cc b/comm/OLD/ReqMgr.cc index 8d317f2..288f203 100644 --- a/comm/OLD/ReqMgr.cc +++ b/comm/OLD/ReqMgr.cc @@ -43,10 +43,10 @@ UchMsgMgr :: DumpEnum (ofstream& f, MsgType::msg_kind k, CcuListOf & l) f << "enum " << Name << MsgType::EnumSuffix [k] << " {\n"; CcuListIterOf msg = l; - bool first = TRUE; + bool first = true; while (++msg) { if (first) - first = FALSE; + first = false; else f << ",\n"; f << "\t" << MsgType::EnumPrefix [k] << (*msg)->GetName (); @@ -188,9 +188,9 @@ UchMsgMgr :: DumpCode (const char* file, int dest) void UchMsgMgr :: DumpClientCode (ofstream& f) { - f << "void*\n" << Name << "Service :: ConvertAnswer (UchMsgBuffer& b)\n{\n"; + f << "UchMessage*\n" << Name << "Service :: ConvertAnswer (UchMsgBuffer& b)\n{\n"; f << "\tlword type;\n"; - f << "\tb.MsgPeek (&type);\n\n"; + f << "\tReadLong (type);\n\n"; f << "\tUchMessage* a = 0;\n"; f << "\tswitch (type) {\n"; CcuListIterOf ans = Answers; @@ -200,12 +200,12 @@ UchMsgMgr :: DumpClientCode (ofstream& f) f << "\t\tbreak;\n"; } f << "\t}\n"; - f << "\tif (a)\n\t\tb.Get (*a);\n\treturn a;\n}\n\n"; + f << "\tif (a)\n\t\tReadMsg (*a);\n\treturn a;\n}\n\n"; f << "bool\n" << Name << "Service :: NewMessage (UchMsgBuffer& b, bool)\n{\n"; f << "\tlword type;\n"; - f << "\tb.MsgPeek (&type);\n\n"; + f << "\tReadLong (type);\n\n"; f << "\tUchMessage* m = 0;\n"; f << "\tswitch (type) {\n"; CcuListIterOf evt = Events; @@ -215,8 +215,8 @@ UchMsgMgr :: DumpClientCode (ofstream& f) f << "\t\tbreak;\n"; } f << "\t}\n"; - f << "\tif (m) {\n\t\tb.Get (*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\tReadMsg (*m);\n\t\tPutEvent (m);\n\t\treturn true;\n"; + f << "\t} else\n\t\treturn false;\n}\n\n"; } @@ -225,7 +225,7 @@ UchMsgMgr :: DumpServerCode (ofstream& f) { f << "bool\n" << Name << "Client :: NewMessage (UchMsgBuffer& b, bool)\n{\n"; f << "\tlword type;\n"; - f << "\tb.MsgPeek (&type);\n\n"; + f << "\tReadLong (type);\n\n"; f << "\tUchMessage* m = 0;\n"; f << "\tswitch (type) {\n"; CcuListIterOf req = Requests; @@ -235,11 +235,11 @@ UchMsgMgr :: DumpServerCode (ofstream& f) f << "\t\tbreak;\n"; } f << "\t}\n"; - f << "\tif (m) {\n\t\tb.Get (*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\tReadMsg (*m);\n\t\tm->Activate (*this);\n\t\treturn true;\n"; + f << "\t} else\n\t\treturn false;\n}\n\n"; - f << "UchClient*\n" << Name << "Server :: HandleNew (UchChannel* ch)\n{\n"; - f << "\treturn new " << Name << "Client (ch);\n}\n\n"; + f << "UchClient*\n" << Name << "Server :: CreateClient (int fd)\n{\n"; + f << "\treturn new " << Name << "Client (*this, fd);\n}\n\n"; } const char* const MsgType::ClassSuffix [3] = {"Req", "Ans", "Event"}; @@ -306,9 +306,9 @@ MsgType :: DumpDecl (ofstream& f, int dest) /* other methods */ if (emitter) - f << "\tvoid\tWriteTo (UchMsgBuffer&);\n"; + f << "\tvoid\tWriteTo (UchIOS&);\n"; if (receiver) { - f << "\tvoid\tReadFrom (UchMsgBuffer&, lword);\n"; + f << "\tvoid\tReadFrom (UchIOS&, lword);\n"; if (Kind == isRequest) f << "\tvoid\tActivate (UchMsgStream&);\n"; } @@ -387,8 +387,12 @@ MsgType :: DumpCode (ofstream& f, int dest) CcuListIterOf field (Fields); if (receiver) { - f << "void\n" << classname << " :: ReadFrom (UchMsgBuffer& b, lword)\n{\n"; + f << "void\n" << classname << " :: ReadFrom (UchIOS& b, lword)\n{\n"; +#if 0 f << "\tlword type;\n\tb >> type"; +#else + f << "\t b "; +#endif while (++field) f << " >> " << (*field)->GetName (); f << ";\n"; @@ -396,7 +400,7 @@ MsgType :: DumpCode (ofstream& f, int dest) } if (emitter) { - f << "void\n" << classname << " :: " << "WriteTo (UchMsgBuffer& b)\n{\n"; + f << "void\n" << classname << " :: " << "WriteTo (UchIOS& b)\n{\n"; f << "\tb << Type"; field.Reset (); while (++field) -- cgit v1.1