certi-cvs
[Top][All Lists]
Advanced

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

[certi-cvs] certi libCERTI/NM_Classes.hh libCERTI/NM_Classe... [br_DEV_H


From: certi-cvs
Subject: [certi-cvs] certi libCERTI/NM_Classes.hh libCERTI/NM_Classe... [br_DEV_HETEROGENEOUS]
Date: Tue, 08 Apr 2008 21:42:02 +0000

CVSROOT:        /sources/certi
Module name:    certi
Branch:         br_DEV_HETEROGENEOUS
Changes by:     Eric NOULARD <erk>      08/04/08 21:42:02

Modified files:
        libCERTI       : NM_Classes.hh NM_Classes.cc 
        scripts        : NW_MessageType.ods 

Log message:
        Update for tomorrow

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NM_Classes.hh?cvsroot=certi&only_with_tag=br_DEV_HETEROGENEOUS&r1=1.1.2.2&r2=1.1.2.3
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NM_Classes.cc?cvsroot=certi&only_with_tag=br_DEV_HETEROGENEOUS&r1=1.1.2.2&r2=1.1.2.3
http://cvs.savannah.gnu.org/viewcvs/certi/scripts/NW_MessageType.ods?cvsroot=certi&only_with_tag=br_DEV_HETEROGENEOUS&rev=1.1.2.2

Patches:
Index: libCERTI/NM_Classes.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/Attic/NM_Classes.hh,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -b -r1.1.2.2 -r1.1.2.3
--- libCERTI/NM_Classes.hh      8 Apr 2008 14:05:26 -0000       1.1.2.2
+++ libCERTI/NM_Classes.hh      8 Apr 2008 21:42:01 -0000       1.1.2.3
@@ -29,7 +29,7 @@
  */
 class NM_Factory {
 public:
-       static NetworkMessage* create(NetworkMessage::Message_T type);
+       static NetworkMessage* create(NetworkMessage::Message_T type) throw 
(RTIinternalError);
 };
 
 /*<BEGIN>---------- Not_Used ------------<BEGIN>*/
@@ -537,7 +537,7 @@
        /* specific Getter/Setter */
   protected:
        /* specific field */
-         int32_t objectClass;
+         ObjectClassHandle objectClass;
   private:
 };
 
@@ -553,7 +553,7 @@
        /* specific Getter/Setter */
   protected:
        /* specific field */
-         int32_t interactionClass;
+         InteractionClassHandle interactionClass;
   private:
 };
 
@@ -569,7 +569,7 @@
        /* specific Getter/Setter */
   protected:
        /* specific field */
-         int32_t interactionClass;
+         InteractionClassHandle interactionClass;
   private:
 };
 
@@ -603,7 +603,7 @@
        /* specific Getter/Setter */
   protected:
        /* specific field */
-         int32_t objectClass;
+         ObjectClassHandle objectClass;
   private:
 };
 
@@ -619,7 +619,7 @@
        /* specific Getter/Setter */
   protected:
        /* specific field */
-         int32_t interactionClass;
+         InteractionClassHandle interactionClass;
   private:
 };
 
@@ -635,7 +635,7 @@
        /* specific Getter/Setter */
   protected:
        /* specific field */
-         int32_t interactionClass;
+         InteractionClassHandle interactionClass;
   private:
 };
 
@@ -651,7 +651,7 @@
        /* specific Getter/Setter */
   protected:
        /* specific field */
-         int32_t interactionClass;
+         InteractionClassHandle interactionClass;
   private:
 };
 
@@ -667,7 +667,7 @@
        /* specific Getter/Setter */
   protected:
        /* specific field */
-         int32_t interactionClass;
+         InteractionClassHandle interactionClass;
   private:
 };
 
@@ -683,6 +683,7 @@
        /* specific Getter/Setter */
   protected:
        /* specific field */
+         ObjectHandle object;
   private:
 };
 
@@ -698,6 +699,7 @@
        /* specific Getter/Setter */
   protected:
        /* specific field */
+         ObjectHandle object;
   private:
 };
 
@@ -713,18 +715,22 @@
        /* specific Getter/Setter */
   protected:
        /* specific field */
