certi-cvs
[Top][All Lists]
Advanced

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

certi RTIA/FederationManagement.cc RTIA/RTIA_fe...


From: certi-cvs
Subject: certi RTIA/FederationManagement.cc RTIA/RTIA_fe...
Date: Tue, 13 Nov 2007 13:25:41 +0000

CVSROOT:        /sources/certi
Module name:    certi
Changes by:     ROUSSELOT <rousse>      07/11/13 13:25:41

Modified files:
        RTIA           : FederationManagement.cc RTIA_federate.cc 
        RTIG           : Federation.cc FederationsList.cc 
                         RTIG_processing.cc 
        libCERTI       : Exception.hh Message.cc Message_R.cc 
                         Message_W.cc NetworkMessage.cc 
                         NetworkMessage.hh NetworkMessage_RW.cc 
        libRTI         : RTIambPrivateRefs.cc RTIambassador.cc 

Log message:
        Exception raised in RTIG returns reason to RTIA

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/FederationManagement.cc?cvsroot=certi&r1=3.32&r2=3.33
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/RTIA_federate.cc?cvsroot=certi&r1=3.48&r2=3.49
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/Federation.cc?cvsroot=certi&r1=3.67&r2=3.68
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/FederationsList.cc?cvsroot=certi&r1=3.42&r2=3.43
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/RTIG_processing.cc?cvsroot=certi&r1=3.41&r2=3.42
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Exception.hh?cvsroot=certi&r1=3.2&r2=3.3
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Message.cc?cvsroot=certi&r1=3.39&r2=3.40
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Message_R.cc?cvsroot=certi&r1=3.7&r2=3.8
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Message_W.cc?cvsroot=certi&r1=3.8&r2=3.9
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NetworkMessage.cc?cvsroot=certi&r1=3.20&r2=3.21
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NetworkMessage.hh?cvsroot=certi&r1=3.25&r2=3.26
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NetworkMessage_RW.cc?cvsroot=certi&r1=3.31&r2=3.32
http://cvs.savannah.gnu.org/viewcvs/certi/libRTI/RTIambPrivateRefs.cc?cvsroot=certi&r1=3.4&r2=3.5
http://cvs.savannah.gnu.org/viewcvs/certi/libRTI/RTIambassador.cc?cvsroot=certi&r1=3.56&r2=3.57

Patches:
Index: RTIA/FederationManagement.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/FederationManagement.cc,v
retrieving revision 3.32
retrieving revision 3.33
diff -u -b -r3.32 -r3.33
--- RTIA/FederationManagement.cc        6 Nov 2007 08:57:24 -0000       3.32
+++ RTIA/FederationManagement.cc        13 Nov 2007 13:25:39 -0000      3.33
@@ -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.32 2007/11/06 08:57:24 rousse Exp $
+// $Id: FederationManagement.cc,v 3.33 2007/11/13 13:25:39 rousse Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -137,9 +137,13 @@
             D.Out(pdInit, "est createur");
         }
         else if (reponse.exception == e_CouldNotOpenFED)
+            // RTIG encounters a problem creating federation execution
             {
             e = reponse.exception;
             cout << "Could not open FED." << endl;
+            G.Out(pdGendoc,"exit FederationManagement::"
+                           "createFederationExecution on exception");
+            throw CouldNotOpenFED (reponse.exceptionReason) ;
             }           
         else {
             e = reponse.exception ;
@@ -913,4 +917,4 @@
 
 }} // namespace certi/rtia
 
-// $Id: FederationManagement.cc,v 3.32 2007/11/06 08:57:24 rousse Exp $
+// $Id: FederationManagement.cc,v 3.33 2007/11/13 13:25:39 rousse Exp $

