certi-cvs
[Top][All Lists]
Advanced

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

certi RTIA/DataDistribution.cc RTIA/RTIA_federa...


From: certi-cvs
Subject: certi RTIA/DataDistribution.cc RTIA/RTIA_federa...
Date: Thu, 29 Nov 2007 16:51:16 +0000

CVSROOT:        /sources/certi
Module name:    certi
Changes by:     ROUSSELOT <rousse>      07/11/29 16:51:16

Modified files:
        RTIA           : DataDistribution.cc RTIA_federate.cc 
                         RTIA_network.cc 
        RTIG           : Federation.cc 
        libCERTI       : NetworkMessage_RW.cc ObjectClass.cc 
                         ObjectClassBroadcastList.cc ObjectClassSet.cc 

Log message:
        Adding some traces for debugging

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/DataDistribution.cc?cvsroot=certi&r1=3.22&r2=3.23
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/RTIA_federate.cc?cvsroot=certi&r1=3.53&r2=3.54
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/RTIA_network.cc?cvsroot=certi&r1=3.14&r2=3.15
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/Federation.cc?cvsroot=certi&r1=3.69&r2=3.70
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NetworkMessage_RW.cc?cvsroot=certi&r1=3.32&r2=3.33
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClass.cc?cvsroot=certi&r1=3.39&r2=3.40
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClassBroadcastList.cc?cvsroot=certi&r1=3.16&r2=3.17
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClassSet.cc?cvsroot=certi&r1=3.29&r2=3.30

Patches:
Index: RTIA/DataDistribution.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/DataDistribution.cc,v
retrieving revision 3.22
retrieving revision 3.23
diff -u -b -r3.22 -r3.23
--- RTIA/DataDistribution.cc    31 Oct 2007 10:30:24 -0000      3.22
+++ RTIA/DataDistribution.cc    29 Nov 2007 16:51:15 -0000      3.23
@@ -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: DataDistribution.cc,v 3.22 2007/10/31 10:30:24 erk Exp $
+// $Id: DataDistribution.cc,v 3.23 2007/11/29 16:51:15 rousse Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -97,6 +97,7 @@
                                     ObjectClassHandle object_class) const
     throw (ObjectClassNotDefined, AttributeNotDefined)
 {
+std::cout<<"DataDistribution::getAttributeSpace"<<std::endl;
     return rootObject->ObjectClasses->getWithHandle(object_class)->
         getAttribute(attribute)->getSpace();
 }
@@ -420,4 +421,4 @@
 
 }} // namespace certi::rtia
 
-// $Id: DataDistribution.cc,v 3.22 2007/10/31 10:30:24 erk Exp $
+// $Id: DataDistribution.cc,v 3.23 2007/11/29 16:51:15 rousse Exp $

Index: RTIA/RTIA_federate.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/RTIA_federate.cc,v
retrieving revision 3.53
retrieving revision 3.54
diff -u -b -r3.53 -r3.54
--- RTIA/RTIA_federate.cc       27 Nov 2007 08:42:53 -0000      3.53
+++ RTIA/RTIA_federate.cc       29 Nov 2007 16:51:15 -0000      3.54
@@ -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.53 2007/11/27 08:42:53 rousse Exp $
+// $Id: RTIA_federate.cc,v 3.54 2007/11/29 16:51:15 rousse Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -653,6 +653,7 @@
 
         try {
             rep.setName(om->getObjectClassName(req->getObjectClass()).c_str());
+std::cout<<"rep.setName"<<std::endl;
         }
         catch (ObjectClassNotDefined) {
             rep.setException(e_ObjectClassNotDefined);
@@ -1224,4 +1225,4 @@
 
 }} // namespace certi/rtia
 
-// $Id: RTIA_federate.cc,v 3.53 2007/11/27 08:42:53 rousse Exp $
+// $Id: RTIA_federate.cc,v 3.54 2007/11/29 16:51:15 rousse Exp $

