certi-cvs
[Top][All Lists]
Advanced

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

certi/RTIA Communications.cc Communications.hh ...


From: certi-cvs
Subject: certi/RTIA Communications.cc Communications.hh ...
Date: Fri, 22 Feb 2008 11:34:31 +0000

CVSROOT:        /sources/certi
Module name:    certi
Changes by:     Pierre Siron <siron>    08/02/22 11:34:31

Modified files:
        RTIA           : Communications.cc Communications.hh 
                         FederationManagement.cc ObjectManagement.cc 
                         OwnershipManagement.cc TimeManagement.cc 

Log message:
        Simplification of the dialogue between the RTIA and the federate
        during the execution of a callback.
        A single message is sent from the RTIA to the federate (the federate
        is ticking), the federate does not answer with a message anymore.
        So the second message in parameter of the requestFederateService
        function is removed (the first message in parameter is the encoded
        callback).
        This simplification concerns the performance issue, it has allowed
        also the reentrance implementation.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/Communications.cc?cvsroot=certi&r1=3.21&r2=3.22
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/Communications.hh?cvsroot=certi&r1=3.9&r2=3.10
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/FederationManagement.cc?cvsroot=certi&r1=3.46&r2=3.47
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/ObjectManagement.cc?cvsroot=certi&r1=3.31&r2=3.32
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/OwnershipManagement.cc?cvsroot=certi&r1=3.11&r2=3.12
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/TimeManagement.cc?cvsroot=certi&r1=3.25&r2=3.26

Patches:
Index: Communications.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/Communications.cc,v
retrieving revision 3.21
retrieving revision 3.22
diff -u -b -r3.21 -r3.22
--- Communications.cc   18 Feb 2008 13:37:29 -0000      3.21
+++ Communications.cc   22 Feb 2008 11:34:30 -0000      3.22
@@ -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.21 2008/02/18 13:37:29 siron Exp $
+// $Id: Communications.cc,v 3.22 2008/02/22 11:34:30 siron Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -150,7 +150,7 @@
 // ----------------------------------------------------------------------------
 //! Request a service to federate.
 void
-Communications::requestFederateService(Message *req, Message *rep)
+Communications::requestFederateService(Message *req)
 {
     // G.Out(pdGendoc,"enter Communications::requestFederateService for 
message "
     //               "type %d",req->type);
@@ -339,4 +339,4 @@
 
 }} // namespace certi/rtia
 
-// $Id: Communications.cc,v 3.21 2008/02/18 13:37:29 siron Exp $
+// $Id: Communications.cc,v 3.22 2008/02/22 11:34:30 siron Exp $

Index: Communications.hh
===================================================================
RCS file: /sources/certi/certi/RTIA/Communications.hh,v
retrieving revision 3.9
retrieving revision 3.10
diff -u -b -r3.9 -r3.10
--- Communications.hh   30 Apr 2005 16:38:39 -0000      3.9
+++ Communications.hh   22 Feb 2008 11:34:30 -0000      3.10
@@ -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.hh,v 3.9 2005/04/30 16:38:39 breholee Exp $
+// $Id: Communications.hh,v 3.10 2008/02/22 11:34:30 siron Exp $
 // ----------------------------------------------------------------------------
 
 #ifndef _CERTI_COMMUNICATIONS_HH
@@ -55,7 +55,7 @@
     void sendUN(Message *Msg);
     void receiveUN(Message *Msg);
     void readMessage(int&, NetworkMessage *, Message *);