Index: RTIA/RTIA_federate.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/RTIA_federate.cc,v
retrieving revision 3.48
retrieving revision 3.49
diff -u -b -r3.48 -r3.49
--- RTIA/RTIA_federate.cc       12 Nov 2007 14:49:10 -0000      3.48
+++ RTIA/RTIA_federate.cc       13 Nov 2007 13:25:39 -0000      3.49
@@ -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_federate.cc,v 3.48 2007/11/12 14:49:10 siron Exp $
+// $Id: RTIA_federate.cc,v 3.49 2007/11/13 13:25:39 rousse Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -91,6 +91,8 @@
 RTIA::chooseFederateProcessing(Message *req, Message &rep, TypeException &e)
         throw (CouldNotOpenFED)
 {
+    G.Out(pdGendoc,"enter RTIA::chooseFederateProcessing");
+
     // Verify not in saving or restoring state.
     saveAndRestoreStatus(req->type);
 
@@ -873,6 +875,8 @@
 {
     Message rep ;
 
+    G.Out(pdGendoc,"enter RTIA::processFederateRequest");
+
     //rep.setException(e_NO_EXCEPTION);
     rep.type = req->type ;
 
@@ -939,7 +943,7 @@
     }
     catch (CouldNotOpenFED &e) {
         D.Out(pdExcept, "Catched %s Exception.", e._name);
-        rep.setException(e_CouldNotOpenFED);
+        rep.setException(e_CouldNotOpenFED,e._reason);
     }
     catch (CouldNotRestore &e) {
         D.Out(pdExcept, "Catched %s Exception.", e._name);
@@ -1217,4 +1221,4 @@
 
 }} // namespace certi/rtia
 
-// $Id: RTIA_federate.cc,v 3.48 2007/11/12 14:49:10 siron Exp $
+// $Id: RTIA_federate.cc,v 3.49 2007/11/13 13:25:39 rousse Exp $

Index: RTIG/Federation.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/Federation.cc,v
retrieving revision 3.67
retrieving revision 3.68
diff -u -b -r3.67 -r3.68
--- RTIG/Federation.cc  31 Oct 2007 10:30:24 -0000      3.67
+++ RTIG/Federation.cc  13 Nov 2007 13:25:40 -0000      3.68
@@ -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: Federation.cc,v 3.67 2007/10/31 10:30:24 erk Exp $
+// $Id: Federation.cc,v 3.68 2007/11/13 13:25:40 rousse Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -218,6 +218,8 @@
     if (!filefound) {
       cout << " --> cannot access." <<endl;
       cerr << "Next step will fail"<<endl;
+      G.Out(pdGendoc,"exit Federation::Federation on exception");
+      throw CouldNotOpenFED("RTIG cannot find FED file.");
     }
 
     // now really assign FEDid
@@ -229,7 +231,7 @@
     if ( (fftry=fopen(FEDid,"r")) == NULL)
         {
         cout << "... failed : ";
-        throw CouldNotOpenFED("FED file unknown.");
+        throw CouldNotOpenFED("RTIG have found but cannot open FED file");
         }
     else
         {
@@ -242,8 +244,11 @@
     bool is_an_xml      = false ;
     
     // hope there is a . before fed or xml
-    if ( filename.at(nbcar_filename-4) != '.' )
-        throw CouldNotOpenFED("FED file incorrect filename, cannot find 
extension (character '.' is missing [or not in reverse 4th place])");
+    if ( filename[nbcar_filename-4] != '.' )
+        {
+        throw CouldNotOpenFED("Incorrect FED file name, cannot find "
+         "extension (character '.' is missing [or not in reverse 4th place])");
+        }       
 
     string extension = filename.substr(nbcar_filename-3,3) ;
     D.Out(pdTrace,"filename is: %s (extension is 
<%s>",filename.c_str(),extension.c_str());
@@ -258,7 +263,7 @@
         D.Out(pdTrace, "Trying to use .xml file");
         } 
     else {
-        throw CouldNotOpenFED("FED file incorrect filename : nor .fed nor .xml 
file");
+        throw CouldNotOpenFED("Incorrect FED file name : nor .fed nor .xml 
file");
     }
        
     ifstream fdd(filename.c_str());
@@ -313,7 +318,7 @@
             }
             else {
                 cout << "nor fed nor xml" << endl ;
-               throw CouldNotOpenFED("");
+               throw CouldNotOpenFED("Incorrect FED file name : nor fed nor 
xml");
            }
         }
     }
@@ -2188,5 +2193,5 @@
 
 }} // namespace certi/rtig
 
-// $Id: Federation.cc,v 3.67 2007/10/31 10:30:24 erk Exp $
+// $Id: Federation.cc,v 3.68 2007/11/13 13:25:40 rousse Exp $
 

Index: RTIG/FederationsList.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/FederationsList.cc,v
retrieving revision 3.42
retrieving revision 3.43
diff -u -b -r3.42 -r3.43
--- RTIG/FederationsList.cc     16 Oct 2007 09:25:44 -0000      3.42
+++ RTIG/FederationsList.cc     13 Nov 2007 13:25:40 -0000      3.43
@@ -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: FederationsList.cc,v 3.42 2007/10/16 09:25:44 erk Exp $
+// $Id: FederationsList.cc,v 3.43 2007/11/13 13:25:40 rousse Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -193,9 +193,9 @@
         D.Out(pdDebug,"new Federation created.");
         }
     catch (RTI::CouldNotOpenFED& e) {
-        cout << e._reason << endl;
         D.Out(pdInit, "Federation constructor : Could not open FED file.");
-        throw CouldNotOpenFED("Could not open FED file.");
+        G.Out(pdGendoc,"exit FederationsList::createFederation on exception");
+        throw CouldNotOpenFED(e._reason);
         }
 
     
