certi-cvs
[Top][All Lists]
Advanced

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

[certi-cvs] certi RTIG/RTIG_processing.cc RTIA/FederationMa...


From: certi-cvs
Subject: [certi-cvs] certi RTIG/RTIG_processing.cc RTIA/FederationMa...
Date: Fri, 19 Mar 2010 20:30:56 +0000

CVSROOT:        /sources/certi
Module name:    certi
Changes by:     Eric NOULARD <erk>      10/03/19 20:30:55

Modified files:
        RTIG           : RTIG_processing.cc 
        RTIA           : FederationManagement.cc 
        libCERTI       : NetworkMessage.hh 

Log message:
        ExceptionReason should be private

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/RTIG_processing.cc?cvsroot=certi&r1=3.95&r2=3.96
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/FederationManagement.cc?cvsroot=certi&r1=3.83&r2=3.84
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NetworkMessage.hh?cvsroot=certi&r1=3.59&r2=3.60

Patches:
Index: RTIG/RTIG_processing.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/RTIG_processing.cc,v
retrieving revision 3.95
retrieving revision 3.96
diff -u -b -r3.95 -r3.96
--- RTIG/RTIG_processing.cc     19 Mar 2010 13:54:03 -0000      3.95
+++ RTIG/RTIG_processing.cc     19 Mar 2010 20:30:55 -0000      3.96
@@ -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.95 2010/03/19 13:54:03 erk Exp $
+// $Id: RTIG_processing.cc,v 3.96 2010/03/19 20:30:55 erk Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -89,18 +89,15 @@
        }
        catch (CouldNotOpenFED e)
        {
-               rep.setException(e_CouldNotOpenFED);
-               rep.exceptionReason=e._reason;
+               rep.setException(e_CouldNotOpenFED,e._reason);
        }
        catch (ErrorReadingFED e)
        {
-               rep.setException(e_ErrorReadingFED);
-               rep.exceptionReason = e._reason ;
+               rep.setException(e_ErrorReadingFED,e._reason);
        }
        catch (FederationExecutionAlreadyExists e)
        {
-               rep.setException(e_FederationExecutionAlreadyExists);
-               rep.exceptionReason =e._reason ;
+               rep.setException(e_FederationExecutionAlreadyExists,e._reason);
        }
 #endif
        // Prepare answer for RTIA : store NetworkMessage rep
@@ -167,10 +164,10 @@
                G.Out(pdGendoc,"END ** JOIN FEDERATION (BAD) SERVICE **");
                // Prepare answer about JoinFederationExecution
                NM_Join_Federation_Execution rep ;