+         ObjectClassHandle objectClass;
+         bool hasHandleArray;
+         UShort handleArraySize ;
+         AttributeHandle handleArray[MAX_ATTRIBUTES_PER_CLASS];
+         ValueLengthPair ValueArray[MAX_ATTRIBUTES_PER_CLASS];
+         
   private:
 };
 
 /*<END>---------- Update_Attribute_Values ------------<END>*/
 
 /*<BEGIN>---------- Reflect_Attribute_Values ------------<BEGIN>*/
-class CERTI_EXPORT NM_Reflect_Attribute_Values : public NetworkMessage {
+class CERTI_EXPORT NM_Reflect_Attribute_Values : public 
NM_Update_Attribute_Values {
   public:
        NM_Reflect_Attribute_Values();
        virtual ~NM_Reflect_Attribute_Values();
-       virtual void serialize();
-       virtual void deserialize();
        /* specific Getter/Setter */
   protected:
        /* specific field */
@@ -743,18 +749,21 @@
        /* specific Getter/Setter */
   protected:
        /* specific field */
+         InteractionClassHandle interactionClass;
+         bool hasHandleArray;
+         UShort handleArraySize ;
+         AttributeHandle handleArray[MAX_ATTRIBUTES_PER_CLASS];
+         ValueLengthPair ValueArray[MAX_ATTRIBUTES_PER_CLASS];
   private:
 };
 
 /*<END>---------- Send_Interaction ------------<END>*/
 
 /*<BEGIN>---------- Receive_Interaction ------------<BEGIN>*/
-class CERTI_EXPORT NM_Receive_Interaction : public NetworkMessage {
+class CERTI_EXPORT NM_Receive_Interaction : public NM_Send_Interaction {
   public:
        NM_Receive_Interaction();
        virtual ~NM_Receive_Interaction();
-       virtual void serialize();
-       virtual void deserialize();
        /* specific Getter/Setter */
   protected:
        /* specific field */
@@ -779,12 +788,10 @@
 /*<END>---------- Delete_Object ------------<END>*/
 
 /*<BEGIN>---------- Remove_Object ------------<BEGIN>*/
-class CERTI_EXPORT NM_Remove_Object : public NetworkMessage {
+class CERTI_EXPORT NM_Remove_Object : public NM_Delete_Object {
   public:
        NM_Remove_Object();
        virtual ~NM_Remove_Object();
-       virtual void serialize();
-       virtual void deserialize();
        /* specific Getter/Setter */
   protected:
        /* specific field */

Index: libCERTI/NM_Classes.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Attic/NM_Classes.cc,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -b -r1.1.2.2 -r1.1.2.3
--- libCERTI/NM_Classes.cc      8 Apr 2008 14:05:27 -0000       1.1.2.2
+++ libCERTI/NM_Classes.cc      8 Apr 2008 21:42:01 -0000       1.1.2.3
@@ -22,7 +22,7 @@
 
 namespace certi {
 
-NetworkMessage* NM_Factory::create(NetworkMessage::Message_T type) {
+NetworkMessage* NM_Factory::create(NetworkMessage::Message_T type) throw 
(RTIinternalError) {
        NetworkMessage* msg;
        
        switch (type) {
@@ -171,15 +171,19 @@
           msg = new NM_Remove_Object(); 
           break;
        case NetworkMessage::CHANGE_ATTRIBUTE_TRANSPORT_TYPE:
+          throw RTIinternalError("CHANGE_ATTRIBUTE_TRANSPORT_TYPE: 
Unimplemented");
           msg = new NM_Change_Attribute_Transport_Type(); 
           break;
        case NetworkMessage::CHANGE_ATTRIBUTE_ORDER_TYPE:
+          throw RTIinternalError("CHANGE_ATTRIBUTE_ORDER_TYPE: Unimplemented");
           msg = new NM_Change_Attribute_Order_Type(); 
           break;
        case NetworkMessage::CHANGE_INTERACTION_TRANSPORT_TYPE:
+          throw RTIinternalError("CHANGE_INTERACTION_TRANSPORT_TYPE: 
Unimplemented");
           msg = new NM_Change_Interaction_Transport_Type(); 
           break;
        case NetworkMessage::CHANGE_INTERACTION_ORDER_TYPE:
+          throw RTIinternalError("CHANGE_INTERACTION_ORDER_TYPE: 
Unimplemented");
           msg = new NM_Change_Interaction_Order_Type(); 
           break;
        case NetworkMessage::REQUEST_CLASS_ATTRIBUTE_VALUE_UPDATE:
@@ -1207,6 +1211,7 @@
     this->name = "REGISTER_OBJECT";
     this->type = NetworkMessage::REGISTER_OBJECT;
     /* specific field init */
+    isLabelled = true;
 }
 NM_Register_Object::~NM_Register_Object() {
 }
@@ -1214,11 +1219,13 @@
   /* call mother class */      
   NetworkMessage::serialize(); 
   /* specific code (if any) goes here */
+  msgBuf.write_int32(object);
 } /* end of serialize */ 
 void NM_Register_Object::deserialize() {
   /* call mother class */      
   NetworkMessage::deserialize(); 
   /* specific code (if any) goes here */
+  object = msgBuf.read_int32();
 } /* end of deserialize */
 /*<END>---------- Register_Object ------------<END>*/
 
@@ -1227,6 +1234,7 @@
     this->name = "DISCOVER_OBJECT";
     this->type = NetworkMessage::DISCOVER_OBJECT;
     /* specific field init */
+    isLabelled = true;
 }
 NM_Discover_Object::~NM_Discover_Object() {
 }
@@ -1234,11 +1242,13 @@
   /* call mother class */      
   NetworkMessage::serialize(); 
   /* specific code (if any) goes here */
+  msgBuf.write_int32(object);
 } /* end of serialize */ 
 void NM_Discover_Object::deserialize() {
   /* call mother class */      
   NetworkMessage::deserialize(); 
   /* specific code (if any) goes here */
+  object = msgBuf.read_int32();
 } /* end of deserialize */
 /*<END>---------- Discover_Object ------------<END>*/
 
@@ -1247,18 +1257,47 @@
     this->name = "UPDATE_ATTRIBUTE_VALUES";
     this->type = NetworkMessage::UPDATE_ATTRIBUTE_VALUES;
     /* specific field init */
+    isDated    = true;
+    isLabelled = true;
 }
 NM_Update_Attribute_Values::~NM_Update_Attribute_Values() {
 }
 void NM_Update_Attribute_Values::serialize() {
+  int i;
   /* call mother class */      
   NetworkMessage::serialize(); 
   /* specific code (if any) goes here */
+  msgBuf.write_int32(objectClass);
+  msgBuf.write_bool(hasHandleArray);
+  if (hasHandleArray) {
+         msgBuf.write_uint16(handleArraySize);
+         for (i = 0 ; i < handleArraySize ; i ++) {
+                 msgBuf.write_uint16(handleArray[i]);
+         }
+  }
+  /* the value pre-encoded by the user (HLA 1.3) */
+  for (i = 0 ; i < handleArraySize ; i++) {
+         msgBuf.write_int32(ValueArray[i].length) ;
+         msgBuf.write_bytes(ValueArray[i].value, ValueArray[i].length);
+  }    
 } /* end of serialize */ 
 void NM_Update_Attribute_Values::deserialize() {
+  int i;
   /* call mother class */      
   NetworkMessage::deserialize(); 
   /* specific code (if any) goes here */
+  objectClass = msgBuf.read_int32();
+  hasHandleArray = msgBuf.read_bool();
+  if (hasHandleArray) {
+         handleArraySize = msgBuf.read_int16();
+         for (i = 0 ; i < handleArraySize ; i ++) {
+                       handleArray[i] = msgBuf.read_int16();
+         }
+  }  
+  for (i = 0 ; i < handleArraySize ; i ++) {
+         ValueArray[i].length = msgBuf.read_int32();
+         msgBuf.read_bytes(ValueArray[i].value, ValueArray[i].length);
+  }
 } /* end of deserialize */
 /*<END>---------- Update_Attribute_Values ------------<END>*/
 
@@ -1270,16 +1309,7 @@
 }
 NM_Reflect_Attribute_Values::~NM_Reflect_Attribute_Values() {
 }
-void NM_Reflect_Attribute_Values::serialize() {
-  /* call mother class */      
-  NetworkMessage::serialize(); 
-  /* specific code (if any) goes here */
-} /* end of serialize */ 
-void NM_Reflect_Attribute_Values::deserialize() {
-  /* call mother class */      
-  NetworkMessage::deserialize(); 
-  /* specific code (if any) goes here */
-} /* end of deserialize */
+
 /*<END>---------- Reflect_Attribute_Values ------------<END>*/
 
 /*<BEGIN>---------- Send_Interaction ------------<BEGIN>*/
@@ -1287,18 +1317,47 @@
     this->name = "SEND_INTERACTION";
     this->type = NetworkMessage::SEND_INTERACTION;
     /* specific field init */
+    isDated    = true;
+    isLabelled = true;
 }
 NM_Send_Interaction::~NM_Send_Interaction() {
 }
 void NM_Send_Interaction::serialize() {
+       int i;
   /* call mother class */      
   NetworkMessage::serialize(); 
   /* specific code (if any) goes here */
+  msgBuf.write_int32(interactionClass);
+    msgBuf.write_bool(hasHandleArray);
+    if (hasHandleArray) {
+         msgBuf.write_uint16(handleArraySize);
+         for (i = 0 ; i < handleArraySize ; i ++) {
+                 msgBuf.write_uint16(handleArray[i]);
+         }
+    }
+    /* the value pre-encoded by the user (HLA 1.3) */
+    for (i = 0 ; i < handleArraySize ; i++) {
+         msgBuf.write_int32(ValueArray[i].length) ;
+         msgBuf.write_bytes(ValueArray[i].value, ValueArray[i].length);
+    }    
 } /* end of serialize */ 
 void NM_Send_Interaction::deserialize() {
+       int i;
   /* call mother class */      
   NetworkMessage::deserialize(); 
   /* specific code (if any) goes here */
+  interactionClass = msgBuf.read_int32();
+    hasHandleArray = msgBuf.read_bool();
+    if (hasHandleArray) {
+         handleArraySize = msgBuf.read_int16();
+         for (i = 0 ; i < handleArraySize ; i ++) {
+                       handleArray[i] = msgBuf.read_int16();
+         }
+    }  
+    for (i = 0 ; i < handleArraySize ; i ++) {
+         ValueArray[i].length = msgBuf.read_int32();
+         msgBuf.read_bytes(ValueArray[i].value, ValueArray[i].length);
+    }
 } /* end of deserialize */
 /*<END>---------- Send_Interaction ------------<END>*/
 
@@ -1310,16 +1369,6 @@
 }
 NM_Receive_Interaction::~NM_Receive_Interaction() {
 }
-void NM_Receive_Interaction::serialize() {
-  /* call mother class */      
-  NetworkMessage::serialize(); 
-  /* specific code (if any) goes here */
-} /* end of serialize */ 
-void NM_Receive_Interaction::deserialize() {
-  /* call mother class */      
-  NetworkMessage::deserialize(); 
-  /* specific code (if any) goes here */
-} /* end of deserialize */
 /*<END>---------- Receive_Interaction ------------<END>*/
 
 /*<BEGIN>---------- Delete_Object ------------<BEGIN>*/
@@ -1327,6 +1376,8 @@
     this->name = "DELETE_OBJECT";
     this->type = NetworkMessage::DELETE_OBJECT;
     /* specific field init */
+    isDated    = true;
+    isLabelled = true;
 }
 NM_Delete_Object::~NM_Delete_Object() {
 }
@@ -1334,11 +1385,13 @@
   /* call mother class */      
   NetworkMessage::serialize(); 
   /* specific code (if any) goes here */
+  msgBuf.write_int32(object);
 } /* end of serialize */ 
 void NM_Delete_Object::deserialize() {
   /* call mother class */      
   NetworkMessage::deserialize(); 
   /* specific code (if any) goes here */
+  object = msgBuf.read_int32();
 } /* end of deserialize */
 /*<END>---------- Delete_Object ------------<END>*/
 
@@ -1350,16 +1403,7 @@
 }
 NM_Remove_Object::~NM_Remove_Object() {
 }
-void NM_Remove_Object::serialize() {
-  /* call mother class */      
-  NetworkMessage::serialize(); 
-  /* specific code (if any) goes here */
-} /* end of serialize */ 
-void NM_Remove_Object::deserialize() {
-  /* call mother class */      
-  NetworkMessage::deserialize(); 
-  /* specific code (if any) goes here */
-} /* end of deserialize */
+
 /*<END>---------- Remove_Object ------------<END>*/
 
 /*<BEGIN>---------- Change_Attribute_Transport_Type ------------<BEGIN>*/

Index: scripts/NW_MessageType.ods
===================================================================
RCS file: /sources/certi/certi/scripts/Attic/NW_MessageType.ods,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -b -r1.1.2.1 -r1.1.2.2
Binary files /tmp/cvsNaUjHD and /tmp/cvsYbSPIm differ




reply via email to

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