@@ -1474,5 +1474,5 @@
 
 }} // certi::rtig
 
-// EOF $Id: FederationsList.cc,v 3.42 2007/10/16 09:25:44 erk Exp $
+// EOF $Id: FederationsList.cc,v 3.43 2007/11/13 13:25:40 rousse Exp $
 

Index: RTIG/RTIG_processing.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/RTIG_processing.cc,v
retrieving revision 3.41
retrieving revision 3.42
diff -u -b -r3.41 -r3.42
--- RTIG/RTIG_processing.cc     28 Sep 2007 14:07:54 -0000      3.41
+++ RTIG/RTIG_processing.cc     13 Nov 2007 13:25:40 -0000      3.42
@@ -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: RTIG_processing.cc,v 3.41 2007/09/28 14:07:54 rousse Exp $
+// $Id: RTIG_processing.cc,v 3.42 2007/11/13 13:25:40 rousse Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -42,6 +42,7 @@
 {
     char *federation = req->federationName ;
     char *FEDid = req->FEDid ;
+    NetworkMessage rep ;               // rep for answer to RTIA
 
     G.Out(pdGendoc,"BEGIN ** CREATE FEDERATION SERVICE **");
     G.Out(pdGendoc,"enter RTIG::processCreateFederation");
@@ -71,13 +72,20 @@
     ClientSockets.push_front(com_mc);
 
 #else
+    // We catch createFederation because it is useful to send
+    // exception reason to RTIA 
+    try {
     federations.createFederation(federation, h, FEDid);
+        }
+    catch (CouldNotOpenFED e)
+        {
+        rep.exception = e_CouldNotOpenFED ;
+        strcpy(rep.exceptionReason,e._reason) ;
+        }
 #endif
 
-    // Prepare answer for RTIA
-    NetworkMessage rep ;
+    // Prepare answer for RTIA : store NetworkMessage rep
     rep.type = NetworkMessage::CREATE_FEDERATION_EXECUTION ;
-    rep.exception = e_NO_EXCEPTION ;
     rep.federation = h ;
     strcpy(rep.FEDid,FEDid) ;
 
@@ -1277,4 +1285,4 @@
 
 }} // namespace certi/rtig
 
-// $Id: RTIG_processing.cc,v 3.41 2007/09/28 14:07:54 rousse Exp $
+// $Id: RTIG_processing.cc,v 3.42 2007/11/13 13:25:40 rousse Exp $

Index: libCERTI/Exception.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/Exception.hh,v
retrieving revision 3.2
retrieving revision 3.3
diff -u -b -r3.2 -r3.3
--- libCERTI/Exception.hh       12 Nov 2007 14:49:10 -0000      3.2
+++ libCERTI/Exception.hh       13 Nov 2007 13:25:40 -0000      3.3
@@ -20,13 +20,13 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: Exception.hh,v 3.2 2007/11/12 14:49:10 siron Exp $
+// $Id: Exception.hh,v 3.3 2007/11/13 13:25:40 rousse Exp $
 // ----------------------------------------------------------------------------
 
 #ifndef _CERTI_EXCEPTION_HH
 #define _CERTI_EXCEPTION_HH
 
