[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[certi-cvs] certi RTIA/ObjectManagement.cc RTIA/ObjectManag...
From: |
certi-cvs |
Subject: |
[certi-cvs] certi RTIA/ObjectManagement.cc RTIA/ObjectManag... |
Date: |
Wed, 11 Jun 2008 15:19:23 +0000 |
CVSROOT: /sources/certi
Module name: certi
Changes by: ROUSSELOT <rousse> 08/06/11 15:19:23
Modified files:
RTIA : ObjectManagement.cc ObjectManagement.hh
RTIA_federate.cc TimeManagement.cc
RTIG : Federation.cc Federation.hh FederationsList.cc
FederationsList.hh RTIG_processing.cc
include : certi.hh
libCERTI : Interaction.cc Interaction.hh InteractionSet.cc
InteractionSet.hh Message.cc Message.hh
Message_R.cc Message_W.cc NM_Classes.cc
NM_Classes.hh NetworkMessage.cc
NetworkMessage.hh ObjectClass.cc ObjectClass.hh
ObjectClassBroadcastList.cc
ObjectClassBroadcastList.hh ObjectClassSet.cc
ObjectClassSet.hh
Log message:
#23329 BUG correction (MAX_ATTRIBUTES_PER_CLASS suppressed) and to be
continued
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/ObjectManagement.cc?cvsroot=certi&r1=3.47&r2=3.48
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/ObjectManagement.hh?cvsroot=certi&r1=3.22&r2=3.23
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/RTIA_federate.cc?cvsroot=certi&r1=3.82&r2=3.83
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/TimeManagement.cc?cvsroot=certi&r1=3.41&r2=3.42
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/Federation.cc?cvsroot=certi&r1=3.89&r2=3.90
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/Federation.hh?cvsroot=certi&r1=3.48&r2=3.49
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/FederationsList.cc?cvsroot=certi&r1=3.57&r2=3.58
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/FederationsList.hh?cvsroot=certi&r1=3.42&r2=3.43
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/RTIG_processing.cc?cvsroot=certi&r1=3.73&r2=3.74
http://cvs.savannah.gnu.org/viewcvs/certi/include/certi.hh?cvsroot=certi&r1=3.28&r2=3.29
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Interaction.cc?cvsroot=certi&r1=3.38&r2=3.39
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Interaction.hh?cvsroot=certi&r1=3.27&r2=3.28
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/InteractionSet.cc?cvsroot=certi&r1=3.21&r2=3.22
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/InteractionSet.hh?cvsroot=certi&r1=3.16&r2=3.17
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Message.cc?cvsroot=certi&r1=3.55&r2=3.56
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Message.hh?cvsroot=certi&r1=3.47&r2=3.48
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Message_R.cc?cvsroot=certi&r1=3.27&r2=3.28
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Message_W.cc?cvsroot=certi&r1=3.32&r2=3.33
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NM_Classes.cc?cvsroot=certi&r1=3.9&r2=3.10
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NM_Classes.hh?cvsroot=certi&r1=3.5&r2=3.6
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NetworkMessage.cc?cvsroot=certi&r1=3.33&r2=3.34
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NetworkMessage.hh?cvsroot=certi&r1=3.37&r2=3.38
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClass.cc?cvsroot=certi&r1=3.47&r2=3.48
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClass.hh?cvsroot=certi&r1=3.35&r2=3.36
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClassBroadcastList.cc?cvsroot=certi&r1=3.21&r2=3.22
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClassBroadcastList.hh?cvsroot=certi&r1=3.9&r2=3.10
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClassSet.cc?cvsroot=certi&r1=3.36&r2=3.37
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClassSet.hh?cvsroot=certi&r1=3.28&r2=3.29
Patches:
Index: RTIA/ObjectManagement.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/ObjectManagement.cc,v
retrieving revision 3.47
retrieving revision 3.48
diff -u -b -r3.47 -r3.48
--- RTIA/ObjectManagement.cc 10 Jun 2008 13:41:44 -0000 3.47
+++ RTIA/ObjectManagement.cc 11 Jun 2008 15:19:19 -0000 3.48
@@ -107,7 +107,7 @@
EventRetractionHandle
ObjectManagement::updateAttributeValues(ObjectHandle theObjectHandle,
std::vector<AttributeHandle>
&attribArray,
- ValueLengthPair *valueArray,
+ std::vector<ValueLengthPair>
&valueArray,
UShort attribArraySize,
FederationTime theTime,
std::string theTag,
@@ -130,6 +130,7 @@
req.setDate(theTime);
req.handleArray.resize(attribArraySize) ;
req.handleArraySize = attribArraySize ;
+ req.sizeValueArray(attribArraySize) ;
for (i = 0 ; i < attribArraySize ; i++) {
req.handleArray[i] = attribArray[i] ;
@@ -172,7 +173,7 @@
void
ObjectManagement::updateAttributeValues(ObjectHandle theObjectHandle,
std::vector<AttributeHandle>
&attribArray,
- ValueLengthPair *valueArray,
+ std::vector<ValueLengthPair>
&valueArray,
UShort attribArraySize,
std::string theTag,
TypeException &e)
@@ -187,6 +188,7 @@
// Do no set Date if without time
req.handleArray.resize(attribArraySize) ;
req.handleArraySize = attribArraySize ;
+ req.sizeValueArray(attribArraySize) ;
for (i = 0 ; i < attribArraySize ; i++) {
req.handleArray[i] = attribArray[i] ;
@@ -233,7 +235,7 @@
void
ObjectManagement::reflectAttributeValues(ObjectHandle the_object,
std::vector <AttributeHandle>
&the_attributes,
- ValueLengthPair *the_values,
+ std::vector <ValueLengthPair>
&the_values,
UShort the_size,
FederationTime the_time,
const char *the_tag,
@@ -261,7 +263,7 @@
void
ObjectManagement::reflectAttributeValues(ObjectHandle the_object,
std::vector <AttributeHandle>
&the_attributes,
- ValueLengthPair *the_values,
+ std::vector <ValueLengthPair>
&the_values,
UShort the_size,
const char *the_tag,
TypeException &)
@@ -285,7 +287,7 @@
EventRetractionHandle
ObjectManagement::sendInteraction(InteractionClassHandle theInteraction,
std::vector <ParameterHandle> ¶mArray,
- ParameterLengthPair *valueArray,
+ std::vector <ParameterLengthPair>
&valueArray,
UShort paramArraySize,
FederationTime theTime,
std::string theTag,
@@ -315,6 +317,7 @@
req.federate = fm->federate ;
req.handleArray.resize(paramArraySize) ;
req.handleArraySize = paramArraySize ;
+ req.sizeValueArray(paramArraySize) ;
for (int i=0 ; i<paramArraySize ; i++) {
req.handleArray[i] = paramArray[i] ;
@@ -342,7 +345,7 @@
void
ObjectManagement::sendInteraction(InteractionClassHandle theInteraction,
std::vector <ParameterHandle> ¶mArray,
- ParameterLengthPair *valueArray,
+ std::vector <ParameterLengthPair>
&valueArray,
UShort paramArraySize,
std::string theTag,
RegionHandle region,
@@ -363,6 +366,7 @@
req.federate = fm->federate ;
req.handleArray.resize(paramArraySize) ;
req.handleArraySize = paramArraySize ;
+ req.sizeValueArray(paramArraySize) ;
for (int i=0 ; i<paramArraySize ; i++) {
req.handleArray[i] = paramArray[i] ;
@@ -384,7 +388,7 @@
void
ObjectManagement::receiveInteraction(InteractionClassHandle the_interaction,
std::vector <ParameterHandle>
&the_parameters,
- ParameterLengthPair *the_values,
+ std::vector <ParameterLengthPair>
&the_values,
UShort the_size,
FederationTime the_time,
const char *the_tag,
@@ -408,7 +412,7 @@
void
ObjectManagement::receiveInteraction(InteractionClassHandle the_interaction,
std::vector <ParameterHandle>
&the_parameters,
- ParameterLengthPair *the_values,
+ std::vector <ParameterLengthPair>
&the_values,
UShort the_size,
const char *the_tag,
TypeException &)
Index: RTIA/ObjectManagement.hh
===================================================================
RCS file: /sources/certi/certi/RTIA/ObjectManagement.hh,v
retrieving revision 3.22
retrieving revision 3.23
diff -u -b -r3.22 -r3.23
--- RTIA/ObjectManagement.hh 10 Jun 2008 13:41:44 -0000 3.22
+++ RTIA/ObjectManagement.hh 11 Jun 2008 15:19:19 -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: ObjectManagement.hh,v 3.22 2008/06/10 13:41:44 rousse Exp $
+// $Id: ObjectManagement.hh,v 3.23 2008/06/11 15:19:19 rousse Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_RTIA_OM
@@ -54,7 +54,7 @@
EventRetractionHandle
updateAttributeValues(ObjectHandle theObjectHandle,
std::vector<AttributeHandle> &attribArray,
- ValueLengthPair *valueArray,
+ std::vector <ValueLengthPair> &valueArray,
UShort attribArraySize,
FederationTime theTime,
std::string theTag,
@@ -62,7 +62,7 @@
void updateAttributeValues(ObjectHandle theObjectHandle,
std::vector<AttributeHandle> &attribArray,
- ValueLengthPair *valueArray,
+ std::vector <ValueLengthPair> &valueArray,
UShort attribArraySize,
std::string theTag,
TypeException &e);
@@ -76,7 +76,7 @@
void reflectAttributeValues(ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &attribArray,
- ValueLengthPair *valueArray,
+ std::vector <ValueLengthPair> &valueArray,
UShort attribArraySize,
FederationTime theTime,
const char *theTag,
@@ -85,7 +85,7 @@
void reflectAttributeValues(ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &attribArray,
- ValueLengthPair *valueArray,
+ std::vector <ValueLengthPair> &valueArray,
UShort attribArraySize,
const char *theTag,
TypeException &e);
@@ -93,7 +93,7 @@
EventRetractionHandle
sendInteraction(InteractionClassHandle theInteraction,
std::vector <ParameterHandle> ¶mArray,
- ParameterLengthPair *valueArray,
+ std::vector <ParameterLengthPair> &valueArray,
UShort paramArraySize,
FederationTime theTime,
std::string theTag,
@@ -103,7 +103,7 @@
void
sendInteraction(InteractionClassHandle theInteraction,
std::vector <ParameterHandle> ¶mArray,
- ParameterLengthPair *valueArray,
+ std::vector <ParameterLengthPair> &valueArray,
UShort paramArraySize,
std::string theTag,
RegionHandle,
@@ -111,7 +111,7 @@
void receiveInteraction(InteractionClassHandle theInteraction,
std::vector <ParameterHandle> ¶mArray,
- ParameterLengthPair *valueArray,
+ std::vector <ParameterLengthPair> &valueArray,
UShort paramArraySize,
FederationTime theTime,
const char *theTag,
@@ -120,7 +120,7 @@
void receiveInteraction(InteractionClassHandle theInteraction,
std::vector <ParameterHandle> ¶mArray,
- ParameterLengthPair *valueArray,
+ std::vector <ParameterLengthPair> &valueArray,
UShort paramArraySize,
const char *theTag,
TypeException &e);
@@ -229,4 +229,4 @@
#endif // _CERTI_RTIA_OM
-// $Id: ObjectManagement.hh,v 3.22 2008/06/10 13:41:44 rousse Exp $
+// $Id: ObjectManagement.hh,v 3.23 2008/06/11 15:19:19 rousse Exp $
Index: RTIA/RTIA_federate.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/RTIA_federate.cc,v
retrieving revision 3.82
retrieving revision 3.83
diff -u -b -r3.82 -r3.83
--- RTIA/RTIA_federate.cc 10 Jun 2008 13:41:44 -0000 3.82
+++ RTIA/RTIA_federate.cc 11 Jun 2008 15:19:19 -0000 3.83
@@ -398,7 +398,7 @@
case Message::UPDATE_ATTRIBUTE_VALUES: {
- ValueLengthPair *ValueArray = req->getValueArray();
+ std::vector <ValueLengthPair> ValueArray = req->getValueArray();
try {
if (req->getBoolean() )
@@ -427,9 +427,9 @@
}
// Don't forget boolean value for the answer
rep.setBoolean(req->getBoolean()) ;
- free(ValueArray);
+ ValueArray.empty() ;
} catch (Exception *e) {
- free(ValueArray);
+ ValueArray.empty() ;
throw e ;
}
}
@@ -437,7 +437,7 @@
case Message::SEND_INTERACTION: {
- ParameterLengthPair *ValueArray = (ParameterLengthPair *)
req->getValueArray();
+ std::vector <ParameterLengthPair> ValueArray = req->getValueArray();
G.Out(pdGendoc,"S_I into RTIA::chooseFederateProcessing") ;
try {
if (req->getBoolean() )
@@ -466,9 +466,9 @@
req->getRegion(),
e);
}
- free(ValueArray);
+ ValueArray.empty();
} catch (Exception *e) {
- free(ValueArray);
+ ValueArray.empty();
throw e ;
}
}
Index: RTIA/TimeManagement.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/TimeManagement.cc,v
retrieving revision 3.41
retrieving revision 3.42
diff -u -b -r3.41 -r3.42
--- RTIA/TimeManagement.cc 10 Jun 2008 13:41:44 -0000 3.41
+++ RTIA/TimeManagement.cc 11 Jun 2008 15:19:20 -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: TimeManagement.cc,v 3.41 2008/06/10 13:41:44 rousse Exp $
+// $Id: TimeManagement.cc,v 3.42 2008/06/11 15:19:20 rousse Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -176,7 +176,7 @@
case NetworkMessage::REFLECT_ATTRIBUTE_VALUES:
{
- ValueLengthPair *ValueArray = msg.getAttribValueArray();
+ std::vector <ValueLengthPair> ValueArray = msg.getAttribValueArray();
if (msg.isDated())
om->reflectAttributeValues(msg.object,
@@ -194,7 +194,7 @@
msg.handleArraySize,
msg.getLabel().c_str(),
msg.exception);
- free(ValueArray);
+ ValueArray.empty();
break ;
}
@@ -210,7 +210,7 @@
case NetworkMessage::RECEIVE_INTERACTION:
{
- ParameterLengthPair *ValueArray = msg.getParamValueArray();
+ std::vector <ParameterLengthPair> ValueArray =
msg.getParamValueArray();
if (msg.isDated())
om->receiveInteraction(msg.interactionClass,
@@ -228,7 +228,7 @@
msg.handleArraySize,
msg.getLabel().c_str(),
msg.exception);
- free(ValueArray);
+ ValueArray.empty();
break ;
}
@@ -976,4 +976,4 @@
}} // namespaces
-// $Id: TimeManagement.cc,v 3.41 2008/06/10 13:41:44 rousse Exp $
+// $Id: TimeManagement.cc,v 3.42 2008/06/11 15:19:20 rousse Exp $
Index: RTIG/Federation.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/Federation.cc,v
retrieving revision 3.89
retrieving revision 3.90
diff -u -b -r3.89 -r3.90
--- RTIG/Federation.cc 10 Jun 2008 13:41:45 -0000 3.89
+++ RTIG/Federation.cc 11 Jun 2008 15:19:20 -0000 3.90
@@ -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.89 2008/06/10 13:41:45 rousse Exp $
+// $Id: Federation.cc,v 3.90 2008/06/11 15:19:20 rousse Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -622,7 +622,7 @@
Federation::broadcastInteraction(FederateHandle federate_handle,
InteractionClassHandle interaction,
std::vector <ParameterHandle>
¶meter_handles,
- ParameterLengthPair *parameter_values,
+ std::vector <ParameterLengthPair>
¶meter_values,
UShort list_size,
FederationTime time,
RegionHandle region_handle,
@@ -671,7 +671,7 @@
Federation::broadcastInteraction(FederateHandle federate_handle,
InteractionClassHandle interaction,
std::vector <ParameterHandle>
¶meter_handles,
- ParameterLengthPair *parameter_values,
+ std::vector <ParameterLengthPair>
¶meter_values,
UShort list_size,
RegionHandle region_handle,
const char *tag)
@@ -1596,7 +1596,7 @@
Federation::updateAttributeValues(FederateHandle federate,
ObjectHandle id,
std::vector <AttributeHandle> &attributes,
- ValueLengthPair *values,
+ std::vector <ValueLengthPair> &values,
UShort list_size,
FederationTime time,
const char *tag)
@@ -1629,7 +1629,7 @@
Federation::updateAttributeValues(FederateHandle federate,
ObjectHandle id,
std::vector <AttributeHandle> &attributes,
- ValueLengthPair *values,
+ std::vector <ValueLengthPair> &values,
UShort list_size,
const char *tag)
throw (FederateNotExecutionMember,
@@ -2278,5 +2278,5 @@
}} // namespace certi/rtig
-// $Id: Federation.cc,v 3.89 2008/06/10 13:41:45 rousse Exp $
+// $Id: Federation.cc,v 3.90 2008/06/11 15:19:20 rousse Exp $
Index: RTIG/Federation.hh
===================================================================
RCS file: /sources/certi/certi/RTIG/Federation.hh,v
retrieving revision 3.48
retrieving revision 3.49
diff -u -b -r3.48 -r3.49
--- RTIG/Federation.hh 10 Jun 2008 13:41:45 -0000 3.48
+++ RTIG/Federation.hh 11 Jun 2008 15:19:20 -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: Federation.hh,v 3.48 2008/06/10 13:41:45 rousse Exp $
+// $Id: Federation.hh,v 3.49 2008/06/11 15:19:20 rousse Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_RTIG_FEDERATION_HH
@@ -288,7 +288,7 @@
void updateAttributeValues(FederateHandle theFederateHandle,
ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &theAttributeList,
- ValueLengthPair *theValueList,
+ std::vector <ValueLengthPair> &theValueList,
UShort theListSize,
FederationTime theTime,
const char *theTag)
@@ -303,7 +303,7 @@
void updateAttributeValues(FederateHandle theFederateHandle,
ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &theAttributeList,
- ValueLengthPair *theValueList,
+ std::vector <ValueLengthPair> &theValueList,
UShort theListSize,
const char *theTag)
throw (FederateNotExecutionMember,
@@ -321,7 +321,7 @@
void broadcastInteraction(FederateHandle theFederateHandle,
InteractionClassHandle theInteractionHandle,
std::vector <ParameterHandle> &theParameterList,
- ParameterLengthPair *theValueList,
+ std::vector <ParameterLengthPair> &theValueList,
UShort theListSize,
FederationTime theTime,
RegionHandle,
@@ -337,7 +337,7 @@
void broadcastInteraction(FederateHandle theFederateHandle,
InteractionClassHandle theInteractionHandle,
std::vector <ParameterHandle> &theParameterList,
- ParameterLengthPair *theValueList,
+ std::vector <ParameterLengthPair> &theValueList,
UShort theListSize,
RegionHandle,
const char *theTag)
@@ -597,4 +597,4 @@
#endif // _CERTI_RTIG_FEDERATION_HH
-// $Id: Federation.hh,v 3.48 2008/06/10 13:41:45 rousse Exp $
+// $Id: Federation.hh,v 3.49 2008/06/11 15:19:20 rousse Exp $
Index: RTIG/FederationsList.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/FederationsList.cc,v
retrieving revision 3.57
retrieving revision 3.58
diff -u -b -r3.57 -r3.58
--- RTIG/FederationsList.cc 10 Jun 2008 13:41:45 -0000 3.57
+++ RTIG/FederationsList.cc 11 Jun 2008 15:19:20 -0000 3.58
@@ -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.57 2008/06/10 13:41:45 rousse Exp $
+// $Id: FederationsList.cc,v 3.58 2008/06/11 15:19:20 rousse Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -438,7 +438,7 @@
FederateHandle federate,
ObjectHandle id,
std::vector <AttributeHandle> &attributes,
- ValueLengthPair *values,
+ std::vector <ValueLengthPair> &values,
UShort list_size,
FederationTime time,
const char *tag)
@@ -471,7 +471,7 @@
FederateHandle federate,
ObjectHandle id,
std::vector <AttributeHandle> &attributes,
- ValueLengthPair *values,
+ std::vector <ValueLengthPair> &values,
UShort list_size,
const char *tag)
throw (FederateNotExecutionMember,
@@ -502,7 +502,7 @@
FederateHandle federate,
InteractionClassHandle interaction,
std::vector <ParameterHandle> ¶meters,
- ParameterLengthPair *values,
+ std::vector <ParameterLengthPair> &values,
UShort list_size,
FederationTime time,
RegionHandle region,
@@ -541,7 +541,7 @@
FederateHandle federate,
InteractionClassHandle interaction,
std::vector <ParameterHandle> ¶meters,
- ParameterLengthPair *values,
+ std::vector <ParameterLengthPair> &values,
UShort list_size,
RegionHandle region,
const char *tag)
@@ -1558,5 +1558,5 @@
}} // certi::rtig
-// EOF $Id: FederationsList.cc,v 3.57 2008/06/10 13:41:45 rousse Exp $
+// EOF $Id: FederationsList.cc,v 3.58 2008/06/11 15:19:20 rousse Exp $
Index: RTIG/FederationsList.hh
===================================================================
RCS file: /sources/certi/certi/RTIG/FederationsList.hh,v
retrieving revision 3.42
retrieving revision 3.43
diff -u -b -r3.42 -r3.43
--- RTIG/FederationsList.hh 10 Jun 2008 13:41:45 -0000 3.42
+++ RTIG/FederationsList.hh 11 Jun 2008 15:19:20 -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.hh,v 3.42 2008/06/10 13:41:45 rousse Exp $
+// $Id: FederationsList.hh,v 3.43 2008/06/11 15:19:20 rousse Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_RTIG_FEDERATIONS_LIST_HH
@@ -299,7 +299,7 @@
FederateHandle theFederateHandle,
ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &theAttributeList,
- ValueLengthPair *theValueList,
+ std::vector <ValueLengthPair> &theValueList,
UShort theListSize,
FederationTime theTime,
const char *theTag)
@@ -316,7 +316,7 @@
FederateHandle theFederateHandle,
ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &theAttributeList,
- ValueLengthPair *theValueList,
+ std::vector <ValueLengthPair> &theValueList,
UShort theListSize,
const char *theTag)
throw (FederateNotExecutionMember,
@@ -360,7 +360,7 @@
FederateHandle theFederateHandle,
InteractionClassHandle theInteractionHandle,
std::vector <ParameterHandle> &theParameterList,
- ParameterLengthPair *theValueList,
+ std::vector <ParameterLengthPair> &theValueList,
UShort theListSize,
FederationTime theTime,
RegionHandle,
@@ -378,7 +378,7 @@
FederateHandle theFederateHandle,
InteractionClassHandle theInteractionHandle,
std::vector <ParameterHandle> &theParameterList,
- ParameterLengthPair *theValueList,
+ std::vector <ParameterLengthPair> &theValueList,
UShort theListSize,
RegionHandle,
const char *theTag)
@@ -585,4 +585,4 @@
#endif // _CERTI_RTIG_FEDERATIONS_LIST_HH
-// $Id: FederationsList.hh,v 3.42 2008/06/10 13:41:45 rousse Exp $
+// $Id: FederationsList.hh,v 3.43 2008/06/11 15:19:20 rousse Exp $
Index: RTIG/RTIG_processing.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/RTIG_processing.cc,v
retrieving revision 3.73
retrieving revision 3.74
diff -u -b -r3.73 -r3.74
--- RTIG/RTIG_processing.cc 10 Jun 2008 13:41:45 -0000 3.73
+++ RTIG/RTIG_processing.cc 11 Jun 2008 15:19:20 -0000 3.74
@@ -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.73 2008/06/10 13:41:45 rousse Exp $
+// $Id: RTIG_processing.cc,v 3.74 2008/06/11 15:19:20 rousse Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -792,7 +792,7 @@
RTIG::processUpdateAttributeValues(Socket *link, NetworkMessage *req)
{
G.Out(pdGendoc,"enter RTIG::processUpdateAttributeValues");
- ValueLengthPair *ValueArray = NULL ;
+ std::vector <ValueLengthPair> ValueArray ;
auditServer << "ObjID = " << req->object
<< ", Date = " << req->getDate() ;
@@ -824,7 +824,7 @@
req->handleArraySize,
req->getLabel().c_str());
}
- free(ValueArray);
+ ValueArray.empty();
// Building answer (Network Message re)
NM_Update_Attribute_Values rep ;
@@ -845,7 +845,7 @@
void
RTIG::processSendInteraction(Socket *link, NetworkMessage *req)
{
- ValueLengthPair *values = NULL ;
+ std::vector <ValueLengthPair> values ;
G.Out(pdGendoc,"BEGIN ** SEND INTERACTION SERVICE **");
G.Out(pdGendoc,"enter RTIG::processSendInteraction");
@@ -878,7 +878,7 @@
req->region,
req->getLabel().c_str());
}
- free(values);
+ values.empty();
D.Out(pdDebug, "Interaction %d parameters update completed",
req->interactionClass);
@@ -1432,4 +1432,4 @@
}} // namespace certi/rtig
-// $Id: RTIG_processing.cc,v 3.73 2008/06/10 13:41:45 rousse Exp $
+// $Id: RTIG_processing.cc,v 3.74 2008/06/11 15:19:20 rousse Exp $
Index: include/certi.hh
===================================================================
RCS file: /sources/certi/certi/include/certi.hh,v
retrieving revision 3.28
retrieving revision 3.29
diff -u -b -r3.28 -r3.29
--- include/certi.hh 29 May 2008 12:20:35 -0000 3.28
+++ include/certi.hh 11 Jun 2008 15:19:20 -0000 3.29
@@ -16,8 +16,9 @@
// 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: certi.hh,v 3.28 2008/05/29 12:20:35 rousse Exp $
+// $Id: certi.hh,v 3.29 2008/06/11 15:19:20 rousse Exp $
// ----------------------------------------------------------------------------
+#include <vector>
#ifndef CERTI_HH_INCLUDED
#define CERTI_HH_INCLUDED
@@ -91,12 +92,13 @@
*/
// Deprecated HLA macros still in use
+// Will be suppressed asap
#define MAX_BYTES_PER_VALUE 500
//#define MAX_FEDERATE_NAME_LENGTH 64
#undef MAX_USER_TAG_LENGTH
#define MAX_USER_TAG_LENGTH 64
-#undef MAX_ATTRIBUTES_PER_CLASS
-#define MAX_ATTRIBUTES_PER_CLASS 50
+//#undef MAX_ATTRIBUTES_PER_CLASS
+//#define MAX_ATTRIBUTES_PER_CLASS 50
#define MAX_BYTES_PER_VALUETYPE 128
//#undef MAX_PARAMETERS_PER_CLASS
//#define MAX_PARAMETERS_PER_CLASS 50
@@ -236,6 +238,7 @@
// Deprecated HLA types still in use
typedef char AttributeValue[MAX_BYTES_PER_VALUE + 1] ;
+//typedef std::vector<char> AttributeValue ;
// typedef std::vector<char> AttributeValue;
typedef RTI::Double FederationTime ;
@@ -381,4 +384,4 @@
(uint64_t) CERTI_INT64_CONSTANT(0xff00000000000000U)) >> 56)))
#endif // CERTI_HH_INCLUDED
-// $Id: certi.hh,v 3.28 2008/05/29 12:20:35 rousse Exp $
+// $Id: certi.hh,v 3.29 2008/06/11 15:19:20 rousse Exp $
Index: libCERTI/Interaction.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Interaction.cc,v
retrieving revision 3.38
retrieving revision 3.39
diff -u -b -r3.38 -r3.39
--- libCERTI/Interaction.cc 10 Jun 2008 13:41:45 -0000 3.38
+++ libCERTI/Interaction.cc 11 Jun 2008 15:19:21 -0000 3.39
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: Interaction.cc,v 3.38 2008/06/10 13:41:45 rousse Exp $
+// $Id: Interaction.cc,v 3.39 2008/06/11 15:19:21 rousse Exp $
// ----------------------------------------------------------------------------
@@ -388,7 +388,7 @@
InteractionBroadcastList *
Interaction::sendInteraction(FederateHandle federate_handle,
std::vector <ParameterHandle> ¶meter_list,
- ParameterLengthPair *value_list,
+ std::vector <ParameterLengthPair> &value_list,
UShort list_size,
FederationTime time,
const RTIRegion *region,
@@ -448,7 +448,7 @@
InteractionBroadcastList *
Interaction::sendInteraction(FederateHandle federate_handle,
std::vector <ParameterHandle> ¶meter_list,
- ParameterLengthPair *value_list,
+ std::vector <ParameterLengthPair> &value_list,
UShort list_size,
const RTIRegion *region,
const char *the_tag)
@@ -551,4 +551,4 @@
} // namespace certi
-// $Id: Interaction.cc,v 3.38 2008/06/10 13:41:45 rousse Exp $
+// $Id: Interaction.cc,v 3.39 2008/06/11 15:19:21 rousse Exp $
Index: libCERTI/Interaction.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/Interaction.hh,v
retrieving revision 3.27
retrieving revision 3.28
diff -u -b -r3.27 -r3.28
--- libCERTI/Interaction.hh 10 Jun 2008 13:41:46 -0000 3.27
+++ libCERTI/Interaction.hh 11 Jun 2008 15:19:21 -0000 3.28
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: Interaction.hh,v 3.27 2008/06/10 13:41:46 rousse Exp $
+// $Id: Interaction.hh,v 3.28 2008/06/11 15:19:21 rousse Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_INTERACTION_HH
@@ -105,7 +105,7 @@
InteractionBroadcastList *
sendInteraction(FederateHandle federate_handle,
std::vector <ParameterHandle> ¶meter_list,
- ParameterLengthPair *value_list,
+ std::vector <ParameterLengthPair> &value_list,
UShort list_size,
FederationTime the_time,
const RTIRegion *,
@@ -118,7 +118,7 @@
InteractionBroadcastList *
sendInteraction(FederateHandle federate_handle,
std::vector <ParameterHandle> ¶meter_list,
- ParameterLengthPair *value_list,
+ std::vector <ParameterLengthPair> &value_list,
UShort list_size,
const RTIRegion *,
const char *the_tag)
@@ -167,4 +167,4 @@
#endif // _CERTI_INTERACTION.HH
-// $Id: Interaction.hh,v 3.27 2008/06/10 13:41:46 rousse Exp $
+// $Id: Interaction.hh,v 3.28 2008/06/11 15:19:21 rousse Exp $
Index: libCERTI/InteractionSet.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/InteractionSet.cc,v
retrieving revision 3.21
retrieving revision 3.22
diff -u -b -r3.21 -r3.22
--- libCERTI/InteractionSet.cc 10 Jun 2008 13:41:46 -0000 3.21
+++ libCERTI/InteractionSet.cc 11 Jun 2008 15:19:21 -0000 3.22
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: InteractionSet.cc,v 3.21 2008/06/10 13:41:46 rousse Exp $
+// $Id: InteractionSet.cc,v 3.22 2008/06/11 15:19:21 rousse Exp $
// ----------------------------------------------------------------------------
#include "Interaction.hh"
@@ -60,7 +60,7 @@
InteractionSet::broadcastInteraction(FederateHandle federate_handle,
InteractionClassHandle interaction_handle,
std::vector <ParameterHandle>
¶meter_list,
- ParameterLengthPair *value_list,
+ std::vector <ParameterLengthPair>
&value_list,
UShort list_size,
FederationTime the_time,
const RTIRegion *region,
@@ -110,7 +110,7 @@
InteractionSet::broadcastInteraction(FederateHandle federate_handle,
InteractionClassHandle interaction_handle,
std::vector <ParameterHandle>
¶meter_list,
- ParameterLengthPair *value_list,
+ std::vector <ParameterLengthPair>
&value_list,
UShort list_size,
const RTIRegion *region,
const char *the_tag)
@@ -357,4 +357,4 @@
} // namespace certi
-// $Id: InteractionSet.cc,v 3.21 2008/06/10 13:41:46 rousse Exp $
+// $Id: InteractionSet.cc,v 3.22 2008/06/11 15:19:21 rousse Exp $
Index: libCERTI/InteractionSet.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/InteractionSet.hh,v
retrieving revision 3.16
retrieving revision 3.17
diff -u -b -r3.16 -r3.17
--- libCERTI/InteractionSet.hh 10 Jun 2008 13:41:46 -0000 3.16
+++ libCERTI/InteractionSet.hh 11 Jun 2008 15:19:21 -0000 3.17
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: InteractionSet.hh,v 3.16 2008/06/10 13:41:46 rousse Exp $
+// $Id: InteractionSet.hh,v 3.17 2008/06/11 15:19:21 rousse Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_INTERACTION_SET_HH
@@ -115,7 +115,7 @@
void broadcastInteraction(FederateHandle theFederateHandle,
InteractionClassHandle theInteractionHandle,
std::vector <ParameterHandle> &theParameterList,
- ParameterLengthPair *theValueList,
+ std::vector <ParameterLengthPair> &theValueList,
UShort theListSize,
FederationTime theTime,
const RTIRegion *,
@@ -128,7 +128,7 @@
void broadcastInteraction(FederateHandle theFederateHandle,
InteractionClassHandle theInteractionHandle,
std::vector <ParameterHandle> &theParameterList,
- ParameterLengthPair *theValueList,
+ std::vector <ParameterLengthPair> &theValueList,
UShort theListSize,
const RTIRegion *,
const char *theTag)
@@ -145,4 +145,4 @@
#endif // _CERTI_INTERACTION_SET_HH
-// $Id: InteractionSet.hh,v 3.16 2008/06/10 13:41:46 rousse Exp $
+// $Id: InteractionSet.hh,v 3.17 2008/06/11 15:19:21 rousse Exp $
Index: libCERTI/Message.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Message.cc,v
retrieving revision 3.55
retrieving revision 3.56
diff -u -b -r3.55 -r3.56
--- libCERTI/Message.cc 10 Jun 2008 13:41:46 -0000 3.55
+++ libCERTI/Message.cc 11 Jun 2008 15:19:21 -0000 3.56
@@ -67,11 +67,7 @@
number = 0 ;
region = 0 ;
//FEDid = NULL ;now string
- for ( int i=0 ; i<MAX_ATTRIBUTES_PER_CLASS ; i++ )
- {
- valueArray[i].length = 0 ;
- valueArray[i].value[0] = '\0' ;
- }
+ valueArray.empty() ;
}
/** getValue : Value and its length are tooken from valueArray[Rank]
@param Rank valueArray rank
@@ -88,7 +84,7 @@
{
// Pre-Checking
- if ((Rank < 0) || (Rank >= handleArraySize))
+ if ((Rank < 0) || ((Rank+1) > (int)valueArray.size()) )
throw RTIinternalError("Bad Rank in Message.");
// Getting Value
@@ -113,19 +109,15 @@
// ----------------------------------------------------------------------------
/** Return a newly allocated ValueArray, exactly of size HandleArraySize.
*/
-ParameterLengthPair *
+std::vector <ParameterLengthPair>
Message::getValueArray()
{
int i ;
unsigned long length ;
- ParameterLengthPair *NewValueArray = NULL ;
+ std::vector <ParameterLengthPair> NewValueArray ;
- NewValueArray = (ParameterLengthPair *) calloc(handleArraySize,
- sizeof(ParameterLengthPair));
-
- if (NewValueArray == NULL)
- throw RTIinternalError("No memory.");
+ NewValueArray.resize(handleArraySize) ;
for (i = 0 ; i < handleArraySize ; i++)
{
@@ -407,6 +399,7 @@
size = the_attributes.size() ;
handleArraySize = size ;
handleArray.resize(handleArraySize);
+ valueArray.resize(size) ;
for (unsigned long i = 0 ; i < size ; i++) {
@@ -481,11 +474,12 @@
// ----------------------------------------------------------------------------
void
Message::setAttributes(std::vector <AttributeHandle> &the_attributes,
- ValueLengthPair *the_values,
+ std::vector <ValueLengthPair> &the_values,
ushort the_size)
{
handleArraySize = the_size ;
handleArray.resize(handleArraySize);
+ valueArray.resize(the_size) ;
for (int i = 0 ; i < the_size ; i++) {
handleArray[i] = the_attributes[i] ;
@@ -496,12 +490,13 @@
// ----------------------------------------------------------------------------
void
Message::setParameters(std::vector <ParameterHandle> & the_parameters,
- ParameterLengthPair * the_values,
+ std::vector <ParameterLengthPair> & the_values,
ushort the_size)
{
handleArraySize = the_size ;
handleArray.resize(handleArraySize);
+ valueArray.resize(the_size) ;
for (int i = 0 ; i < the_size ; i++) {
handleArray[i] = the_parameters[i] ;
@@ -553,9 +548,10 @@
if ((Value == NULL) || (length > MAX_BYTES_PER_VALUE))
throw RTIinternalError("Bad Value for message.");
- if ((Rank < 0) || (Rank >= handleArraySize))
+ if ((Rank < 0))
throw RTIinternalError("Bad Rank for message.");
-
+ if ( (Rank+1) > (int)valueArray.size() )
+ valueArray.resize(Rank+1) ;
// Setting Value
// First we store the length, then copy with memcpy instead of strcpy
valueArray[Rank].length = length ;
@@ -619,6 +615,7 @@
handleArraySize = msg.handleArraySize ;
handleArray.resize(handleArraySize);
+ valueArray.resize(handleArraySize) ;
int i ;
for (i=0 ; i < handleArraySize ; i++)
Index: libCERTI/Message.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/Message.hh,v
retrieving revision 3.47
retrieving revision 3.48
diff -u -b -r3.47 -r3.48
--- libCERTI/Message.hh 10 Jun 2008 13:41:46 -0000 3.47
+++ libCERTI/Message.hh 11 Jun 2008 15:19:21 -0000 3.48
@@ -290,7 +290,7 @@
// Return a newly allocated ValueArray, exactly of size HandleArraySize.
// containing the actual Attrib/Param values. You must FREE this structure.
- ValueLengthPair *getValueArray();
+ std::vector <ValueLengthPair> getValueArray();
std::string getLabel() const { return label ; };
void setLabel(std::string new_label);
@@ -396,8 +396,8 @@
void setPHVPS(const RTI::ParameterHandleValuePairSet &);
void setAttributes(std::vector <AttributeHandle> &, ushort);
- void setAttributes(std::vector <AttributeHandle> &, ValueLengthPair *,
ushort);
- void setParameters(std::vector <ParameterHandle> &, ParameterLengthPair *,
ushort);
+ void setAttributes(std::vector <AttributeHandle> &, std::vector
<ValueLengthPair> &, ushort);
+ void setParameters(std::vector <ParameterHandle> &, std::vector
<ParameterLengthPair> &, ushort);
void setException(TypeException, const char *the_reason = "\0");
TypeException getExceptionType() const { return exception ; };
@@ -442,8 +442,6 @@
// used for both Attributes and Parameters arrays.
UShort handleArraySize ;
- // handle array is now a vector so MAX_ATTRIBUTES_PER_CLASS will be
- // suppressed asap
std::vector <AttributeHandle> handleArray ;
Message &operator=(const Message &);
@@ -496,7 +494,8 @@
std::string tag ;
std::string FEDid ;
- ValueLengthPair valueArray[MAX_ATTRIBUTES_PER_CLASS] ;
+
+ std::vector<ValueLengthPair> valueArray ;
};
} // namespace certi
Index: libCERTI/Message_R.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Message_R.cc,v
retrieving revision 3.27
retrieving revision 3.28
diff -u -b -r3.27 -r3.28
--- libCERTI/Message_R.cc 10 Jun 2008 13:41:46 -0000 3.27
+++ libCERTI/Message_R.cc 11 Jun 2008 15:19:21 -0000 3.28
@@ -17,7 +17,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: Message_R.cc,v 3.27 2008/06/10 13:41:46 rousse Exp $
+// $Id: Message_R.cc,v 3.28 2008/06/11 15:19:21 rousse Exp $
// ----------------------------------------------------------------------------
@@ -541,7 +541,7 @@
void
Message::readHandleArray(MessageBuffer &msgBuffer)
{
- handleArraySize = msgBuffer.read_uint16() ;
+ //handleArraySize = msgBuffer.read_uint16() ;
handleArray.resize(handleArraySize) ;
for ( short i=0 ; i<handleArraySize ; i++)
{
@@ -603,10 +603,14 @@
void
Message::readValueArray(MessageBuffer &msgBuffer)
{
+ G.Out(pdGendoc,"enter Message::readValueArray");
// valueArray contains length and value
// so we have to read length and then value with a read_bytes
+
+ valueArray.resize(handleArraySize) ;
for (int i = 0 ; i < handleArraySize ; i ++)
{
+
valueArray[i].length = msgBuffer.read_int64() ;
msgBuffer.read_bytes((char *) valueArray[i].value,
valueArray[i].length);
}
@@ -622,4 +626,4 @@
} // namespace certi
-// $Id: Message_R.cc,v 3.27 2008/06/10 13:41:46 rousse Exp $
+// $Id: Message_R.cc,v 3.28 2008/06/11 15:19:21 rousse Exp $
Index: libCERTI/Message_W.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Message_W.cc,v
retrieving revision 3.32
retrieving revision 3.33
diff -u -b -r3.32 -r3.33
--- libCERTI/Message_W.cc 10 Jun 2008 13:41:46 -0000 3.32
+++ libCERTI/Message_W.cc 11 Jun 2008 15:19:21 -0000 3.33
@@ -17,7 +17,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: Message_W.cc,v 3.32 2008/06/10 13:41:46 rousse Exp $
+// $Id: Message_W.cc,v 3.33 2008/06/11 15:19:21 rousse Exp $
// ----------------------------------------------------------------------------
@@ -516,7 +516,7 @@
Message::writeHandleArray(MessageBuffer &msgBuffer)
{
//msgBuffer.write_bytes( (char *)handleArray,(unsigned
int)(handleArraySize * sizeof(AttributeHandle))) ;
- msgBuffer.write_uint16(handleArraySize) ;
+ //msgBuffer.write_uint16(handleArraySize) ;
for ( short i=0 ; i<handleArraySize ; i++)
{
msgBuffer.write_uint64(handleArray[i]) ;
@@ -583,4 +583,4 @@
} // namespace certi
-// $Id: Message_W.cc,v 3.32 2008/06/10 13:41:46 rousse Exp $
+// $Id: Message_W.cc,v 3.33 2008/06/11 15:19:21 rousse Exp $
Index: libCERTI/NM_Classes.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/NM_Classes.cc,v
retrieving revision 3.9
retrieving revision 3.10
diff -u -b -r3.9 -r3.10
--- libCERTI/NM_Classes.cc 10 Jun 2008 13:41:46 -0000 3.9
+++ libCERTI/NM_Classes.cc 11 Jun 2008 15:19:21 -0000 3.10
@@ -985,6 +985,7 @@
/* specific code (if any) goes here */
object = msgBuffer.read_int32();
objectClass = msgBuffer.read_int32();
+ ValueArray.resize(handleArraySize) ;
for (i = 0 ; i < handleArraySize ; i ++) {
ValueArray[i].length = msgBuffer.read_int32();
msgBuffer.read_bytes(ValueArray[i].value,
ValueArray[i].length);
@@ -1030,6 +1031,7 @@
/* specific code (if any) goes here */
region = msgBuffer.read_int32();
interactionClass = msgBuffer.read_int32();
+ ValueArray.resize(handleArraySize) ;
for (i = 0 ; i < handleArraySize ; i ++) {
ValueArray[i].length = msgBuffer.read_int32();
msgBuffer.read_bytes(ValueArray[i].value, ValueArray[i].length);
Index: libCERTI/NM_Classes.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/NM_Classes.hh,v
retrieving revision 3.5
retrieving revision 3.6
diff -u -b -r3.5 -r3.6
--- libCERTI/NM_Classes.hh 30 May 2008 14:01:05 -0000 3.5
+++ libCERTI/NM_Classes.hh 11 Jun 2008 15:19:21 -0000 3.6
@@ -777,7 +777,6 @@
protected:
/* specific field */
// ObjectClassHandle objectClass;
- // ValueLengthPair ValueArray[MAX_ATTRIBUTES_PER_CLASS];
private:
};
@@ -809,7 +808,6 @@
protected:
/* specific field */
// InteractionClassHandle interactionClass;
- // ValueLengthPair ValueArray[MAX_ATTRIBUTES_PER_CLASS];
private:
};
Index: libCERTI/NetworkMessage.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/NetworkMessage.cc,v
retrieving revision 3.33
retrieving revision 3.34
diff -u -b -r3.33 -r3.34
--- libCERTI/NetworkMessage.cc 10 Jun 2008 13:41:46 -0000 3.33
+++ libCERTI/NetworkMessage.cc 11 Jun 2008 15:19:21 -0000 3.34
@@ -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.33 2008/06/10 13:41:46 rousse Exp $
+// $Id: NetworkMessage.cc,v 3.34 2008/06/11 15:19:21 rousse Exp $
// ----------------------------------------------------------------------------
@@ -64,10 +64,8 @@
interactionClass = 0 ;
handleArraySize = 0 ;
- for (int i=0 ; i<MAX_ATTRIBUTES_PER_CLASS ; ++i) {
- ValueArray[i].length = 0 ;
- ValueArray[i].value[0] = '\0' ;
- }
+ ValueArray.empty();
+
} /* end of NetworkMessage() */
NetworkMessage::~NetworkMessage() {
@@ -75,18 +73,15 @@
}
// ----------------------------------------------------------------------------
-ValueLengthPair *
+std::vector <ValueLengthPair>
NetworkMessage::getAttribValueArray()
{
- ValueLengthPair *NewValueArray = NULL ;
-
- NewValueArray = (ValueLengthPair *) calloc(handleArraySize,
sizeof(ValueLengthPair));
+ std::vector <ValueLengthPair> NewValueArray ;
unsigned long length ;
- if (NewValueArray == NULL)
- throw RTIinternalError("No memory.");
+ NewValueArray.resize(handleArraySize) ;
for (int i = 0 ; i <handleArraySize ; i++)
{
@@ -98,15 +93,12 @@
}
// ----------------------------------------------------------------------------
-ParameterLengthPair *
+std::vector <ParameterLengthPair>
NetworkMessage::getParamValueArray()
{
- ParameterLengthPair *NewValueArray = NULL ;
-
- NewValueArray = (ParameterLengthPair *) calloc(handleArraySize,
sizeof(ParameterLengthPair));
+ std::vector <ParameterLengthPair> NewValueArray ;
- if (NewValueArray == NULL)
- throw RTIinternalError("No memory.");
+ NewValueArray.resize(handleArraySize) ;
unsigned long length ;
@@ -200,6 +192,7 @@
// Setting Value
// First we store the length, then copy Value with memcpy instead of strcpy
+ ValueArray.resize(handleArraySize) ;
ValueArray[Rank].length = length ;
memcpy(ValueArray[Rank].value, Value, length);
@@ -215,7 +208,13 @@
handleArray[i] = attr[i] ;
}
}
+// ----------------------------------------------------------------------------
+void
+NetworkMessage::sizeValueArray(int size)
+{
+ValueArray.resize(size) ;
+}
} // namespace certi
-// $Id: NetworkMessage.cc,v 3.33 2008/06/10 13:41:46 rousse Exp $
+// $Id: NetworkMessage.cc,v 3.34 2008/06/11 15:19:21 rousse Exp $
Index: libCERTI/NetworkMessage.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/NetworkMessage.hh,v
retrieving revision 3.37
retrieving revision 3.38
diff -u -b -r3.37 -r3.38
--- libCERTI/NetworkMessage.hh 10 Jun 2008 13:41:46 -0000 3.37
+++ libCERTI/NetworkMessage.hh 11 Jun 2008 15:19:22 -0000 3.38
@@ -17,7 +17,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: NetworkMessage.hh,v 3.37 2008/06/10 13:41:46 rousse Exp $
+// $Id: NetworkMessage.hh,v 3.38 2008/06/11 15:19:22 rousse Exp $
// ----------------------------------------------------------------------------
#ifndef CERTI_NETWORK_MESSAGE_HH
@@ -188,11 +188,11 @@
// Return a newly allocated ValueArray, exactly of size AttribArraySize.
// containing the actual Attribute values. You must FREE this structure.
- ValueLengthPair *getAttribValueArray();
+ std::vector <ValueLengthPair> getAttribValueArray();
// Return a newly allocated ValueArray, exactly of size ParamArraySize,
// containing the actual Parameter values. You must FREE this structure.
- ParameterLengthPair *getParamValueArray();
+ std::vector <ParameterLengthPair> getParamValueArray();
void setAHS(const std::vector <AttributeHandle> &, int);
@@ -244,6 +244,8 @@
void setTag(const char *new_tag) {_isTagged = true; tag =
std::string(new_tag); }
const std::string getTag() const {return this->tag;};
+ void sizeValueArray(int size) ;
+
ObjectHandlecount idCount ;
ObjectHandle firstId ;
ObjectHandle lastId ;
@@ -301,7 +303,7 @@
Message_T type;
// ValueArray is now a ValueLengthPair
- ValueLengthPair ValueArray[MAX_ATTRIBUTES_PER_CLASS] ;
+ std::vector <ValueLengthPair> ValueArray ;
private:
/**
@@ -352,4 +354,4 @@
#endif // CERTI_NETWORK_MESSAGE_HH
-// $Id: NetworkMessage.hh,v 3.37 2008/06/10 13:41:46 rousse Exp $
+// $Id: NetworkMessage.hh,v 3.38 2008/06/11 15:19:22 rousse Exp $
Index: libCERTI/ObjectClass.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClass.cc,v
retrieving revision 3.47
retrieving revision 3.48
diff -u -b -r3.47 -r3.48
--- libCERTI/ObjectClass.cc 10 Jun 2008 13:41:46 -0000 3.47
+++ libCERTI/ObjectClass.cc 11 Jun 2008 15:19:22 -0000 3.48
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClass.cc,v 3.47 2008/06/10 13:41:46 rousse Exp $
+// $Id: ObjectClass.cc,v 3.48 2008/06/11 15:19:22 rousse Exp $
// ----------------------------------------------------------------------------
#include "Object.hh"
@@ -883,7 +883,7 @@
ObjectClass::updateAttributeValues(FederateHandle the_federate,
Object *object,
std::vector <AttributeHandle>
&the_attributes,
- ValueLengthPair *the_values,
+ std::vector <ValueLengthPair> &the_values,
int the_size,
FederationTime the_time,
const char *the_tag)
@@ -946,7 +946,7 @@
ObjectClass::updateAttributeValues(FederateHandle the_federate,
Object *object,
std::vector <AttributeHandle>
&the_attributes,
- ValueLengthPair *the_values,
+ std::vector <ValueLengthPair> &the_values,
int the_size,
const char *the_tag)
throw (ObjectNotKnown,
@@ -1823,4 +1823,4 @@
} // namespace certi
-// $Id: ObjectClass.cc,v 3.47 2008/06/10 13:41:46 rousse Exp $
+// $Id: ObjectClass.cc,v 3.48 2008/06/11 15:19:22 rousse Exp $
Index: libCERTI/ObjectClass.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClass.hh,v
retrieving revision 3.35
retrieving revision 3.36
diff -u -b -r3.35 -r3.36
--- libCERTI/ObjectClass.hh 10 Jun 2008 13:41:47 -0000 3.35
+++ libCERTI/ObjectClass.hh 11 Jun 2008 15:19:22 -0000 3.36
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClass.hh,v 3.35 2008/06/10 13:41:47 rousse Exp $
+// $Id: ObjectClass.hh,v 3.36 2008/06/11 15:19:22 rousse Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_OBJECT_CLASS_HH
@@ -55,7 +55,6 @@
} DiffStruct ;
- //DiffStruct DiffArray[MAX_ATTRIBUTES_PER_CLASS] ;
std::vector <DiffStruct> DiffArray ;
int size ;
@@ -202,13 +201,13 @@
ObjectClassBroadcastList *
updateAttributeValues(FederateHandle, Object *, std::vector
<AttributeHandle> &,
- ValueLengthPair *, int, FederationTime, const char *)
+ std::vector <ValueLengthPair> &, int,
FederationTime, const char *)
throw (ObjectNotKnown, AttributeNotDefined, AttributeNotOwned,
RTIinternalError, InvalidObjectHandle);
ObjectClassBroadcastList *
updateAttributeValues(FederateHandle, Object *, std::vector
<AttributeHandle> &,
- ValueLengthPair *, int, const char *)
+ std::vector <ValueLengthPair> &, int, const char *)
throw (ObjectNotKnown, AttributeNotDefined, AttributeNotOwned,
RTIinternalError, InvalidObjectHandle);
@@ -263,4 +262,4 @@
#endif // _CERTI_OBJECT_CLASS_HH
-// $Id: ObjectClass.hh,v 3.35 2008/06/10 13:41:47 rousse Exp $
+// $Id: ObjectClass.hh,v 3.36 2008/06/11 15:19:22 rousse Exp $
Index: libCERTI/ObjectClassBroadcastList.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClassBroadcastList.cc,v
retrieving revision 3.21
retrieving revision 3.22
diff -u -b -r3.21 -r3.22
--- libCERTI/ObjectClassBroadcastList.cc 30 May 2008 14:01:05 -0000
3.21
+++ libCERTI/ObjectClassBroadcastList.cc 11 Jun 2008 15:19:22 -0000
3.22
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClassBroadcastList.cc,v 3.21 2008/05/30 14:01:05 erk Exp $
+// $Id: ObjectClassBroadcastList.cc,v 3.22 2008/06/11 15:19:22 rousse Exp $
// ----------------------------------------------------------------------------
@@ -42,7 +42,7 @@
ObjectBroadcastLine::State init_state)
{
Federate = theFederate ;
- for (AttributeHandle i = 0 ; i <= MAX_ATTRIBUTES_PER_CLASS ; i++)
+ for (AttributeHandle i = 0 ; i <= MAX_STATE_SIZE ; i++)
state[i] = init_state ;
}
@@ -396,4 +396,4 @@
} // namespace certi
-// $Id: ObjectClassBroadcastList.cc,v 3.21 2008/05/30 14:01:05 erk Exp $
+// $Id: ObjectClassBroadcastList.cc,v 3.22 2008/06/11 15:19:22 rousse Exp $
Index: libCERTI/ObjectClassBroadcastList.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClassBroadcastList.hh,v
retrieving revision 3.9
retrieving revision 3.10
diff -u -b -r3.9 -r3.10
--- libCERTI/ObjectClassBroadcastList.hh 30 May 2008 14:01:05 -0000
3.9
+++ libCERTI/ObjectClassBroadcastList.hh 11 Jun 2008 15:19:22 -0000
3.10
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClassBroadcastList.hh,v 3.9 2008/05/30 14:01:05 erk Exp $
+// $Id: ObjectClassBroadcastList.hh,v 3.10 2008/06/11 15:19:22 rousse Exp $
// ----------------------------------------------------------------------------
#ifndef CERTI_OBJECT_CLASS_BROADCAST_LIST_HH
@@ -31,6 +31,8 @@
#include <list>
+#define MAX_STATE_SIZE 1024
+
namespace certi {
class ObjectBroadcastLine {
@@ -40,7 +42,8 @@
ObjectBroadcastLine(FederateHandle fed, State init = notSub);
FederateHandle Federate ;
- State state[MAX_ATTRIBUTES_PER_CLASS + 1] ;
+
+ State state[MAX_STATE_SIZE+1] ;
};
@@ -84,4 +87,4 @@
#endif // CERTI_OBJECT_CLASS_BROADCAST_LIST_HH
-// $Id: ObjectClassBroadcastList.hh,v 3.9 2008/05/30 14:01:05 erk Exp $
+// $Id: ObjectClassBroadcastList.hh,v 3.10 2008/06/11 15:19:22 rousse Exp $
Index: libCERTI/ObjectClassSet.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClassSet.cc,v
retrieving revision 3.36
retrieving revision 3.37
diff -u -b -r3.36 -r3.37
--- libCERTI/ObjectClassSet.cc 10 Jun 2008 13:41:47 -0000 3.36
+++ libCERTI/ObjectClassSet.cc 11 Jun 2008 15:19:22 -0000 3.37
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClassSet.cc,v 3.36 2008/06/10 13:41:47 rousse Exp $
+// $Id: ObjectClassSet.cc,v 3.37 2008/06/11 15:19:22 rousse Exp $
// ----------------------------------------------------------------------------
// Project
@@ -568,7 +568,7 @@
ObjectClassSet::updateAttributeValues(FederateHandle federate,
ObjectHandle object_handle,
std::vector <AttributeHandle>
&attributes,
- ValueLengthPair *values,
+ std::vector <ValueLengthPair> &values,
UShort nb,
FederationTime time,
const char *tag)
@@ -614,7 +614,7 @@
ObjectClassSet::updateAttributeValues(FederateHandle federate,
ObjectHandle object_handle,
std::vector <AttributeHandle>
&attributes,
- ValueLengthPair *values,
+ std::vector <ValueLengthPair> &values,
UShort nb,
const char *tag)
throw (ObjectNotKnown,
@@ -843,4 +843,4 @@
} // namespace certi
-// $Id: ObjectClassSet.cc,v 3.36 2008/06/10 13:41:47 rousse Exp $
+// $Id: ObjectClassSet.cc,v 3.37 2008/06/11 15:19:22 rousse Exp $
Index: libCERTI/ObjectClassSet.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClassSet.hh,v
retrieving revision 3.28
retrieving revision 3.29
diff -u -b -r3.28 -r3.29
--- libCERTI/ObjectClassSet.hh 10 Jun 2008 13:41:47 -0000 3.28
+++ libCERTI/ObjectClassSet.hh 11 Jun 2008 15:19:22 -0000 3.29
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClassSet.hh,v 3.28 2008/06/10 13:41:47 rousse Exp $
+// $Id: ObjectClassSet.hh,v 3.29 2008/06/11 15:19:22 rousse Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_OBJECT_CLASS_SET_HH
@@ -109,7 +109,7 @@
void updateAttributeValues(FederateHandle theFederateHandle,
ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &theAttribArray,
- ValueLengthPair *theValueArray,
+ std::vector <ValueLengthPair> &theValueArray,
UShort theArraySize,
FederationTime theTime,
const char *theUserTag)
@@ -119,7 +119,7 @@
void updateAttributeValues(FederateHandle theFederateHandle,
ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &theAttribArray,
- ValueLengthPair *theValueArray,
+ std::vector <ValueLengthPair> &theValueArray,
UShort theArraySize,
const char *theUserTag)
throw (ObjectNotKnown, AttributeNotDefined, AttributeNotOwned,
@@ -210,4 +210,4 @@
#endif // _CERTI_OBJECT_CLASS_SET_HH
-// $Id: ObjectClassSet.hh,v 3.28 2008/06/10 13:41:47 rousse Exp $
+// $Id: ObjectClassSet.hh,v 3.29 2008/06/11 15:19:22 rousse Exp $
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [certi-cvs] certi RTIA/ObjectManagement.cc RTIA/ObjectManag...,
certi-cvs <=