Index: RTIA/RTIA_network.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/RTIA_network.cc,v
retrieving revision 3.14
retrieving revision 3.15
diff -u -b -r3.14 -r3.15
--- RTIA/RTIA_network.cc        28 Nov 2007 14:54:35 -0000      3.14
+++ RTIA/RTIA_network.cc        29 Nov 2007 16:51:15 -0000      3.15
@@ -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_network.cc,v 3.14 2007/11/28 14:54:35 siron Exp $
+// $Id: RTIA_network.cc,v 3.15 2007/11/29 16:51:15 rousse Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -28,6 +28,7 @@
 #include "InteractionSet.hh"
 #include "ObjectClass.hh"
 #include "ObjectClassSet.hh"
+#include <assert.h>
 
 namespace certi {
 namespace rtia {
@@ -125,9 +126,10 @@
              {        
              // Retrieve order type
              updateOrder = TIMESTAMP;
+
              for (UShort i=0; i< msg->handleArraySize; ++i)
                {
-                if (rootObject->ObjectClasses->getWithHandle( msg->objectClass 
)
+                if (rootObject->ObjectClasses->getWithHandle( msg->objectClass)
                     ->getAttribute(msg->handleArray[i])->order != TIMESTAMP)
                 {
                    updateOrder = RECEIVE;
@@ -321,4 +323,4 @@
 
 }} // namespace certi/rtia
 
-// $Id: RTIA_network.cc,v 3.14 2007/11/28 14:54:35 siron Exp $
+// $Id: RTIA_network.cc,v 3.15 2007/11/29 16:51:15 rousse Exp $

Index: RTIG/Federation.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/Federation.cc,v
retrieving revision 3.69
retrieving revision 3.70
diff -u -b -r3.69 -r3.70
--- RTIG/Federation.cc  16 Nov 2007 15:04:22 -0000      3.69
+++ RTIG/Federation.cc  29 Nov 2007 16:51:15 -0000      3.70
@@ -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.69 2007/11/16 15:04:22 rousse Exp $
+// $Id: Federation.cc,v 3.70 2007/11/29 16:51:15 rousse Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -1317,6 +1317,7 @@
            RestoreInProgress,
            RTIinternalError)
 {
+    G.Out(pdGendoc,"enter Federation::publishObject");
     // It may throw FederateNotExecutionMember.
     this->check(federate);
 
@@ -1326,6 +1327,7 @@
     D.Out(pdRegister,
           "Federation %d: Federate %d(un)publishes %d attrib. of ObjClass %d.",
           handle, federate, list_size, object);
+    G.Out(pdGendoc,"exit  Federation::publishObject");
 }
 
 // ----------------------------------------------------------------------------
@@ -1343,8 +1345,10 @@
            RestoreInProgress,
            RTIinternalError)
 {
+
     ObjectHandle new_id = objectHandles.provide();
 
+    G.Out(pdGendoc,"enter Federation::registerObject");
     D.Out(pdRegister,
           "Federation %d: Federate %d registering Object %d of Class %d.",
           handle, federate, new_id, class_handle);
@@ -1356,6 +1360,7 @@
     // Register Object.
     root->registerObjectInstance(federate, class_handle, new_id, 
                                 strname.c_str());
+    G.Out(pdGendoc,"exit Federation::registerObject");
     return new_id ;
 }
 
@@ -1540,6 +1545,7 @@
            RestoreInProgress,
            RTIinternalError)
 {
+    G.Out(pdGendoc,"enter Federation::subscribeObject");
     // It may throw FederateNotExecutionMember.
     this->check(federate);
 
@@ -1548,6 +1554,7 @@
     D.Out(pdRegister,
           "Federation %d: Federate %d(un)sub. to %d attrib. of ObjClass %d.",
           handle, federate, list_size, object);
+    G.Out(pdGendoc,"exit  Federation::subscribeObject");
 }
 
 // ----------------------------------------------------------------------------
@@ -2054,6 +2061,7 @@
           SaveInProgress, RestoreInProgress,
           RTIinternalError)
 {
+    G.Out(pdGendoc,"enter Federation::registerObjectWithRegion");
     check(federate);
 
     // Register object
@@ -2080,6 +2088,7 @@
 
     D[pdDebug] << "- " << nb << " attribute(s) associated with region "
               << region_handle << std::endl ;
+    G.Out(pdGendoc,"exit  Federation::registerObjectWithRegion");
     return object ;
 }    
 