-#define MAX_EXCEPTION_REASON_LENGTH 100
+#define MAX_EXCEPTION_REASON_LENGTH 130
 
 namespace certi {
 
@@ -120,4 +120,4 @@
 
 #endif // _CERTI_EXCEPTION_HH
 
-// $Id: Exception.hh,v 3.2 2007/11/12 14:49:10 siron Exp $
+// $Id: Exception.hh,v 3.3 2007/11/13 13:25:40 rousse Exp $

Index: libCERTI/Message.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Message.cc,v
retrieving revision 3.39
retrieving revision 3.40
diff -u -b -r3.39 -r3.40
--- libCERTI/Message.cc 10 Aug 2007 14:45:13 -0000      3.39
+++ libCERTI/Message.cc 13 Nov 2007 13:25:40 -0000      3.40
@@ -637,6 +637,8 @@
     printf(" -- MESSAGE - %s -", s);
     if ( type == CREATE_FEDERATION_EXECUTION )
       printf("CREATE_FEDERATION_EXECUTION : federation %s : filename 
%s\n",federationName,FEDid) ;
+    if ( type == DESTROY_FEDERATION_EXECUTION )
+      printf("DESTROY_FEDERATION_EXECUTION : federation %s : 
\n",federationName) ;
     else if ( type == JOIN_FEDERATION_EXECUTION )
       printf("JOIN_FEDERATION_EXECUTION\n") ;
     else

Index: libCERTI/Message_R.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Message_R.cc,v
retrieving revision 3.7
retrieving revision 3.8
diff -u -b -r3.7 -r3.8
--- libCERTI/Message_R.cc       5 Nov 2007 14:30:04 -0000       3.7
+++ libCERTI/Message_R.cc       13 Nov 2007 13:25:40 -0000      3.8
@@ -17,7 +17,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: Message_R.cc,v 3.7 2007/11/05 14:30:04 rousse Exp $
+// $Id: Message_R.cc,v 3.8 2007/11/13 13:25:40 rousse Exp $
 // ----------------------------------------------------------------------------
 
 
@@ -76,6 +76,7 @@
         switch(header.type) {
 
           // Body contains federationName, FEDid
+          // Note : relevant only on federate request
           case CREATE_FEDERATION_EXECUTION:
             readFederationName(body);
             readFEDid(body) ;
@@ -702,4 +703,4 @@
 
 } // namespace certi
 
-// $Id: Message_R.cc,v 3.7 2007/11/05 14:30:04 rousse Exp $
+// $Id: Message_R.cc,v 3.8 2007/11/13 13:25:40 rousse Exp $

Index: libCERTI/Message_W.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Message_W.cc,v
retrieving revision 3.8
retrieving revision 3.9
diff -u -b -r3.8 -r3.9
--- libCERTI/Message_W.cc       5 Nov 2007 14:30:04 -0000       3.8
+++ libCERTI/Message_W.cc       13 Nov 2007 13:25:40 -0000      3.9
@@ -17,7 +17,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: Message_W.cc,v 3.8 2007/11/05 14:30:04 rousse Exp $
+// $Id: Message_W.cc,v 3.9 2007/11/13 13:25:40 rousse Exp $
 // ----------------------------------------------------------------------------
 
 
@@ -75,6 +75,7 @@
         switch(header.type) {
 
           // Body contains federationName,FEDid
+          // Note : relevant only on federate request
           case CREATE_FEDERATION_EXECUTION:
             body.writeString(federationName);
             body.writeString(FEDid);
@@ -687,4 +688,4 @@
 
 } // namespace certi
 
-// $Id: Message_W.cc,v 3.8 2007/11/05 14:30:04 rousse Exp $
+// $Id: Message_W.cc,v 3.9 2007/11/13 13:25:40 rousse Exp $

Index: libCERTI/NetworkMessage.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/NetworkMessage.cc,v
retrieving revision 3.20
retrieving revision 3.21
diff -u -b -r3.20 -r3.21
--- libCERTI/NetworkMessage.cc  10 Aug 2007 14:45:13 -0000      3.20
+++ libCERTI/NetworkMessage.cc  13 Nov 2007 13:25:40 -0000      3.21
@@ -16,7 +16,7 @@
 // License along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: NetworkMessage.cc,v 3.20 2007/08/10 14:45:13 erk Exp $
+// $Id: NetworkMessage.cc,v 3.21 2007/11/13 13:25:40 rousse Exp $
 // ----------------------------------------------------------------------------
 
 
@@ -58,6 +58,8 @@
 NetworkMessage::NetworkMessage()
     : type(NOT_USED), exception(e_NO_EXCEPTION)
 {
+    exceptionReason[0] = '\0' ;
+
     number = 0 ;
 
     federation = 0 ;
@@ -317,4 +319,4 @@
 }
 } // namespace certi
 
-// $Id: NetworkMessage.cc,v 3.20 2007/08/10 14:45:13 erk Exp $
+// $Id: NetworkMessage.cc,v 3.21 2007/11/13 13:25:40 rousse Exp $

Index: libCERTI/NetworkMessage.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/NetworkMessage.hh,v
retrieving revision 3.25
retrieving revision 3.26
diff -u -b -r3.25 -r3.26
--- libCERTI/NetworkMessage.hh  22 Jun 2007 08:51:37 -0000      3.25
+++ libCERTI/NetworkMessage.hh  13 Nov 2007 13:25:40 -0000      3.26
@@ -17,7 +17,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: NetworkMessage.hh,v 3.25 2007/06/22 08:51:37 erk Exp $
+// $Id: NetworkMessage.hh,v 3.26 2007/11/13 13:25:40 rousse Exp $
 // ----------------------------------------------------------------------------
 
 #ifndef CERTI_NETWORK_MESSAGE_HH
@@ -40,8 +40,6 @@
 #define PORT_TCP_RTIG "60400"
 #define PORT_UDP_RTIG "60500"
 
-#define MAX_EXCEPTION_REASON_LENGTH 100
-
 namespace certi {
 
 class CERTI_EXPORT NetworkMessage : public BasicMessage
@@ -237,6 +235,7 @@
 
     Type type ;
     TypeException exception ;
+    char exceptionReason[MAX_EXCEPTION_REASON_LENGTH + 1] ;
 
     UShort number ;
 
@@ -323,4 +322,4 @@
 
 #endif // CERTI_NETWORK_MESSAGE_HH
 
-// $Id: NetworkMessage.hh,v 3.25 2007/06/22 08:51:37 erk Exp $
+// $Id: NetworkMessage.hh,v 3.26 2007/11/13 13:25:40 rousse Exp $

Index: libCERTI/NetworkMessage_RW.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/NetworkMessage_RW.cc,v
retrieving revision 3.31
retrieving revision 3.32
diff -u -b -r3.31 -r3.32
--- libCERTI/NetworkMessage_RW.cc       28 Sep 2007 14:07:54 -0000      3.31
+++ libCERTI/NetworkMessage_RW.cc       13 Nov 2007 13:25:40 -0000      3.32
@@ -16,7 +16,7 @@
 // License along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: NetworkMessage_RW.cc,v 3.31 2007/09/28 14:07:54 rousse Exp $
+// $Id: NetworkMessage_RW.cc,v 3.32 2007/11/13 13:25:40 rousse Exp $
 // ----------------------------------------------------------------------------
 
 
@@ -61,6 +61,10 @@
        //D.Mes(pdMessage, 'N',Header.type);
        this->trace("NetworkMessage::readBody ");
 
+    if (Header.exception != e_NO_EXCEPTION) {
+        body.readString(exceptionReason, MAX_EXCEPTION_REASON_LENGTH);
+    }
+    else {
     switch(Header.type) {
       case GET_FED_FILE:
         number = body.readShortInt();
@@ -284,6 +288,7 @@
        D.Out(pdExcept, "Unknown type %d in ReadBody.", Header.type);
        throw RTIinternalError("Unknown/Unimplemented type for body.");
     }
+    }
 
 }
 
@@ -299,6 +304,11 @@
     exception = Header.exception ;
     federate = Header.federate ;
     federation = Header.federation ;
+    // If the message carry an exception, the Body will only contain the
+    // exception reason.
+
+    if (exception != e_NO_EXCEPTION)
+        return true ;
 
     // 2- Parse Header according to its type(Variable Part)
     switch (Header.type) {
@@ -467,6 +477,14 @@
     D.Out(pdTrace, "HeaderStruct size is : <%d> out of <%d> bytes MAX in 
body\n",
          sizeof(HeaderStruct),BUFFER_SIZE_DEFAULT);
 
+   // If the message carry an exception, the Body will only contain the
+   // exception reason.
+
+   if (Header.exception != e_NO_EXCEPTION) {
+        body.writeString(exceptionReason);
+   }
+   else
+    {
     // 1- Prepare body Structure according to Message type
     switch(Header.type) {
       case GET_FED_FILE:
@@ -696,6 +714,7 @@
        D.Out(pdExcept, "Unknown type %d in Writebody.", Header.type);
        throw RTIinternalError("Unknown/Unimplemented type for Header.");
     }
+ }
 
     // body Size does not include the copy of the Header!
     Header.bodySize = body.size() - sizeof(HeaderStruct);
@@ -716,6 +735,13 @@
     Header.exception = exception ;
     Header.federate = federate ;
     Header.federation = federation ;
+    // If the message carry an exception, the Body will only contain the
+    // exception reason.
+
+    if (exception != e_NO_EXCEPTION) {
+        Header.bodySize = 1 ;
+        return true ;
+    }
 
     // 3- Fill Header(Variable Part)[Sorted by Variable part type]
     // Note: Header.bodySize is not set to the actual body size, but
@@ -937,4 +963,4 @@
 
 } // namespace certi
 
-// $Id: NetworkMessage_RW.cc,v 3.31 2007/09/28 14:07:54 rousse Exp $
+// $Id: NetworkMessage_RW.cc,v 3.32 2007/11/13 13:25:40 rousse Exp $

Index: libRTI/RTIambPrivateRefs.cc
===================================================================
RCS file: /sources/certi/certi/libRTI/RTIambPrivateRefs.cc,v
retrieving revision 3.4
retrieving revision 3.5
diff -u -b -r3.4 -r3.5
--- libRTI/RTIambPrivateRefs.cc 12 Nov 2007 14:49:10 -0000      3.4
+++ libRTI/RTIambPrivateRefs.cc 13 Nov 2007 13:25:40 -0000      3.5
@@ -19,7 +19,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: RTIambPrivateRefs.cc,v 3.4 2007/11/12 14:49:10 siron Exp $
+// $Id: RTIambPrivateRefs.cc,v 3.5 2007/11/13 13:25:40 rousse Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -192,6 +192,11 @@
           throw CouldNotDiscover(msg->getExceptionReason());
       } break ;
 
+      case e_CouldNotOpenFED: {
+          D.Out(pdExcept, "Throwing e_CouldNotOpenFED exception.");
+          throw CouldNotOpenFED(msg->getExceptionReason());
+      } break ;
+
       case e_CouldNotOpenRID: {
           D.Out(pdExcept, "Throwing e_CouldNotOpenRID exception.");
           throw CouldNotOpenRID(msg->getExceptionReason());
@@ -532,4 +537,4 @@
     }
 }
 