-    void requestFederateService(Message *req, Message *rep);
+    void requestFederateService(Message *req);
     unsigned long getAddress();
     unsigned int getPort();
     void waitMessage(NetworkMessage *msg,
@@ -74,4 +74,4 @@
 
 #endif // _CERTI_COMMUNICATIONS_HH
 
-// $Id: Communications.hh,v 3.9 2005/04/30 16:38:39 breholee Exp $
+// $Id: Communications.hh,v 3.10 2008/02/22 11:34:30 siron Exp $

Index: FederationManagement.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/FederationManagement.cc,v
retrieving revision 3.46
retrieving revision 3.47
diff -u -b -r3.46 -r3.47
--- FederationManagement.cc     15 Feb 2008 14:16:19 -0000      3.46
+++ FederationManagement.cc     22 Feb 2008 11:34:30 -0000      3.47
@@ -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: FederationManagement.cc,v 3.46 2008/02/15 14:16:19 rousse Exp $
+// $Id: FederationManagement.cc,v 3.47 2008/02/22 11:34:30 siron Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -623,7 +623,7 @@
 {
     D.Out(pdInit, "Announce Synchronization Point \"%s\"(%s).", label, tag);
 
-    Message req, rep ;
+    Message req;
 
     assert(label != NULL);
 
@@ -644,7 +644,7 @@
     if (!exists)
         synchronizationLabels.push_back(strdup(label));
 
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 }
 
 // ----------------------------------------------------------------------------
@@ -654,7 +654,7 @@
     D.Out(pdInit, "Synchronization Point Registration Failed \"%s\".",
           label);
 
-    Message req, rep ;
+    Message req;
 
     G.Out(pdGendoc,"enter 
FederationManagement::synchronizationPointRegistrationFailed");
 
@@ -663,7 +663,7 @@
     req.type = Message::SYNCHRONIZATION_POINT_REGISTRATION_FAILED ;
     req.setLabel(label);
 
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 
     G.Out(pdGendoc,"exit  
FederationManagement::synchronizationPointRegistrationFailed");
 
@@ -676,7 +676,7 @@
     D.Out(pdInit, "Synchronization Point Registration Succeeded \"%s\".",
           label);
 
-    Message req, rep ;
+    Message req;
 
     G.Out(pdGendoc,"enter 
FederationManagement::synchronizationPointRegistrationSucceeded");
 
@@ -685,7 +685,7 @@
     req.type = Message::SYNCHRONIZATION_POINT_REGISTRATION_SUCCEEDED ;
     req.setLabel(label);
 
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 
     G.Out(pdGendoc,"exit  
FederationManagement::synchronizationPointRegistrationSucceeded");
 
@@ -697,14 +697,14 @@
 {
     D.Out(pdInit, "Federation Synchronized \"%s\".", label);
 
-    Message req, rep ;
+    Message req;
 
     assert(label != NULL);
 
     req.type = Message::FEDERATION_SYNCHRONIZED ;
     req.setLabel(label);
 
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 }
 
 // ----------------------------------------------------------------------------
@@ -829,14 +829,14 @@
 
     savingState = true ;
 
-    Message req, rep ;
+    Message req;
 
     assert(label != 0);
 
     req.type = Message::INITIATE_FEDERATE_SAVE ;
     req.setLabel(label);
 
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 
     G.Out(pdGendoc,"exit  FederationManagement::initiateFederateSave");
 }
@@ -850,11 +850,11 @@
 
     savingState = false ;
 
-    Message req, rep ;
+    Message req;
 
     req.type = status ? Message::FEDERATION_SAVED : 
Message::FEDERATION_NOT_SAVED ;
 
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 
     G.Out(pdGendoc,"exit  FederationManagement::federationSavedStatus");
 }
@@ -914,7 +914,7 @@
     D.Out(pdInit, "Federation restore request %saccepted",
           status ? "" : "not ");
 
-    Message req, rep ;
+    Message req;
 
     req.setLabel(label);
 
@@ -925,7 +925,7 @@
         req.setTag(reason);
     }
 
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
     G.Out(pdGendoc,"exit  
FederationManagement::requestFederationRestoreStatus");
 }
 
@@ -936,10 +936,10 @@
     G.Out(pdGendoc,"enter FederationManagement::federationRestoreBegun");
     D.Out(pdInit, "Federation restore begun");
 
-    Message req, rep ;
+    Message req;
     req.type = Message::FEDERATION_RESTORE_BEGUN ;
 
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 
     G.Out(pdGendoc,"exit  FederationManagement::federationRestoreBegun");
 }
@@ -955,12 +955,12 @@
 
     restoringState = true ;
 
-    Message req, rep ;
+    Message req;
     req.type = Message::INITIATE_FEDERATE_RESTORE ;
     req.setFederate(handle);
     req.setLabel(label);
 
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
     G.Out(pdGendoc,"exit  FederationManagement::initiateFederateRestore");
 }
 
@@ -972,14 +972,14 @@
 
     restoringState = false ;
 
-    Message req, rep ;
+    Message req;
 
     if (status)
         req.type = Message::FEDERATION_RESTORED ;
     else
         req.type = Message::FEDERATION_NOT_RESTORED ;
 
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 }
 
 // ----------------------------------------------------------------------------
@@ -1004,4 +1004,4 @@
 
 }} // namespace certi/rtia
 
-// $Id: FederationManagement.cc,v 3.46 2008/02/15 14:16:19 rousse Exp $
+// $Id: FederationManagement.cc,v 3.47 2008/02/22 11:34:30 siron Exp $