@@ -2201,5 +2210,5 @@
 
 }} // namespace certi/rtig
 
-// $Id: Federation.cc,v 3.69 2007/11/16 15:04:22 rousse Exp $
+// $Id: Federation.cc,v 3.70 2007/11/29 16:51:15 rousse Exp $
 

Index: libCERTI/NetworkMessage_RW.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/NetworkMessage_RW.cc,v
retrieving revision 3.32
retrieving revision 3.33
diff -u -b -r3.32 -r3.33
--- libCERTI/NetworkMessage_RW.cc       13 Nov 2007 13:25:40 -0000      3.32
+++ libCERTI/NetworkMessage_RW.cc       29 Nov 2007 16:51:15 -0000      3.33
@@ -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.32 2007/11/13 13:25:40 rousse Exp $
+// $Id: NetworkMessage_RW.cc,v 3.33 2007/11/29 16:51:15 rousse Exp $
 // ----------------------------------------------------------------------------
 
 
@@ -96,6 +96,7 @@
             ValueArray[i].length = body.readLongInt();
             body.readBlock(ValueArray[i].value, ValueArray[i].length) ;
        }
+G.Out(pdGendoc,"readBody REFLECT_ATTRIBUTE_VALUES objectClass=%d",objectClass);
        break ;
        
        // -- O_I Variable Part With Date(Body Not Empty) --
@@ -321,10 +322,16 @@
        break ;
 
       case UPDATE_ATTRIBUTE_VALUES:
+       objectClass = Header.VP.O_I.handle ;
+       handleArraySize = Header.VP.O_I.size ;
+       date = Header.VP.O_I.date ;
+       break ;
+
       case REFLECT_ATTRIBUTE_VALUES:
        objectClass = Header.VP.O_I.handle ;
        handleArraySize = Header.VP.O_I.size ;
        date = Header.VP.O_I.date ;