-// $Id: RTIambPrivateRefs.cc,v 3.4 2007/11/12 14:49:10 siron Exp $
+// $Id: RTIambPrivateRefs.cc,v 3.5 2007/11/13 13:25:40 rousse Exp $

Index: libRTI/RTIambassador.cc
===================================================================
RCS file: /sources/certi/certi/libRTI/RTIambassador.cc,v
retrieving revision 3.56
retrieving revision 3.57
diff -u -b -r3.56 -r3.57
--- libRTI/RTIambassador.cc     6 Nov 2007 10:05:07 -0000       3.56
+++ libRTI/RTIambassador.cc     13 Nov 2007 13:25:40 -0000      3.57
@@ -19,7 +19,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: RTIambassador.cc,v 3.56 2007/11/06 10:05:07 rousse Exp $
+// $Id: RTIambassador.cc,v 3.57 2007/11/13 13:25:40 rousse Exp $
 // ----------------------------------------------------------------------------
 
 
@@ -526,13 +526,17 @@
 
 
 // ----------------------------------------------------------------------------
-//! Create Federation Execution.
-/*! Send a CREATE_FEDERATION_EXECUTION request type to inform rtia process a
+// Create Federation Execution.
+/** Realization of the Create Federation Execution federation management 
service
+    (HLA 1.3).
+    Send a CREATE_FEDERATION_EXECUTION request type to inform rtia process a
   new federation is being created.
+    @param executionName execution name of the federation to be created
+    @param FED           FED file name (path seen by rtig)
 */
 void
 //RTI::