Index: ObjectManagement.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/ObjectManagement.cc,v
retrieving revision 3.31
retrieving revision 3.32
diff -u -b -r3.31 -r3.32
--- ObjectManagement.cc 5 Dec 2007 12:29:39 -0000       3.31
+++ ObjectManagement.cc 22 Feb 2008 11:34:30 -0000      3.32
@@ -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: ObjectManagement.cc,v 3.31 2007/12/05 12:29:39 approx Exp $
+// $Id: ObjectManagement.cc,v 3.32 2008/02/22 11:34:30 siron Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -193,7 +193,7 @@
                                  EventRetractionHandle the_event,
                                  TypeException &)
 {
-    Message req, rep ;
+    Message req;
 
     req.type = Message::DISCOVER_OBJECT_INSTANCE ;
     req.setObject(the_object);
@@ -202,7 +202,7 @@
     req.setEventRetraction(the_event);
     req.setName(the_name);
 
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 
     // Adding discovered object in federate internal object list.
     rootObject->registerObjectInstance(fm->federate, the_class, the_object,
@@ -221,7 +221,7 @@
                                          EventRetractionHandle the_event,
                                          TypeException &)
 {
-    Message req, rep ;
+    Message req;
 
     req.type = Message::REFLECT_ATTRIBUTE_VALUES ;
     req.setObject(the_object);
@@ -232,7 +232,7 @@
     // true for RAV without time
     req.setBoolean(true);
 
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 }
 
 // ----------------------------------------------------------------------------
@@ -245,7 +245,7 @@
                                          const char *the_tag,
                                          TypeException &)
 {
-    Message req, rep ;
+    Message req;
 
     req.type = Message::REFLECT_ATTRIBUTE_VALUES ;
     req.setObject(the_object);
@@ -254,7 +254,7 @@
     // false for RAV without time
     req.setBoolean(false);
 
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 }
 
 // ----------------------------------------------------------------------------
@@ -362,7 +362,7 @@
                                      EventRetractionHandle the_event,
                                      TypeException &)
 {
-    Message req, rep ;
+    Message req;
 
     req.type = Message::RECEIVE_INTERACTION ;
     req.setInteractionClass(the_interaction);
@@ -371,8 +371,7 @@
     req.setTag(the_tag);
     req.setParameters(the_parameters, the_values, the_size);
     req.setBoolean(true);
-    // BUG: On fait quoi de la reponse ?
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 }
 
 // ----------------------------------------------------------------------------
@@ -385,15 +384,14 @@
                                      const char *the_tag,
                                      TypeException &)
 {
-    Message req, rep ;
+    Message req;
 
     req.type = Message::RECEIVE_INTERACTION ;
     req.setInteractionClass(the_interaction);
     req.setTag(the_tag);
     req.setParameters(the_parameters, the_values, the_size);
     req.setBoolean(false);
-    // BUG: On fait quoi de la reponse ?
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 }
 
 // ----------------------------------------------------------------------------
@@ -462,7 +460,7 @@
                                EventRetractionHandle the_event,
                                TypeException &)
 {
-    Message req, rep ;
+    Message req;
 
     req.type = Message::REMOVE_OBJECT_INSTANCE ;
     req.setObject(the_object);
@@ -470,8 +468,7 @@
     req.setTag(the_tag);
     req.setBoolean(true);
 
-    // BUG: On fait quoi de la reponse ?
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 
     rootObject->deleteObjectInstance(the_federate, the_object, theTime, 
the_tag);
 }
@@ -484,15 +481,14 @@
                                const char *the_tag,
                                TypeException &)
 {
-    Message req, rep ;
+    Message req;
 
     req.type = Message::REMOVE_OBJECT_INSTANCE ;
     req.setObject(the_object);
     req.setTag(the_tag);
     req.setBoolean(false);
     
-    // BUG: On fait quoi de la reponse ?
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 
     rootObject->deleteObjectInstance(the_federate, the_object, the_tag);
 }
@@ -770,4 +766,4 @@
 
 }} // namespace certi/rtia
 
-// $Id: ObjectManagement.cc,v 3.31 2007/12/05 12:29:39 approx Exp $
+// $Id: ObjectManagement.cc,v 3.32 2008/02/22 11:34:30 siron Exp $

Index: OwnershipManagement.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/OwnershipManagement.cc,v
retrieving revision 3.11
retrieving revision 3.12
diff -u -b -r3.11 -r3.12
--- OwnershipManagement.cc      6 Jul 2007 09:25:20 -0000       3.11
+++ OwnershipManagement.cc      22 Feb 2008 11:34:31 -0000      3.12
@@ -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: OwnershipManagement.cc,v 3.11 2007/07/06 09:25:20 erk Exp $
+// $Id: OwnershipManagement.cc,v 3.12 2008/02/22 11:34:31 siron Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -367,14 +367,14 @@
                                               FederateHandle the_owner,
                                               TypeException &)
 {
-    Message req, rep ;
+    Message req;
 
     req.type = Message::INFORM_ATTRIBUTE_OWNERSHIP ;
     req.setObject(the_object);
     req.setAttribute(the_attribute);
     req.setFederate(the_owner);
 
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 }
 
 // ----------------------------------------------------------------------------
