summaryrefslogtreecommitdiff
path: root/comm
diff options
context:
space:
mode:
authorchatty1995-02-13 16:57:15 +0000
committerchatty1995-02-13 16:57:15 +0000
commit375258b6c9ffa60826e1188e24daa9352d323fa9 (patch)
tree27c23689ac3c627fcf437585883c8242ac80a078 /comm
parent57db34632a8ae1241d228f902e43bf6809415120 (diff)
downloadivy-league-375258b6c9ffa60826e1188e24daa9352d323fa9.zip
ivy-league-375258b6c9ffa60826e1188e24daa9352d323fa9.tar.gz
ivy-league-375258b6c9ffa60826e1188e24daa9352d323fa9.tar.bz2
ivy-league-375258b6c9ffa60826e1188e24daa9352d323fa9.tar.xz
Changed status of Activate
Diffstat (limited to 'comm')
-rw-r--r--comm/Message.cc47
1 files changed, 17 insertions, 30 deletions
diff --git a/comm/Message.cc b/comm/Message.cc
index 7d42248..fea0d80 100644
--- a/comm/Message.cc
+++ b/comm/Message.cc
@@ -3,7 +3,7 @@
*
* by Michel Beaudouin-Lafon
*
- * Copyright 1990-1993
+ * Copyright 1990-1995
* Laboratoire de Recherche en Informatique (LRI)
*
* Messages
@@ -15,6 +15,7 @@
#include "cplus_bugs.h"
#include "Message.h"
+#include "MsgStream.h"
#include "IOS.h"
/*?class UchMessage
@@ -63,36 +64,22 @@ UchMessage :: ReadFrom (UchIOS&, lword)
}
/*?
-This virtual function can be redefined in derived classes to support the handling of messages
-after they have been loaded from a buffer. The function \typ{MyClient}::\fun{NewMessage}
-may then look like:
-\begin{ccode}
-void
-MyClient :: NewMessage (UchMsgBuffer& buffer, bool ask)
-{
- MyRequest* m = 0;
- lword type;
- buffer.MsgPeek (&type);
- switch (type) {
- case MyFirstReqType:
- m = new MyFirstRequest;
- break;
- case ...
- ...
- }
- if (m) {
- buffer.Get (m);
- m->Activate (*this);
- return true;
- }
- return false;
-}
-\end{ccode}
-However, this virtual function is only provided as a facility and is not used
-by \uch. Redefining it is not mandatory.
+This virtual function must be redefined in derived classes to support the handling of messages
+after they have been loaded from a buffer.
+\var{ask} is true if the message was sent with \fun{Ask}.
+In this case an answer must be sent back with \fun{Reply}.
+Messages can be sent before replying; they will be buffered by the receiver for later processing.
+But you cannot use \fun{Ask} before replying.
+In the class \typ{UchMessage} this function does nothing and returns true;
+if \var{ask} is true, it replies immediately with an empty message.
?*/
-void
-UchMessage :: Activate (UchMsgStream&)
+bool
+UchMessage :: Activate (UchMsgStream& s, bool ask)
{
+ if (ask) {
+ UchMessage dummy;
+ s.Reply (dummy);
+ }
+ return true;
}