certi-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[certi-cvs] certi/RTIA RTIA.cc Communications.cc [br_DEV_HETEROGENEOUS]


From: certi-cvs
Subject: [certi-cvs] certi/RTIA RTIA.cc Communications.cc [br_DEV_HETEROGENEOUS]
Date: Mon, 21 Apr 2008 11:29:34 +0000

CVSROOT:        /sources/certi
Module name:    certi
Branch:         br_DEV_HETEROGENEOUS
Changes by:     Eric NOULARD <erk>      08/04/21 11:29:34

Modified files:
        RTIA           : RTIA.cc Communications.cc 

Log message:
        Should allocate Message in the on-going case

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/RTIA.cc?cvsroot=certi&only_with_tag=br_DEV_HETEROGENEOUS&r1=3.13.2.1&r2=3.13.2.2
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/Communications.cc?cvsroot=certi&only_with_tag=br_DEV_HETEROGENEOUS&r1=3.22.2.3&r2=3.22.2.4

Patches:
Index: RTIA.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/RTIA.cc,v
retrieving revision 3.13.2.1
retrieving revision 3.13.2.2
diff -u -b -r3.13.2.1 -r3.13.2.2
--- RTIA.cc     18 Mar 2008 15:55:57 -0000      3.13.2.1
+++ RTIA.cc     21 Apr 2008 11:29:34 -0000      3.13.2.2
@@ -18,7 +18,7 @@
 // along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: RTIA.cc,v 3.13.2.1 2008/03/18 15:55:57 erk Exp $
+// $Id: RTIA.cc,v 3.13.2.2 2008/04/21 11:29:34 erk Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -95,12 +95,14 @@
 
     while (!fm->_fin_execution) {
        
-        /* Message will be allocated by the readMessage call */
+        /* 
+         * readMessage call will allocate EITHER a Network Message or a 
Message 
+         *   Network Message will come from a virtual constructor call
+         *   Message will come from a "simple" constructor call
+         */
        msg_un      = NULL;
        msg_tcp_udp = NULL;
         try {
-               msg_un      = NULL;
-               msg_tcp_udp = NULL;
             comm->readMessage(n, &msg_tcp_udp, &msg_un);
             assert((msg_un!=NULL) || (msg_tcp_udp!=NULL));
         }
@@ -116,11 +118,9 @@
             break ;
           case 1:
             processNetworkMessage(msg_tcp_udp);
-            delete msg_un ;
             break ;
           case 2:
             processFederateRequest(msg_un);
-            delete msg_tcp_udp ;
             break ;
           default:
             assert(false);
@@ -131,7 +131,9 @@
                // read a message from the rtig
             // same code is reused, but only the case 1 should match
 
-               /* Message or NetworkMessage will be allocated by the 
readMessage call */
+               /* NetworkMessage will be allocated by the readMessage call
+                * We may not get a Message in this call see previous comment
+                */
             msg_un      = NULL;
             msg_tcp_udp = NULL;
             
@@ -141,7 +143,6 @@
             catch (NetworkSignal) {
                 fm->_fin_execution = true ;
                 n = 0 ;
-                delete msg_un ;
                 delete msg_tcp_udp ;
             }
 
@@ -149,7 +150,8 @@
               case 0:
                 break ;
               case 1:
-                processNetworkMessage(msg_tcp_udp) ;  // could authorize a 
callbak
+                processNetworkMessage(msg_tcp_udp) ;  // could authorize a 
callback
+                msg_un = new Message();
                 msg_un->type = Message::TICK_REQUEST ;
                 msg_un->setBoolean(true) ;
                 processFederateRequest(msg_un);  //could reset _ongoing_tick   
             
@@ -164,4 +166,4 @@
 
 }} // namespace certi/rtia
 
-// $Id: RTIA.cc,v 3.13.2.1 2008/03/18 15:55:57 erk Exp $
+// $Id: RTIA.cc,v 3.13.2.2 2008/04/21 11:29:34 erk Exp $

Index: Communications.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/Communications.cc,v
retrieving revision 3.22.2.3
retrieving revision 3.22.2.4
diff -u -b -r3.22.2.3 -r3.22.2.4
--- Communications.cc   10 Apr 2008 14:57:48 -0000      3.22.2.3
+++ Communications.cc   21 Apr 2008 11:29:34 -0000      3.22.2.4
@@ -18,7 +18,7 @@
 // along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: Communications.cc,v 3.22.2.3 2008/04/10 14:57:48 erk Exp $
+// $Id: Communications.cc,v 3.22.2.4 2008/04/21 11:29:34 erk Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -272,7 +272,7 @@
             n = 2 ;
         }
     }
-}
+} /* end of readMessage */
 
 // ----------------------------------------------------------------------------
 /*! Returns true if a 'type_msg' message coming from federate
@@ -328,4 +328,4 @@
 
 }} // namespace certi/rtia
 
-// $Id: Communications.cc,v 3.22.2.3 2008/04/10 14:57:48 erk Exp $
+// $Id: Communications.cc,v 3.22.2.4 2008/04/21 11:29:34 erk Exp $




reply via email to

[Prev in Thread] Current Thread [Next in Thread]