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... [br_DEV_H


From: certi-cvs
Subject: [certi-cvs] certi RTIG/RTIG_processing.cc RTIA/FederationMa... [br_DEV_HETEROGENEOUS]
Date: Thu, 10 Apr 2008 19:55:48 +0000

CVSROOT:        /sources/certi
Module name:    certi
Branch:         br_DEV_HETEROGENEOUS
Changes by:     Eric NOULARD <erk>      08/04/10 19:55:48

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

Log message:
        First steps billard seems OK.
        Now I should check more in-depth tests

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/RTIG_processing.cc?cvsroot=certi&only_with_tag=br_DEV_HETEROGENEOUS&r1=3.56.2.4&r2=3.56.2.5
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/FederationManagement.cc?cvsroot=certi&only_with_tag=br_DEV_HETEROGENEOUS&r1=3.50.2.2&r2=3.50.2.3
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NM_Classes.hh?cvsroot=certi&only_with_tag=br_DEV_HETEROGENEOUS&r1=1.1.2.8&r2=1.1.2.9
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NM_Classes.cc?cvsroot=certi&only_with_tag=br_DEV_HETEROGENEOUS&r1=1.1.2.8&r2=1.1.2.9

Patches:
Index: RTIG/RTIG_processing.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/RTIG_processing.cc,v
retrieving revision 3.56.2.4
retrieving revision 3.56.2.5
diff -u -b -r3.56.2.4 -r3.56.2.5
--- RTIG/RTIG_processing.cc     10 Apr 2008 15:12:26 -0000      3.56.2.4
+++ RTIG/RTIG_processing.cc     10 Apr 2008 19:55:47 -0000      3.56.2.5
@@ -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.56.2.4 2008/04/10 15:12:26 erk Exp $
+// $Id: RTIG_processing.cc,v 3.56.2.5 2008/04/10 19:55:47 erk Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -230,10 +230,7 @@
             repFED.number = num_line ;
             repFED.FEDid = filename;            
             // line transfered
-            repFED.handleArraySize = 1 ;
-            assert ( strlen(file_line) <= MAX_BYTES_PER_VALUE );
-            repFED.setValue(0,file_line,strlen(file_line)+1);  
-
+            repFED.setFEDLine(std::string(file_line));            
             // Send answer
             repFED.send(link);
 
@@ -1328,4 +1325,4 @@
 
 }} // namespace certi/rtig
 
-// $Id: RTIG_processing.cc,v 3.56.2.4 2008/04/10 15:12:26 erk Exp $
+// $Id: RTIG_processing.cc,v 3.56.2.5 2008/04/10 19:55:47 erk Exp $

Index: RTIA/FederationManagement.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/FederationManagement.cc,v
retrieving revision 3.50.2.2
retrieving revision 3.50.2.3
diff -u -b -r3.50.2.2 -r3.50.2.3
--- RTIA/FederationManagement.cc        10 Apr 2008 14:57:48 -0000      3.50.2.2
+++ RTIA/FederationManagement.cc        10 Apr 2008 19:55:48 -0000      3.50.2.3
@@ -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.50.2.2 2008/04/10 14:57:48 erk Exp $
+// $Id: FederationManagement.cc,v 3.50.2.3 2008/04/10 19:55:48 erk Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -285,6 +285,7 @@
 
         // Waiting RTIG answer for FED file opened
         std::auto_ptr<NetworkMessage> 
reponse(comm->waitMessage(NetworkMessage::GET_FED_FILE, 0));
+        NM_Get_FED_File*  getFedMsg = 
static_cast<NM_Get_FED_File*>(reponse.get());
 
         if ( reponse->exception != e_NO_EXCEPTION)
             {
@@ -342,12 +343,12 @@
             comm->sendMessage(&requeteFED);
     
             // Now read loop from RTIG to get line contents and then write it 
into file
-            char *file_line = NULL ;
             unsigned long length=0 ;
             int num_line = 0 ; // no line read            
             for (;;)
                 {              
                 reponse.reset(comm->waitMessage(NetworkMessage::GET_FED_FILE, 
0));
+                getFedMsg = static_cast<NM_Get_FED_File*>(reponse.get());
                 if ( reponse->exception != e_NO_EXCEPTION)
                     {
                     cout << "Bad answer from RTIG" << endl ;
@@ -362,14 +363,13 @@
                     break;
                 assert ( num_line == reponse->number ) ;
                 reponse->handleArraySize = 1 ;
-                file_line = reponse->getValue(0,&length) ;
-                int nbw = fputs(file_line,fdd);
-                file_line = NULL ;
+                //file_line = reponse->getValue(0,&length) ;
+                int nbw = fputs(getFedMsg->getFEDLine().c_str(),fdd);
+                //file_line = NULL ;
                 // RTIA says OK to RTIG                
                 requeteFED.federateName =Federate;
                 requeteFED.number = num_line ; 
                 requeteFED.FEDid = filename;
-
                 comm->sendMessage(&requeteFED);            
                 }
             // close working file
@@ -990,4 +990,4 @@
 
 }} // namespace certi/rtia
 
-// $Id: FederationManagement.cc,v 3.50.2.2 2008/04/10 14:57:48 erk Exp $
+// $Id: FederationManagement.cc,v 3.50.2.3 2008/04/10 19:55:48 erk Exp $

Index: libCERTI/NM_Classes.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/Attic/NM_Classes.hh,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -b -r1.1.2.8 -r1.1.2.9
--- libCERTI/NM_Classes.hh      10 Apr 2008 14:57:49 -0000      1.1.2.8
+++ libCERTI/NM_Classes.hh      10 Apr 2008 19:55:48 -0000      1.1.2.9
@@ -1338,15 +1338,15 @@
        /* specific Getter/Setter */
        void setFEDid(std::string FEDid) {this->FEDid=FEDid;};
        const std::string getFEDid() const {return FEDid;};
-       void setLineFollows() {lineFollows=true;};
-       void unsetLineFollows() {lineFollows=true;};
-       const bool getLineFollows() {return lineFollows;};
-       void setFEDLine(std::string line) {setLineFollows(); this->line=line;};
+//     void setLineFollows() {lineFollows=true;};
+//     void unsetLineFollows() {lineFollows=true;};
+       //const bool getLineFollows() {return lineFollows;};
+       void setFEDLine(std::string line) {this->line=line;};
        std::string getFEDLine() {return line;};
 protected:
        /* specific field */
 //     std::string FEDid;
-       bool lineFollows;
+//     bool lineFollows;
        std::string line;
 private:
 };

Index: libCERTI/NM_Classes.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Attic/NM_Classes.cc,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -b -r1.1.2.8 -r1.1.2.9
--- libCERTI/NM_Classes.cc      10 Apr 2008 14:57:50 -0000      1.1.2.8
+++ libCERTI/NM_Classes.cc      10 Apr 2008 19:55:48 -0000      1.1.2.9
@@ -1607,8 +1607,8 @@
        Super::serialize(); 
        /* specific code (if any) goes here */
        msgBuf.write_string(FEDid);
-       msgBuf.write_bool(lineFollows);
-       if (lineFollows) {
+       msgBuf.write_int16(number);     
+       if (number) {
                msgBuf.write_string(line);
        }
 } /* end of serialize */ 
@@ -1617,8 +1617,8 @@
        Super::deserialize(); 
        /* specific code (if any) goes here */
        FEDid       = msgBuf.read_string();
-       lineFollows = msgBuf.read_bool();
-       if (lineFollows) {
+       number      = msgBuf.read_int16();
+       if (number) {
                line = msgBuf.read_string();
        }
 } /* end of deserialize */




reply via email to

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