-RTI::RTIambassador::createFederationExecution( const char *executionName,
+RTI::RTIambassador::createFederationExecution(const char *executionName,
                                                                                
                                                const char *FED)
     throw (RTI::RTIinternalError, RTI::ConcurrentAccessAttempted, 
           RTI::ErrorReadingFED, RTI::CouldNotOpenFED, 
@@ -561,7 +565,13 @@
 }
 
 // ----------------------------------------------------------------------------
-//! Destroy Federation Execution.
+// Destroy Federation Execution.
+/** Realization of the Destroy Federation Execution federation management 
service
+    (HLA 1.3).
+    Send a DESTROY_FEDERATION_EXECUTION request type to remove a federation
+    execution from the RTI set of federation executions.
+    \param executionName execution name of the federation to be destroyed
+*/
 void
 RTI::RTIambassador::destroyFederationExecution(const char *executionName)
     throw (RTI::RTIinternalError, RTI::ConcurrentAccessAttempted,
@@ -2862,4 +2872,4 @@
     privateRefs->executeService(&req, &rep);
 }
 
-// $Id: RTIambassador.cc,v 3.56 2007/11/06 10:05:07 rousse Exp $
+// $Id: RTIambassador.cc,v 3.57 2007/11/13 13:25:40 rousse Exp $




reply via email to

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