-               rep.setException(e_FederateAlreadyExecutionMember);
-               rep.exceptionReason = "Federate with same name has yet joined 
the federation";
+               rep.setException(e_FederateAlreadyExecutionMember,
+                               "Federate with same name has yet joined the 
federation");
 
-               G.Out(pdGendoc,"processJoinFederation==>Answer to RTIA JFE 
ERROR %s",rep.exceptionReason.c_str());
+               G.Out(pdGendoc,"processJoinFederation==>Answer to RTIA JFE 
ERROR %s",rep.getExceptionReason().c_str());
 
                rep.send(link,NM_msgBufSend);
                return ;
@@ -276,18 +273,15 @@
        { printf("ERROR : %s  reason : %s\n",e._name,e._reason.c_str());
        if (strcmp(e._name,"RTIinternalError")==0 )
        {
-               rep.setException(e_RTIinternalError);
-               rep.exceptionReason = e._reason;
+               rep.setException(e_RTIinternalError,e._reason);
        }
        else if (strcmp(e._name,"FederationExecutionDoesNotExist")==0 )
        {
-               rep.setException(e_FederationExecutionDoesNotExist);
-               rep.exceptionReason =e._reason;
+               rep.setException(e_FederationExecutionDoesNotExist,e._reason);
        }
        else if (strcmp(e._name,"FederatesCurrentlyJoined")==0 )
        {
-               rep.setException(e_FederatesCurrentlyJoined);
-               rep.exceptionReason = "at least one federate joined";
+               rep.setException(e_FederatesCurrentlyJoined,"at least one 
federate joined");
        }
        }
 
@@ -1452,18 +1446,15 @@
        }
        catch (ObjectNotKnown e)
        {
-               answer.setException(e_ObjectNotKnown);
-               answer.exceptionReason = e._reason ;
+               answer.setException(e_ObjectNotKnown,e._reason);
        }
        catch (FederationExecutionDoesNotExist e)
        {
-               answer.setException(e_FederationExecutionDoesNotExist);
-               answer.exceptionReason = e._reason ;
+               
answer.setException(e_FederationExecutionDoesNotExist,e._reason);
        }
        catch (RTIinternalError e)
        {
-               answer.setException(e_RTIinternalError);
-               answer.exceptionReason = e._reason ;
+               answer.setException(e_RTIinternalError,e._reason);
        }
 
        answer.federate = request->federate ;
@@ -1476,4 +1467,4 @@
 
 }} // namespace certi/rtig
 
-// $Id: RTIG_processing.cc,v 3.95 2010/03/19 13:54:03 erk Exp $
+// $Id: RTIG_processing.cc,v 3.96 2010/03/19 20:30:55 erk Exp $

Index: RTIA/FederationManagement.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/FederationManagement.cc,v
retrieving revision 3.83
retrieving revision 3.84
diff -u -b -r3.83 -r3.84
--- RTIA/FederationManagement.cc        19 Mar 2010 13:54:03 -0000      3.83
+++ RTIA/FederationManagement.cc        19 Mar 2010 20:30:55 -0000      3.84
@@ -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.83 2010/03/19 13:54:03 erk Exp $
+// $Id: FederationManagement.cc,v 3.84 2010/03/19 20:30:55 erk Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -137,28 +137,28 @@
             e = reponse->getException();
             G.Out(pdGendoc,"exit FederationManagement::"
                            "createFederationExecution on exception");
-            throw CouldNotOpenFED (reponse->exceptionReason) ;
+            throw CouldNotOpenFED (reponse->getExceptionReason()) ;
             }           
         else if (reponse->getException() == e_FederationExecutionAlreadyExists)
             {
             e = reponse->getException();
             G.Out(pdGendoc,"exit FederationManagement::"
                            "createFederationExecution on exception");
-            throw FederationExecutionAlreadyExists (reponse->exceptionReason) ;
+            throw FederationExecutionAlreadyExists 
(reponse->getExceptionReason()) ;
             }
         else if (reponse->getException() == e_ErrorReadingFED)
             {
             e = reponse->getException();
             G.Out(pdGendoc,"exit FederationManagement::"
                            "createFederationExecution on exception 
ErrorReadingFED");
-            throw ErrorReadingFED (reponse->exceptionReason) ;
+            throw ErrorReadingFED (reponse->getExceptionReason()) ;
             }
         else
             {
             e = reponse->getException() ;
             G.Out(pdGendoc,"exit FederationManagement::"
                            "createFederationExecution on exception 
RTIinternalError");
-            throw RTIinternalError (reponse->exceptionReason) ;
+            throw RTIinternalError (reponse->getExceptionReason()) ;
             D.Out(pdInit, "deja cree");
             }
         }

Index: libCERTI/NetworkMessage.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/NetworkMessage.hh,v
retrieving revision 3.59
retrieving revision 3.60
diff -u -b -r3.59 -r3.60
--- libCERTI/NetworkMessage.hh  19 Mar 2010 13:54:03 -0000      3.59
+++ libCERTI/NetworkMessage.hh  19 Mar 2010 20:30:55 -0000      3.60
@@ -17,7 +17,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: NetworkMessage.hh,v 3.59 2010/03/19 13:54:03 erk Exp $
+// $Id: NetworkMessage.hh,v 3.60 2010/03/19 20:30:55 erk Exp $
 // ----------------------------------------------------------------------------
 
 #ifndef CERTI_NETWORK_MESSAGE_HH
@@ -152,10 +152,23 @@
        NetworkMessage();
        virtual ~NetworkMessage();
 
+       /**
+        * Get the name of [the type of] the message.
+        * @return the message type name.
+        */
+       const char* getMessageName() const {return messageName;}
+       /**
+        * Get the message type.
+        * @return the type of the message
+        */
        const NetworkMessage::Message_T getType() const {return type;};
+
        const TypeException getException() const {return exception;};
        TypeException& getRefException() {return exception;};
-       void setException(const TypeException except) {exception=except;};
+       void setException(const TypeException e) {exception=e;};
+       void setException(const TypeException e, const std::string& reason)
+               {exception=e;exceptionReason=reason;};
+       const std::string& getExceptionReason(){return exceptionReason;};
 
        /**
         * Serialize the message into a buffer
@@ -181,9 +194,6 @@
 
        EventRetractionHandle eventRetraction ; /* FIXME to be suppressed */
 
-       /** The name corresponding to message type */
-       const char* getMessageName() const {return messageName;}
-
        /**
         * The federation handle 
         * the message is part of this federation activity
@@ -195,11 +205,6 @@
         */
        FederateHandle federate ;
 
-       /**
-        * The exception reason (if the message carry one)
-        */
-       std::string exceptionReason;
-
 protected:
 
        /** 
@@ -226,6 +231,11 @@
         */
        TypeException exception ;
 
+       /**
+        * The exception reason (if the message carry one)
+        */
+       std::string exceptionReason;
+
 private:
 
 };
@@ -238,4 +248,4 @@
 
 #endif // CERTI_NETWORK_MESSAGE_HH
 
-// $Id: NetworkMessage.hh,v 3.59 2010/03/19 13:54:03 erk Exp $
+// $Id: NetworkMessage.hh,v 3.60 2010/03/19 20:30:55 erk Exp $




reply via email to

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