@@ -385,14 +385,14 @@
                                          FederateHandle,
                                          TypeException &)
 {
-    Message req, rep ;
+    Message req;
 
     req.type = Message::ATTRIBUTE_IS_NOT_OWNED ;
     req.setObject(the_object);
     req.setAttribute(the_attribute);
     // req.setFederate(the_owner);
 
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 }
 
 // ----------------------------------------------------------------------------
@@ -405,13 +405,13 @@
                               FederateHandle,
                               TypeException &)
 {
-    Message req, rep ;
+    Message req;
 
     req.type = Message::ATTRIBUTE_OWNERSHIP_UNAVAILABLE ;
     req.setObject(the_object);
     req.setAttributes(the_attributes, the_size);
 
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 }
 
 // ----------------------------------------------------------------------------
@@ -424,13 +424,13 @@
                                           FederateHandle,
                                           TypeException &)
 {
-    Message req, rep ;
+    Message req;
 
     req.type = Message::ATTRIBUTE_OWNERSHIP_ACQUISITION_NOTIFICATION ;
     req.setObject(the_object);
     req.setAttributes(the_attributes, the_size);
 
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 }
 
 // ----------------------------------------------------------------------------
@@ -444,14 +444,14 @@
                                     char *the_tag,
                                     TypeException &)
 {
-    Message req, rep ;
+    Message req;
 
     req.type = Message::REQUEST_ATTRIBUTE_OWNERSHIP_ASSUMPTION ;
     req.setObject(the_object);
     req.setAttributes(the_attributes, the_size);
     req.setTag(the_tag);
 
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 }
 
 // ----------------------------------------------------------------------------
@@ -464,14 +464,14 @@
                                  char *the_tag,
                                  TypeException &)
 {
-    Message req, rep ;
+    Message req;
 
     req.type = Message::REQUEST_ATTRIBUTE_OWNERSHIP_RELEASE ;
     req.setObject(the_object);
     req.setAttributes(the_attributes, the_size);
     req.setTag(the_tag);
 
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 }
 
 // ----------------------------------------------------------------------------
@@ -483,13 +483,13 @@
                                           UShort the_size,
                                           TypeException &)
 {
-    Message req, rep ;
+    Message req;
 
     req.type = Message::ATTRIBUTE_OWNERSHIP_DIVESTITURE_NOTIFICATION ;
     req.setObject(the_object);
     req.setAttributes(the_attributes, the_size);
 
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 }
 
 // ----------------------------------------------------------------------------
@@ -501,16 +501,15 @@
                                                  UShort the_size,
                                                  TypeException &)
 {
-    Message req ;
+    Message req;
 
     req.type = Message::CONFIRM_ATTRIBUTE_OWNERSHIP_ACQUISITION_CANCELLATION ;
     req.setObject(the_object);
     req.setAttributes(the_attributes, the_size);
 
-    Message rep ;
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 }
 
 }} // namespace certi/rtia
 
-// $Id: OwnershipManagement.cc,v 3.11 2007/07/06 09:25:20 erk Exp $
+// $Id: OwnershipManagement.cc,v 3.12 2008/02/22 11:34:31 siron Exp $

Index: TimeManagement.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/TimeManagement.cc,v
retrieving revision 3.25
retrieving revision 3.26
diff -u -b -r3.25 -r3.26
--- TimeManagement.cc   18 Feb 2008 13:37:30 -0000      3.25
+++ TimeManagement.cc   22 Feb 2008 11:34:31 -0000      3.26
@@ -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: TimeManagement.cc,v 3.25 2008/02/18 13:37:30 siron Exp $
+// $Id: TimeManagement.cc,v 3.26 2008/02/22 11:34:31 siron Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -710,7 +710,7 @@
 TimeManagement::timeAdvanceGrant(FederationTime logical_time,
                                  TypeException &e)
 {
-    Message req, rep ;
+    Message req;
 
     req.type = Message::TIME_ADVANCE_GRANT ;
     req.setFederationTime(logical_time);
@@ -721,11 +721,8 @@
     _ongoing_tick = false ;  // end of the blocking tick, a message is 
delivered
     _tick_request_ack = false ;
 
-    comm->requestFederateService(&req, &rep);
+    comm->requestFederateService(&req);
 
-    e = rep.getExceptionType();
-
-    if (e == e_NO_EXCEPTION)
         _heure_courante = logical_time ;
 }
 
@@ -766,4 +763,4 @@
 
 }} // namespaces
 
-// $Id: TimeManagement.cc,v 3.25 2008/02/18 13:37:30 siron Exp $
+// $Id: TimeManagement.cc,v 3.26 2008/02/22 11:34:31 siron Exp $




reply via email to

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