+G.Out(pdGendoc,"readHeader REFLECT_ATTRIBUTE_VALUES 
objectClass=%d",objectClass);
        break ;
 
       case SEND_INTERACTION:
@@ -510,11 +517,11 @@
        break ;
 
       case REFLECT_ATTRIBUTE_VALUES:
+G.Out(pdGendoc,"writeBody REFLECT_ATTRIBUTE_VALUES %d",objectClass);
        body.writeLongInt(object);
        body.writeString(label);
         body.writeLongInt(boolean);
        body.writeBlock((char *) handleArray, handleArraySize * 
sizeof(AttributeHandle));
-       
        for (i = 0 ; i < handleArraySize ; i ++) {
             body.writeLongInt(ValueArray[i].length) ;
             body.writeBlock(ValueArray[i].value, ValueArray[i].length);
@@ -760,6 +767,7 @@
        break ;
 
       case REFLECT_ATTRIBUTE_VALUES:
+G.Out(pdGendoc,"writeHeader REFLECT_ATTRIBUTE_VALUES 
objectClass=%d",objectClass);
        Header.bodySize = 1 ;
         Header.VP.O_I.handle = objectClass ;
         Header.VP.O_I.size = handleArraySize ;
@@ -963,4 +971,4 @@
 
 } // namespace certi
 
-// $Id: NetworkMessage_RW.cc,v 3.32 2007/11/13 13:25:40 rousse Exp $
+// $Id: NetworkMessage_RW.cc,v 3.33 2007/11/29 16:51:15 rousse Exp $

Index: libCERTI/ObjectClass.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClass.cc,v
retrieving revision 3.39
retrieving revision 3.40
diff -u -b -r3.39 -r3.40
--- libCERTI/ObjectClass.cc     31 Oct 2007 10:30:21 -0000      3.39
+++ libCERTI/ObjectClass.cc     29 Nov 2007 16:51:15 -0000      3.40
@@ -19,7 +19,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: ObjectClass.cc,v 3.39 2007/10/31 10:30:21 erk Exp $
+// $Id: ObjectClass.cc,v 3.40 2007/11/29 16:51:15 rousse Exp $
 // ----------------------------------------------------------------------------
 
 #include  "Object.hh"
@@ -52,6 +52,7 @@
 namespace certi {
 
 static pdCDebug D("OBJECTCLASS", __FILE__);
+static PrettyDebug G("GENDOC",__FILE__);
 
 // ----------------------------------------------------------------------------
 //! To be used only by CRead, it returns the new Attribute's Handle.
@@ -114,10 +115,12 @@
                                   const Object *source)
 {
     int i, trouve;
-
+    G.Out(pdGendoc,"enter ObjectClass::broadcastClassMessage");
     // 1. Set ObjectHandle to local class Handle.
     ocbList->message->objectClass = handle ;
 
+    G.Out(pdGendoc,"      ObjectClass::broadcastClassMessage 
handle=%d",handle);
+
     // 2. Update message attribute list by removing child's attributes.
     if ((ocbList->message->type == NetworkMessage::REFLECT_ATTRIBUTE_VALUES) ||
         (ocbList->message->type == 
NetworkMessage::REQUEST_ATTRIBUTE_OWNERSHIP_ASSUMPTION)) {
@@ -152,7 +155,6 @@
       case NetworkMessage::REFLECT_ATTRIBUTE_VALUES: {
           // For each class attribute, update the list be adding federates who
           // subscribed to the attribute.
-         assert(source != 0);
           list<ObjectClassAttribute *>::const_iterator a ;
           for (a = attributeSet.begin(); a != attributeSet.end(); a++) {
               // Do not consider attributes that are not updated
@@ -187,6 +189,7 @@
 
     // 4. Send pending messages.
     ocbList->sendPendingMessage(server);
+    G.Out(pdGendoc,"exit  ObjectClass::broadcastClassMessage");
 }
 
 // ----------------------------------------------------------------------------
@@ -1748,4 +1751,4 @@
 
 } // namespace certi
 
-// $Id: ObjectClass.cc,v 3.39 2007/10/31 10:30:21 erk Exp $
+// $Id: ObjectClass.cc,v 3.40 2007/11/29 16:51:15 rousse Exp $

Index: libCERTI/ObjectClassBroadcastList.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClassBroadcastList.cc,v
retrieving revision 3.16
retrieving revision 3.17
diff -u -b -r3.16 -r3.17
--- libCERTI/ObjectClassBroadcastList.cc        6 Nov 2007 10:05:07 -0000       
3.16
+++ libCERTI/ObjectClassBroadcastList.cc        29 Nov 2007 16:51:15 -0000      
3.17
@@ -19,7 +19,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: ObjectClassBroadcastList.cc,v 3.16 2007/11/06 10:05:07 rousse Exp $
+// $Id: ObjectClassBroadcastList.cc,v 3.17 2007/11/29 16:51:15 rousse Exp $
 // ----------------------------------------------------------------------------
 
 
@@ -32,6 +32,7 @@
 namespace certi {
 
 static pdCDebug D("BROADCAST", __FILE__);
+static PrettyDebug G("GENDOC",__FILE__);
 
 // ----------------------------------------------------------------------------
 /** ObjectBroadcastLine  
@@ -54,6 +55,8 @@
 NetworkMessage *
 ObjectClassBroadcastList::adaptMessage(ObjectBroadcastLine *line)
 {
+    G.Out(pdGendoc,"enter ObjectClassBroadcastList::adaptMessage");
+
     if ((message->type != NetworkMessage::REFLECT_ATTRIBUTE_VALUES) &&
         (message->type != 
NetworkMessage::REQUEST_ATTRIBUTE_OWNERSHIP_ASSUMPTION))
         throw RTIinternalError("Bad Message type in Broadcast's AdaptMsg.");
@@ -99,7 +102,7 @@
             }
         }
     }
-
+    G.Out(pdGendoc,"exit  ObjectClassBroadcastList::adaptMessage");
     return reducedMessage ;
 }
 
@@ -278,6 +281,7 @@
 */
 void ObjectClassBroadcastList::sendPendingMessage(SecurityServer *server)
 {
+    G.Out(pdGendoc,"enter ObjectClassBroadcastList::sendPendingMessage");
     switch (message->type) {
 
       case NetworkMessage::REFLECT_ATTRIBUTE_VALUES:
@@ -292,6 +296,7 @@
 
       default:
         throw RTIinternalError("Unknown message type to broadcast.");
+    G.Out(pdGendoc,"exit  ObjectClassBroadcastList::sendPendingMessage");
     }
 }
 
@@ -305,6 +310,7 @@
     Socket *socket = 0 ;
     NetworkMessage *currentMessage = 0 ;
 
+    G.Out(pdGendoc,"enter ObjectClassBroadcastList::sendPendingRAVMessage");
     // For each line :
     list<ObjectBroadcastLine *>::iterator i ;
     for (i = lines.begin(); i != lines.end(); i++) {
@@ -346,6 +352,7 @@
 #else
                 socket = server->getSocketLink((*i)->Federate);
 #endif
+                G.Out(pdGendoc,"                                 
sendPendingRAVMessage=====> write");
                 currentMessage->write(socket);
             }
             catch (RTIinternalError &e) {
@@ -375,9 +382,10 @@
         else
             D.Out(pdProtocol, "No message sent to Federate %d.",
                   (*i)->Federate);
+    G.Out(pdGendoc,"exit  ObjectClassBroadcastList::sendPendingRAVMessage");
     }
 }
 
 } // namespace certi
 
-// $Id: ObjectClassBroadcastList.cc,v 3.16 2007/11/06 10:05:07 rousse Exp $
+// $Id: ObjectClassBroadcastList.cc,v 3.17 2007/11/29 16:51:15 rousse Exp $

Index: libCERTI/ObjectClassSet.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClassSet.cc,v
retrieving revision 3.29
retrieving revision 3.30
diff -u -b -r3.29 -r3.30
--- libCERTI/ObjectClassSet.cc  19 Nov 2007 09:29:03 -0000      3.29
+++ libCERTI/ObjectClassSet.cc  29 Nov 2007 16:51:16 -0000      3.30
@@ -19,7 +19,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: ObjectClassSet.cc,v 3.29 2007/11/19 09:29:03 erk Exp $
+// $Id: ObjectClassSet.cc,v 3.30 2007/11/29 16:51:16 rousse Exp $
 // ----------------------------------------------------------------------------
 
 // Project
@@ -34,6 +34,7 @@
 // Standard
 #include <iostream>
 #include <sstream>
+#include <assert.h>
 
 using std::list ;
 using std::cout ;
@@ -340,6 +341,7 @@
 ObjectClassSet::getWithHandle(ObjectClassHandle theHandle) const
     throw (ObjectClassNotDefined)
 {
+       std::stringstream msg;
        
        handledOC_const_iterator iter;
        
@@ -348,8 +350,9 @@
        if (iter != OCFromHandle.end()) {
                return iter->second;
        } else {
+                msg << "Unknown Object Class Handle <" << theHandle << ">"; 
                D.Out(pdExcept, "Unknown Object Class Handle %d .", theHandle);
-               throw ObjectClassNotDefined("Unknow class handle.");
+               throw ObjectClassNotDefined(msg.str().c_str());
        }                   
 }
 
@@ -779,4 +782,4 @@
 
 } // namespace certi
 
-// $Id: ObjectClassSet.cc,v 3.29 2007/11/19 09:29:03 erk Exp $
+// $Id: ObjectClassSet.cc,v 3.30 2007/11/29 16:51:16 rousse Exp $




reply via email to

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