summaryrefslogtreecommitdiff
path: root/comm
diff options
context:
space:
mode:
authorchatty1994-05-10 10:02:51 +0000
committerchatty1994-05-10 10:02:51 +0000
commitd73a544e118c8dcf0c391ea1e853c37db9943c3b (patch)
treee32d0397784251b98f476968e26f91bb81d8552e /comm
parent054510bddc1801d3900fb0c801a0169dd588b466 (diff)
downloadivy-league-d73a544e118c8dcf0c391ea1e853c37db9943c3b.zip
ivy-league-d73a544e118c8dcf0c391ea1e853c37db9943c3b.tar.gz
ivy-league-d73a544e118c8dcf0c391ea1e853c37db9943c3b.tar.bz2
ivy-league-d73a544e118c8dcf0c391ea1e853c37db9943c3b.tar.xz
replaced TRUE/FALSE by true/false
MsgBuffer -> IOS
Diffstat (limited to 'comm')
-rw-r--r--comm/OLD/ReqMgr.cc38
1 files changed, 21 insertions, 17 deletions
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 <MsgType>& l)
f << "enum " << Name << MsgType::EnumSuffix [k] << " {\n";
CcuListIterOf <MsgType> 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 <MsgType> 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 <MsgType> 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 <MsgType> 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 <MsgField> 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)