[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: |
Thu, 18 Sep 2008 14:41:30 +0000 |
CVSROOT: /sources/certi
Module name: certi
Changes by: Petr Gotthard <gotthardp> 08/09/18 14:41:30
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
MessageBuffer.cc Message_R.cc Message_W.cc
NM_Classes.cc NetworkMessage.cc
NetworkMessage.hh ObjectClass.cc ObjectClass.hh
ObjectClassBroadcastList.cc ObjectClassSet.cc
ObjectClassSet.hh
Log message:
BUGFIX: valueArray changed to std::string, should fix bugs #23873,
#23921, #24294
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/ObjectManagement.cc?cvsroot=certi&r1=3.51&r2=3.52
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/ObjectManagement.hh?cvsroot=certi&r1=3.24&r2=3.25
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/RTIA_federate.cc?cvsroot=certi&r1=3.87&r2=3.88
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/TimeManagement.cc?cvsroot=certi&r1=3.44&r2=3.45
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/Federation.cc?cvsroot=certi&r1=3.96&r2=3.97
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/Federation.hh?cvsroot=certi&r1=3.50&r2=3.51
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/FederationsList.cc?cvsroot=certi&r1=3.58&r2=3.59
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/FederationsList.hh?cvsroot=certi&r1=3.43&r2=3.44
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/RTIG_processing.cc?cvsroot=certi&r1=3.76&r2=3.77
http://cvs.savannah.gnu.org/viewcvs/certi/include/certi.hh?cvsroot=certi&r1=3.32&r2=3.33
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Interaction.cc?cvsroot=certi&r1=3.42&r2=3.43
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Interaction.hh?cvsroot=certi&r1=3.28&r2=3.29
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/InteractionSet.cc?cvsroot=certi&r1=3.22&r2=3.23
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/InteractionSet.hh?cvsroot=certi&r1=3.17&r2=3.18
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Message.cc?cvsroot=certi&r1=3.59&r2=3.60
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Message.hh?cvsroot=certi&r1=3.49&r2=3.50
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/MessageBuffer.cc?cvsroot=certi&r1=3.12&r2=3.13
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Message_R.cc?cvsroot=certi&r1=3.30&r2=3.31
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Message_W.cc?cvsroot=certi&r1=3.35&r2=3.36
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NM_Classes.cc?cvsroot=certi&r1=3.12&r2=3.13
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NetworkMessage.cc?cvsroot=certi&r1=3.36&r2=3.37
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/NetworkMessage.hh?cvsroot=certi&r1=3.42&r2=3.43
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClass.cc?cvsroot=certi&r1=3.52&r2=3.53
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClass.hh?cvsroot=certi&r1=3.36&r2=3.37
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClassBroadcastList.cc?cvsroot=certi&r1=3.24&r2=3.25
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClassSet.cc?cvsroot=certi&r1=3.38&r2=3.39
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClassSet.hh?cvsroot=certi&r1=3.30&r2=3.31
Patches:
Index: RTIA/ObjectManagement.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/ObjectManagement.cc,v
retrieving revision 3.51
retrieving revision 3.52
diff -u -b -r3.51 -r3.52
--- RTIA/ObjectManagement.cc 9 Jul 2008 13:48:28 -0000 3.51
+++ RTIA/ObjectManagement.cc 18 Sep 2008 14:41:26 -0000 3.52
@@ -108,7 +108,7 @@
EventRetractionHandle
ObjectManagement::updateAttributeValues(ObjectHandle theObjectHandle,
std::vector<AttributeHandle>
&attribArray,
- std::vector<ValueLengthPair>
&valueArray,
+ std::vector<AttributeValue_t>
&valueArray,
UShort attribArraySize,
FederationTime theTime,
std::string theTag,
@@ -135,9 +135,7 @@
for (i = 0 ; i < attribArraySize ; i++) {
req.handleArray[i] = attribArray[i] ;
- char *tempValue = new char[valueArray[i].length] ;
- memcpy(tempValue,valueArray[i].value,valueArray[i].length) ;
- req.setValue(i, tempValue, valueArray[i].length);
+ req.valueArray[i] = valueArray[i] ;
}
req.setLabel(theTag);
@@ -176,7 +174,7 @@
void
ObjectManagement::updateAttributeValues(ObjectHandle theObjectHandle,
std::vector<AttributeHandle>
&attribArray,
- std::vector<ValueLengthPair>
&valueArray,
+ std::vector<AttributeValue_t>
&valueArray,
UShort attribArraySize,
std::string theTag,
TypeException &e)
@@ -196,9 +194,7 @@
for (i = 0 ; i < attribArraySize ; i++) {
req.handleArray[i] = attribArray[i] ;
- char *tempValue = new char[valueArray[i].length] ;
- memcpy(tempValue,valueArray[i].value,valueArray[i].length) ;
- req.setValue(i, tempValue, valueArray[i].length);
+ req.valueArray[i] = valueArray[i];
}
req.setLabel(theTag);
@@ -241,7 +237,7 @@
void
ObjectManagement::reflectAttributeValues(ObjectHandle the_object,
std::vector <AttributeHandle>
&the_attributes,
- std::vector <ValueLengthPair>
&the_values,
+ std::vector <AttributeValue_t>
&the_values,
UShort the_size,
FederationTime the_time,
const char *the_tag,
@@ -269,7 +265,7 @@
void
ObjectManagement::reflectAttributeValues(ObjectHandle the_object,
std::vector <AttributeHandle>
&the_attributes,
- std::vector <ValueLengthPair>
&the_values,
+ std::vector <AttributeValue_t>
&the_values,
UShort the_size,
const char *the_tag,
TypeException &)
@@ -293,7 +289,7 @@
EventRetractionHandle
ObjectManagement::sendInteraction(InteractionClassHandle theInteraction,
std::vector <ParameterHandle> ¶mArray,
- std::vector <ParameterLengthPair>
&valueArray,
+ std::vector <ParameterValue_t> &valueArray,
UShort paramArraySize,
FederationTime theTime,
std::string theTag,
@@ -327,9 +323,7 @@
for (int i=0 ; i<paramArraySize ; i++) {
req.handleArray[i] = paramArray[i] ;
- char *tempValue = new char[valueArray[i].length] ;
- memcpy(tempValue,valueArray[i].value,valueArray[i].length) ;
- req.setValue(i, tempValue, valueArray[i].length);
+ req.valueArray[i] = valueArray[i];
}
req.setLabel(theTag);
@@ -353,7 +347,7 @@
void
ObjectManagement::sendInteraction(InteractionClassHandle theInteraction,
std::vector <ParameterHandle> ¶mArray,
- std::vector <ParameterLengthPair>
&valueArray,
+ std::vector <ParameterValue_t> &valueArray,
UShort paramArraySize,
std::string theTag,
RegionHandle region,
@@ -378,9 +372,7 @@
for (int i=0 ; i<paramArraySize ; i++) {
req.handleArray[i] = paramArray[i] ;
- char *tempValue = new char[valueArray[i].length] ;
- memcpy(tempValue,valueArray[i].value,valueArray[i].length) ;
- req.setValue(i, tempValue, valueArray[i].length) ;
+ req.valueArray[i] = valueArray[i];
}
req.setLabel(theTag);
@@ -398,7 +390,7 @@
void
ObjectManagement::receiveInteraction(InteractionClassHandle the_interaction,
std::vector <ParameterHandle>
&the_parameters,
- std::vector <ParameterLengthPair>
&the_values,
+ std::vector <ParameterValue_t>
&the_values,
UShort the_size,
FederationTime the_time,
const char *the_tag,
@@ -422,7 +414,7 @@
void
ObjectManagement::receiveInteraction(InteractionClassHandle the_interaction,
std::vector <ParameterHandle>
&the_parameters,
- std::vector <ParameterLengthPair>
&the_values,
+ std::vector <ParameterValue_t>
&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.24
retrieving revision 3.25
diff -u -b -r3.24 -r3.25
--- RTIA/ObjectManagement.hh 9 Jul 2008 13:48:28 -0000 3.24
+++ RTIA/ObjectManagement.hh 18 Sep 2008 14:41:27 -0000 3.25
@@ -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.24 2008/07/09 13:48:28 erk Exp $
+// $Id: ObjectManagement.hh,v 3.25 2008/09/18 14:41:27 gotthardp Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_RTIA_OM
@@ -54,7 +54,7 @@
EventRetractionHandle
updateAttributeValues(ObjectHandle theObjectHandle,
std::vector<AttributeHandle> &attribArray,
- std::vector <ValueLengthPair> &valueArray,
+ std::vector<AttributeValue_t> &valueArray,
UShort attribArraySize,
FederationTime theTime,
std::string theTag,
@@ -62,7 +62,7 @@
void updateAttributeValues(ObjectHandle theObjectHandle,
std::vector<AttributeHandle> &attribArray,
- std::vector <ValueLengthPair> &valueArray,
+ std::vector<AttributeValue_t> &valueArray,
UShort attribArraySize,
std::string theTag,
TypeException &e);
@@ -76,7 +76,7 @@
void reflectAttributeValues(ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &attribArray,
- std::vector <ValueLengthPair> &valueArray,
+ std::vector <AttributeValue_t> &valueArray,
UShort attribArraySize,
FederationTime theTime,
const char *theTag,
@@ -85,7 +85,7 @@
void reflectAttributeValues(ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &attribArray,
- std::vector <ValueLengthPair> &valueArray,
+ std::vector <AttributeValue_t> &valueArray,
UShort attribArraySize,
const char *theTag,
TypeException &e);
@@ -93,7 +93,7 @@
EventRetractionHandle
sendInteraction(InteractionClassHandle theInteraction,
std::vector <ParameterHandle> ¶mArray,
- std::vector <ParameterLengthPair> &valueArray,
+ std::vector <ParameterValue_t> &valueArray,
UShort paramArraySize,
FederationTime theTime,
std::string theTag,
@@ -103,7 +103,7 @@
void
sendInteraction(InteractionClassHandle theInteraction,
std::vector <ParameterHandle> ¶mArray,
- std::vector <ParameterLengthPair> &valueArray,
+ std::vector <ParameterValue_t> &valueArray,
UShort paramArraySize,
std::string theTag,
RegionHandle,
@@ -111,7 +111,7 @@
void receiveInteraction(InteractionClassHandle theInteraction,
std::vector <ParameterHandle> ¶mArray,
- std::vector <ParameterLengthPair> &valueArray,
+ std::vector <ParameterValue_t> &valueArray,
UShort paramArraySize,
FederationTime theTime,
const char *theTag,
@@ -120,7 +120,7 @@
void receiveInteraction(InteractionClassHandle theInteraction,
std::vector <ParameterHandle> ¶mArray,
- std::vector <ParameterLengthPair> &valueArray,
+ std::vector <ParameterValue_t> &valueArray,
UShort paramArraySize,
const char *theTag,
TypeException &e);
@@ -263,4 +263,4 @@
#endif // _CERTI_RTIA_OM
-// $Id: ObjectManagement.hh,v 3.24 2008/07/09 13:48:28 erk Exp $
+// $Id: ObjectManagement.hh,v 3.25 2008/09/18 14:41:27 gotthardp Exp $
Index: RTIA/RTIA_federate.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/RTIA_federate.cc,v
retrieving revision 3.87
retrieving revision 3.88
diff -u -b -r3.87 -r3.88
--- RTIA/RTIA_federate.cc 10 Jul 2008 14:05:30 -0000 3.87
+++ RTIA/RTIA_federate.cc 18 Sep 2008 14:41:27 -0000 3.88
@@ -395,7 +395,7 @@
}
case Message::UPDATE_ATTRIBUTE_VALUES: {
- std::vector <ValueLengthPair> ValueArrayTemp ;
+ std::vector <AttributeValue_t> ValueArrayTemp ;
ValueArrayTemp = req->getValueArray();
try {
if (req->getBoolean() )
@@ -434,7 +434,7 @@
case Message::SEND_INTERACTION: {
- std::vector <ParameterLengthPair> ValueArrayTemp =
req->getValueArray();
+ std::vector <ParameterValue_t> ValueArrayTemp = req->getValueArray();
G.Out(pdGendoc,"S_I into RTIA::chooseFederateProcessing") ;
try {
if (req->getBoolean() )
Index: RTIA/TimeManagement.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/TimeManagement.cc,v
retrieving revision 3.44
retrieving revision 3.45
diff -u -b -r3.44 -r3.45
--- RTIA/TimeManagement.cc 18 Jun 2008 10:02:42 -0000 3.44
+++ RTIA/TimeManagement.cc 18 Sep 2008 14:41:27 -0000 3.45
@@ -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.44 2008/06/18 10:02:42 erk Exp $
+// $Id: TimeManagement.cc,v 3.45 2008/09/18 14:41:27 gotthardp Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -176,7 +176,7 @@
case NetworkMessage::REFLECT_ATTRIBUTE_VALUES:
{
- std::vector <ValueLengthPair> ValueArray = msg.getAttribValueArray();
+ std::vector<AttributeValue_t> ValueArray = msg.getAttribValueArray();
if (msg.isDated())
om->reflectAttributeValues(msg.object,
@@ -210,7 +210,7 @@
case NetworkMessage::RECEIVE_INTERACTION:
{
- std::vector <ParameterLengthPair> ValueArray =
msg.getParamValueArray();
+ std::vector<ParameterValue_t> ValueArray = msg.getParamValueArray();
if (msg.isDated())
om->receiveInteraction(msg.interactionClass,
@@ -997,4 +997,4 @@
}} // namespaces
-// $Id: TimeManagement.cc,v 3.44 2008/06/18 10:02:42 erk Exp $
+// $Id: TimeManagement.cc,v 3.45 2008/09/18 14:41:27 gotthardp Exp $
Index: RTIG/Federation.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/Federation.cc,v
retrieving revision 3.96
retrieving revision 3.97
diff -u -b -r3.96 -r3.97
--- RTIG/Federation.cc 3 Jul 2008 19:54:20 -0000 3.96
+++ RTIG/Federation.cc 18 Sep 2008 14:41:27 -0000 3.97
@@ -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.96 2008/07/03 19:54:20 gotthardp Exp $
+// $Id: Federation.cc,v 3.97 2008/09/18 14:41:27 gotthardp Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -623,7 +623,7 @@
Federation::broadcastInteraction(FederateHandle federate_handle,
InteractionClassHandle interaction,
std::vector <ParameterHandle>
¶meter_handles,
- std::vector <ParameterLengthPair>
¶meter_values,
+ std::vector <ParameterValue_t>
¶meter_values,
UShort list_size,
FederationTime time,
RegionHandle region_handle,
@@ -660,7 +660,7 @@
D.Out(pdRequest,
" Param %d Value %s",
parameter_handles[i],
- parameter_values[i]);
+ parameter_values[i].c_str());
G.Out(pdGendoc,"exit Federation::broadcastInteraction with time");
@@ -672,7 +672,7 @@
Federation::broadcastInteraction(FederateHandle federate_handle,
InteractionClassHandle interaction,
std::vector <ParameterHandle>
¶meter_handles,
- std::vector <ParameterLengthPair>
¶meter_values,
+ std::vector <ParameterValue_t>
¶meter_values,
UShort list_size,
RegionHandle region_handle,
const char *tag)
@@ -707,7 +707,7 @@
D.Out(pdRequest,
" Param %d Value %s",
parameter_handles[i],
- parameter_values[i]);
+ parameter_values[i].c_str());
G.Out(pdGendoc,"exit Federation::broadcastInteraction without time");
@@ -1597,7 +1597,7 @@
Federation::updateAttributeValues(FederateHandle federate,
ObjectHandle id,
std::vector <AttributeHandle> &attributes,
- std::vector <ValueLengthPair> &values,
+ std::vector <AttributeValue_t> &values,
UShort list_size,
FederationTime time,
const char *tag)
@@ -1630,7 +1630,7 @@
Federation::updateAttributeValues(FederateHandle federate,
ObjectHandle id,
std::vector <AttributeHandle> &attributes,
- std::vector <ValueLengthPair> &values,
+ std::vector <AttributeValue_t> &values,
UShort list_size,
const char *tag)
throw (FederateNotExecutionMember,
@@ -2287,5 +2287,5 @@
}} // namespace certi/rtig
-// $Id: Federation.cc,v 3.96 2008/07/03 19:54:20 gotthardp Exp $
+// $Id: Federation.cc,v 3.97 2008/09/18 14:41:27 gotthardp Exp $
Index: RTIG/Federation.hh
===================================================================
RCS file: /sources/certi/certi/RTIG/Federation.hh,v
retrieving revision 3.50
retrieving revision 3.51
diff -u -b -r3.50 -r3.51
--- RTIG/Federation.hh 19 Jun 2008 13:56:59 -0000 3.50
+++ RTIG/Federation.hh 18 Sep 2008 14:41:27 -0000 3.51
@@ -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.50 2008/06/19 13:56:59 jmm Exp $
+// $Id: Federation.hh,v 3.51 2008/09/18 14:41:27 gotthardp Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_RTIG_FEDERATION_HH
@@ -288,7 +288,7 @@
void updateAttributeValues(FederateHandle theFederateHandle,
ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &theAttributeList,
- std::vector <ValueLengthPair> &theValueList,
+ std::vector <AttributeValue_t> &theValueList,
UShort theListSize,
FederationTime theTime,
const char *theTag)
@@ -303,7 +303,7 @@
void updateAttributeValues(FederateHandle theFederateHandle,
ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &theAttributeList,
- std::vector <ValueLengthPair> &theValueList,
+ std::vector <AttributeValue_t> &theValueList,
UShort theListSize,
const char *theTag)
throw (FederateNotExecutionMember,
@@ -321,7 +321,7 @@
void broadcastInteraction(FederateHandle theFederateHandle,
InteractionClassHandle theInteractionHandle,
std::vector <ParameterHandle> &theParameterList,
- std::vector <ParameterLengthPair> &theValueList,
+ std::vector <ParameterValue_t> &theValueList,
UShort theListSize,
FederationTime theTime,
RegionHandle,
@@ -337,7 +337,7 @@
void broadcastInteraction(FederateHandle theFederateHandle,
InteractionClassHandle theInteractionHandle,
std::vector <ParameterHandle> &theParameterList,
- std::vector <ParameterLengthPair> &theValueList,
+ std::vector <ParameterValue_t> &theValueList,
UShort theListSize,
RegionHandle,
const char *theTag)
@@ -597,4 +597,4 @@
#endif // _CERTI_RTIG_FEDERATION_HH
-// $Id: Federation.hh,v 3.50 2008/06/19 13:56:59 jmm Exp $
+// $Id: Federation.hh,v 3.51 2008/09/18 14:41:27 gotthardp Exp $
Index: RTIG/FederationsList.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/FederationsList.cc,v
retrieving revision 3.58
retrieving revision 3.59
diff -u -b -r3.58 -r3.59
--- RTIG/FederationsList.cc 11 Jun 2008 15:19:20 -0000 3.58
+++ RTIG/FederationsList.cc 18 Sep 2008 14:41:27 -0000 3.59
@@ -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.58 2008/06/11 15:19:20 rousse Exp $
+// $Id: FederationsList.cc,v 3.59 2008/09/18 14:41:27 gotthardp Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -438,7 +438,7 @@
FederateHandle federate,
ObjectHandle id,
std::vector <AttributeHandle> &attributes,
- std::vector <ValueLengthPair> &values,
+ std::vector <AttributeValue_t> &values,
UShort list_size,
FederationTime time,
const char *tag)
@@ -471,7 +471,7 @@
FederateHandle federate,
ObjectHandle id,
std::vector <AttributeHandle> &attributes,
- std::vector <ValueLengthPair> &values,
+ std::vector <AttributeValue_t> &values,
UShort list_size,
const char *tag)
throw (FederateNotExecutionMember,
@@ -502,7 +502,7 @@
FederateHandle federate,
InteractionClassHandle interaction,
std::vector <ParameterHandle> ¶meters,
- std::vector <ParameterLengthPair> &values,
+ std::vector <ParameterValue_t> &values,
UShort list_size,
FederationTime time,
RegionHandle region,
@@ -541,7 +541,7 @@
FederateHandle federate,
InteractionClassHandle interaction,
std::vector <ParameterHandle> ¶meters,
- std::vector <ParameterLengthPair> &values,
+ std::vector <ParameterValue_t> &values,
UShort list_size,
RegionHandle region,
const char *tag)
@@ -1558,5 +1558,5 @@
}} // certi::rtig
-// EOF $Id: FederationsList.cc,v 3.58 2008/06/11 15:19:20 rousse Exp $
+// EOF $Id: FederationsList.cc,v 3.59 2008/09/18 14:41:27 gotthardp Exp $
Index: RTIG/FederationsList.hh
===================================================================
RCS file: /sources/certi/certi/RTIG/FederationsList.hh,v
retrieving revision 3.43
retrieving revision 3.44
diff -u -b -r3.43 -r3.44
--- RTIG/FederationsList.hh 11 Jun 2008 15:19:20 -0000 3.43
+++ RTIG/FederationsList.hh 18 Sep 2008 14:41:27 -0000 3.44
@@ -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.43 2008/06/11 15:19:20 rousse Exp $
+// $Id: FederationsList.hh,v 3.44 2008/09/18 14:41:27 gotthardp Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_RTIG_FEDERATIONS_LIST_HH
@@ -299,7 +299,7 @@
FederateHandle theFederateHandle,
ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &theAttributeList,
- std::vector <ValueLengthPair> &theValueList,
+ std::vector <AttributeValue_t> &theValueList,
UShort theListSize,
FederationTime theTime,
const char *theTag)
@@ -316,7 +316,7 @@
FederateHandle theFederateHandle,
ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &theAttributeList,
- std::vector <ValueLengthPair> &theValueList,
+ std::vector <AttributeValue_t> &theValueList,
UShort theListSize,
const char *theTag)
throw (FederateNotExecutionMember,
@@ -360,7 +360,7 @@
FederateHandle theFederateHandle,
InteractionClassHandle theInteractionHandle,
std::vector <ParameterHandle> &theParameterList,
- std::vector <ParameterLengthPair> &theValueList,
+ std::vector <ParameterValue_t> &theValueList,
UShort theListSize,
FederationTime theTime,
RegionHandle,
@@ -378,7 +378,7 @@
FederateHandle theFederateHandle,
InteractionClassHandle theInteractionHandle,
std::vector <ParameterHandle> &theParameterList,
- std::vector <ParameterLengthPair> &theValueList,
+ std::vector <ParameterValue_t> &theValueList,
UShort theListSize,
RegionHandle,
const char *theTag)
@@ -585,4 +585,4 @@
#endif // _CERTI_RTIG_FEDERATIONS_LIST_HH
-// $Id: FederationsList.hh,v 3.43 2008/06/11 15:19:20 rousse Exp $
+// $Id: FederationsList.hh,v 3.44 2008/09/18 14:41:27 gotthardp Exp $
Index: RTIG/RTIG_processing.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/RTIG_processing.cc,v
retrieving revision 3.76
retrieving revision 3.77
diff -u -b -r3.76 -r3.77
--- RTIG/RTIG_processing.cc 9 Jul 2008 16:43:12 -0000 3.76
+++ RTIG/RTIG_processing.cc 18 Sep 2008 14:41:27 -0000 3.77
@@ -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.76 2008/07/09 16:43:12 rousse Exp $
+// $Id: RTIG_processing.cc,v 3.77 2008/09/18 14:41:27 gotthardp Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -793,7 +793,7 @@
RTIG::processUpdateAttributeValues(Socket *link, NetworkMessage *req)
{
G.Out(pdGendoc,"enter RTIG::processUpdateAttributeValues");
- std::vector <ValueLengthPair> ValueArray ;
+ std::vector <AttributeValue_t> ValueArray ;
auditServer << "ObjID = " << req->object
<< ", Date = " << req->getDate() ;
@@ -846,7 +846,7 @@
void
RTIG::processSendInteraction(Socket *link, NetworkMessage *req)
{
- std::vector <ValueLengthPair> values ;
+ std::vector <ParameterValue_t> values ;
G.Out(pdGendoc,"BEGIN ** SEND INTERACTION SERVICE **");
G.Out(pdGendoc,"enter RTIG::processSendInteraction");
@@ -1433,4 +1433,4 @@
}} // namespace certi/rtig
-// $Id: RTIG_processing.cc,v 3.76 2008/07/09 16:43:12 rousse Exp $
+// $Id: RTIG_processing.cc,v 3.77 2008/09/18 14:41:27 gotthardp Exp $
Index: include/certi.hh
===================================================================
RCS file: /sources/certi/certi/include/certi.hh,v
retrieving revision 3.32
retrieving revision 3.33
diff -u -b -r3.32 -r3.33
--- include/certi.hh 24 Jun 2008 12:23:31 -0000 3.32
+++ include/certi.hh 18 Sep 2008 14:41:28 -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: certi.hh,v 3.32 2008/06/24 12:23:31 rousse Exp $
+// $Id: certi.hh,v 3.33 2008/09/18 14:41:28 gotthardp Exp $
// ----------------------------------------------------------------------------
#include <vector>
@@ -224,23 +224,13 @@
RTI_EXCEPT(NetworkSignal)
RTI_EXCEPT(NetworkError)
-// Deprecated HLA types still in use
-typedef char *AttributeValue ;
-
-// typedef std::vector<char> AttributeValue;
typedef RTI::Double FederationTime ;
typedef UShort ObjectHandlecount ;
typedef char *ObjectName ;
-typedef AttributeValue ParameterValue ;
typedef char *ParameterName ;
-typedef AttributeValue ValueName ;
+typedef std::string AttributeValue_t;
+typedef std::string ParameterValue_t;
-struct Value {
- ValueName name ;
- ValueName value ;
- ValueName type ;
- ULong length ;
-};
typedef RTI::Double FederationTimeDelta ;
enum ObjectRemovalReason {
OUT_OF_REGION = 1,
@@ -258,13 +248,6 @@
// Constants
const int MAX_BACKLOG = 256 ;
-// next introduced in order to manage value including any char (as \0)
-typedef struct vlp
- {
- AttributeValue value ; // value is a lot of bytes
- ULong length ; // length i.e. bytes number of the value
-} ValueLengthPair, ParameterLengthPair ;
-
} // namespace certi
// Define this if you want the complete object and interaction tree to
@@ -370,4 +353,4 @@
(uint64_t) CERTI_INT64_CONSTANT(0xff00000000000000U)) >> 56)))
#endif // CERTI_HH_INCLUDED
-// $Id: certi.hh,v 3.32 2008/06/24 12:23:31 rousse Exp $
+// $Id: certi.hh,v 3.33 2008/09/18 14:41:28 gotthardp Exp $
Index: libCERTI/Interaction.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Interaction.cc,v
retrieving revision 3.42
retrieving revision 3.43
diff -u -b -r3.42 -r3.43
--- libCERTI/Interaction.cc 16 Jul 2008 08:11:35 -0000 3.42
+++ libCERTI/Interaction.cc 18 Sep 2008 14:41:28 -0000 3.43
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: Interaction.cc,v 3.42 2008/07/16 08:11:35 rousse Exp $
+// $Id: Interaction.cc,v 3.43 2008/09/18 14:41:28 gotthardp Exp $
// ----------------------------------------------------------------------------
@@ -388,7 +388,7 @@
InteractionBroadcastList *
Interaction::sendInteraction(FederateHandle federate_handle,
std::vector <ParameterHandle> ¶meter_list,
- std::vector <ParameterLengthPair> &value_list,
+ std::vector <ParameterValue_t> &value_list,
UShort list_size,
FederationTime time,
const RTIRegion *region,
@@ -422,7 +422,7 @@
answer->sizeValueArray(list_size);
for (int i = 0 ; i < list_size ; i++) {
answer->handleArray[i] = parameter_list[i] ;
- answer->setValue(i, value_list[i].value, value_list[i].length);
+ answer->valueArray[i] = value_list[i];
}
D.Out(pdProtocol, "Preparing broadcast list.");
@@ -449,7 +449,7 @@
InteractionBroadcastList *
Interaction::sendInteraction(FederateHandle federate_handle,
std::vector <ParameterHandle> ¶meter_list,
- std::vector <ParameterLengthPair> &value_list,
+ std::vector <ParameterValue_t> &value_list,
UShort list_size,
const RTIRegion *region,
const char *the_tag)
@@ -481,7 +481,7 @@
for (int i = 0 ; i < list_size ; i++) {
answer->handleArray[i] = parameter_list[i] ;
- answer->setValue(i, value_list[i].value, value_list[i].length);
+ answer->valueArray[i] = value_list[i];
}
D.Out(pdProtocol, "Preparing broadcast list.");
@@ -532,4 +532,4 @@
} // namespace certi
-// $Id: Interaction.cc,v 3.42 2008/07/16 08:11:35 rousse Exp $
+// $Id: Interaction.cc,v 3.43 2008/09/18 14:41:28 gotthardp Exp $
Index: libCERTI/Interaction.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/Interaction.hh,v
retrieving revision 3.28
retrieving revision 3.29
diff -u -b -r3.28 -r3.29
--- libCERTI/Interaction.hh 11 Jun 2008 15:19:21 -0000 3.28
+++ libCERTI/Interaction.hh 18 Sep 2008 14:41:28 -0000 3.29
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: Interaction.hh,v 3.28 2008/06/11 15:19:21 rousse Exp $
+// $Id: Interaction.hh,v 3.29 2008/09/18 14:41:28 gotthardp Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_INTERACTION_HH
@@ -105,7 +105,7 @@
InteractionBroadcastList *
sendInteraction(FederateHandle federate_handle,
std::vector <ParameterHandle> ¶meter_list,
- std::vector <ParameterLengthPair> &value_list,
+ std::vector <ParameterValue_t> &value_list,
UShort list_size,
FederationTime the_time,
const RTIRegion *,
@@ -118,7 +118,7 @@
InteractionBroadcastList *
sendInteraction(FederateHandle federate_handle,
std::vector <ParameterHandle> ¶meter_list,
- std::vector <ParameterLengthPair> &value_list,
+ std::vector <ParameterValue_t> &value_list,
UShort list_size,
const RTIRegion *,
const char *the_tag)
@@ -167,4 +167,4 @@
#endif // _CERTI_INTERACTION.HH
-// $Id: Interaction.hh,v 3.28 2008/06/11 15:19:21 rousse Exp $
+// $Id: Interaction.hh,v 3.29 2008/09/18 14:41:28 gotthardp Exp $
Index: libCERTI/InteractionSet.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/InteractionSet.cc,v
retrieving revision 3.22
retrieving revision 3.23
diff -u -b -r3.22 -r3.23
--- libCERTI/InteractionSet.cc 11 Jun 2008 15:19:21 -0000 3.22
+++ libCERTI/InteractionSet.cc 18 Sep 2008 14:41:28 -0000 3.23
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: InteractionSet.cc,v 3.22 2008/06/11 15:19:21 rousse Exp $
+// $Id: InteractionSet.cc,v 3.23 2008/09/18 14:41:28 gotthardp Exp $
// ----------------------------------------------------------------------------
#include "Interaction.hh"
@@ -60,7 +60,7 @@
InteractionSet::broadcastInteraction(FederateHandle federate_handle,
InteractionClassHandle interaction_handle,
std::vector <ParameterHandle>
¶meter_list,
- std::vector <ParameterLengthPair>
&value_list,
+ std::vector <ParameterValue_t>
&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,
- std::vector <ParameterLengthPair>
&value_list,
+ std::vector <ParameterValue_t>
&value_list,
UShort list_size,
const RTIRegion *region,
const char *the_tag)
@@ -357,4 +357,4 @@
} // namespace certi
-// $Id: InteractionSet.cc,v 3.22 2008/06/11 15:19:21 rousse Exp $
+// $Id: InteractionSet.cc,v 3.23 2008/09/18 14:41:28 gotthardp Exp $
Index: libCERTI/InteractionSet.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/InteractionSet.hh,v
retrieving revision 3.17
retrieving revision 3.18
diff -u -b -r3.17 -r3.18
--- libCERTI/InteractionSet.hh 11 Jun 2008 15:19:21 -0000 3.17
+++ libCERTI/InteractionSet.hh 18 Sep 2008 14:41:28 -0000 3.18
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: InteractionSet.hh,v 3.17 2008/06/11 15:19:21 rousse Exp $
+// $Id: InteractionSet.hh,v 3.18 2008/09/18 14:41:28 gotthardp Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_INTERACTION_SET_HH
@@ -115,7 +115,7 @@
void broadcastInteraction(FederateHandle theFederateHandle,
InteractionClassHandle theInteractionHandle,
std::vector <ParameterHandle> &theParameterList,
- std::vector <ParameterLengthPair> &theValueList,
+ std::vector <ParameterValue_t> &theValueList,
UShort theListSize,
FederationTime theTime,
const RTIRegion *,
@@ -128,7 +128,7 @@
void broadcastInteraction(FederateHandle theFederateHandle,
InteractionClassHandle theInteractionHandle,
std::vector <ParameterHandle> &theParameterList,
- std::vector <ParameterLengthPair> &theValueList,
+ std::vector <ParameterValue_t> &theValueList,
UShort theListSize,
const RTIRegion *,
const char *theTag)
@@ -145,4 +145,4 @@
#endif // _CERTI_INTERACTION_SET_HH
-// $Id: InteractionSet.hh,v 3.17 2008/06/11 15:19:21 rousse Exp $
+// $Id: InteractionSet.hh,v 3.18 2008/09/18 14:41:28 gotthardp Exp $
Index: libCERTI/Message.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Message.cc,v
retrieving revision 3.59
retrieving revision 3.60
diff -u -b -r3.59 -r3.60
--- libCERTI/Message.cc 24 Jun 2008 12:23:31 -0000 3.59
+++ libCERTI/Message.cc 18 Sep 2008 14:41:28 -0000 3.60
@@ -71,61 +71,22 @@
//FEDid = NULL ;now string
valueArray.empty() ;
}
-/** getValue : Value and its length are tooken from valueArray[Rank]
- @param Rank valueArray rank
- @param length byte number of Value tooken from valueArray[Rank] (modified)
- @param Value Value tooken from valueArray[Rank]
- Value is managed as an address to a set of bytes
- Note : if Value is not present, Value is created and its address is
returned
- by getValue
- getValue allows Value as a set of bytes because length (parameter 2) is
known
-*/
-// ----------------------------------------------------------------------------
-char *Message::getValue(int Rank, unsigned long *length, char *Value) const
- throw (RTIinternalError)
-{
- // Pre-Checking
-
- if ((Rank < 0) )
- throw RTIinternalError("(getValue) Bad Rank in Message.");
-
- // Getting Value
- // First, the length of the Value
- *length = valueArray[Rank].length ;
-
- if (Value != NULL)
- // Value exists, we copy it with memcpy instead of strcpy
- {
- memcpy(Value,(char *)*(valueArray[Rank].value), *length) ;
- return NULL ;
- }
- else
- // Value doesn't exists, so create it then copy
- {
- char *TempValue = new char [*length] ;
- memcpy(TempValue,(char *)*(valueArray[Rank].value), *length) ;
- Value = TempValue ;
- return Value ;
- }
-}
// ----------------------------------------------------------------------------
/** Return a newly allocated ValueArray, exactly of size HandleArraySize.
*/
-std::vector <ParameterLengthPair>
+std::vector <ParameterValue_t>
Message::getValueArray()
{
G.Out(pdGendoc,"enter Message::getValueArray");
int i ;
- std::vector <ParameterLengthPair> NewValueArray ;
+ std::vector <ParameterValue_t> NewValueArray;
NewValueArray.resize(handleArraySize) ;
for (i = 0 ; i < handleArraySize ; i++)
{
- NewValueArray[i].length = valueArray[i].length ;
- NewValueArray[i].value = new char[NewValueArray[i].length] ;
-
memcpy(&(NewValueArray[i].value[0]),valueArray[i].value,NewValueArray[i].length);
+ NewValueArray[i] = valueArray[i];
}
G.Out(pdGendoc,"return Message::getValueArray");
@@ -377,17 +338,8 @@
RTI::AttributeHandleValuePairSet *ahvps ;
ahvps = RTI::AttributeSetFactory::create(handleArraySize);
- unsigned long length ;
- char *value ;
-
for (int i = 0 ; i < handleArraySize ; i++)
- {
- length = valueArray[i].length ;
- value = new char[length] ;
- memcpy(value,valueArray[i].value,length);
- ahvps->add(handleArray[i], value, length);
- //delete[] value;
- }
+ ahvps->add(handleArray[i], valueArray[i].data(),
valueArray[i].length());
return ahvps ;
}
@@ -400,10 +352,8 @@
Message::setAHVPS(const RTI::AttributeHandleValuePairSet &the_attributes)
{
G.Out(pdGendoc,"enter Message::setAHVPS");
- ULong length ;
unsigned long size ;
- char *valuebuf=NULL;
size = the_attributes.size() ;
handleArraySize = size ;
@@ -414,17 +364,12 @@
// handle stored into handleArray[i]
handleArray[i] = the_attributes.getHandle(size-1-i);
- // value length extracted from the_attributes
- length = the_attributes.getValueLength(size-1-i) ;
-
- // copying into valuebuf created by getValue
- valuebuf = new char[length] ;
- the_attributes.getValue(size-1-i,valuebuf,length) ;
-
- // valuebuf address and its length are stored into valueArray[i]
- valueArray[i].length = length ;
- valueArray[i].value = valuebuf ;
+ // value stored into valueArray[i]
+ ULong length;
+ char *valueptr = the_attributes.getValuePointer(size-1-i, length);
+ valueArray[i].assign(valueptr, length);
+ // no free(valueptr), getValuePointer does not allocate memory
}
G.Out(pdGendoc,"exit Message::setAHVPS");
}
@@ -436,16 +381,8 @@
ParameterHandleValuePairSetImp *phvps ;
phvps = new ParameterHandleValuePairSetImp(handleArraySize);
- unsigned long length ;
- char *value ;
-
for (int i = 0 ; i < handleArraySize ; i++)
- {
- length = valueArray[i].length ;
- value = new char[length] ;
- memcpy(value,valueArray[i].value,length);
- phvps->add(handleArray[i], value, length);
- }
+ phvps->add(handleArray[i], valueArray[i].data(),
valueArray[i].length());
return phvps ;
}
@@ -455,29 +392,24 @@
Message::setPHVPS(const RTI::ParameterHandleValuePairSet &the_parameters)
{
G.Out(pdGendoc,"enter Message::setPHVPS");
- ULong length ;
unsigned long size ;
- char *valuebuf=NULL;
size = the_parameters.size() ;
handleArraySize = size ;
handleArray.resize(handleArraySize);
valueArray.resize(size) ;
- for (unsigned long i = 0 ; i < size ; i++)
- {
+ for (unsigned long i = 0 ; i < size ; i++) {
+
// handle stored into handleArray[i]
handleArray[i] = the_parameters.getHandle(size-1-i);
- // value length extracted from the_parameters
- length = the_parameters.getValueLength(size-1-i) ;
- // copying into valuebuf created by getValue
- valuebuf = new char[length] ;
- the_parameters.getValue(size-1-i, valuebuf, length) ;
- // valuebuf address and its length are stored into valueArray(i]
- valueArray[i].length = length ;
- valueArray[i].value = valuebuf ;
+ // value stored into valueArray[i]
+ ULong length;
+ char *valueptr = the_parameters.getValuePointer(size-1-i, length);
+ valueArray[i].assign(valueptr, length);
+ // no free(valueptr), getValuePointer does not allocate memory
}
G.Out(pdGendoc,"exit Message::setPHVPS");
}
@@ -500,11 +432,10 @@
// store values into valueArray
void
Message::setAttributes(std::vector <AttributeHandle> &the_attributes,
- std::vector <ValueLengthPair> &the_values,
+ std::vector <AttributeValue_t> &the_values,
ushort the_size)
{
G.Out(pdGendoc,"enter Message::setAttributes");
- char *tempValue ;
handleArraySize = the_size ;
handleArray.resize(handleArraySize);
valueArray.resize(the_size) ;
@@ -513,9 +444,7 @@
// attributes into handleArray
handleArray[i] = the_attributes[i] ;
// values into valueArray
- tempValue = new char[the_values[i].length] ;
- memcpy(tempValue,the_values[i].value,the_values[i].length ) ;
- setValue(i, tempValue,the_values[i].length ) ;
+ valueArray[i] = the_values[i] ;
}
G.Out(pdGendoc,"exit Message::setAttributes");
}
@@ -526,11 +455,10 @@
// store values into valueArray
void
Message::setParameters(std::vector <ParameterHandle> & the_parameters,
- std::vector <ParameterLengthPair> & the_values,
+ std::vector <ParameterValue_t> & the_values,
ushort the_size)
{
- char *tempValue ;
handleArraySize = the_size ;
handleArray.resize(handleArraySize);
valueArray.resize(the_size) ;
@@ -539,9 +467,7 @@
// parameters into handleArray
handleArray[i] = the_parameters[i] ;
// values into valueArray
- tempValue = new char[the_values[i].length] ;
- memcpy(tempValue,the_values[i].value,the_values[i].length ) ;
- setValue(i, the_values[i].value, the_values[i].length);
+ valueArray[i] = the_values[i] ;
}
}
@@ -574,30 +500,6 @@
}
// ----------------------------------------------------------------------------
-// setValue
-// Store Value into valueArray[Rank)
-void
-Message::setValue(int Rank, const char *Value, unsigned long length)
- throw (RTIinternalError)
-{
-
- // Pre-Checking
-
- if ((Value == NULL))
- throw RTIinternalError("Bad Value (NULL) for message.");
-
- if ((Rank < 0) )
- throw RTIinternalError("(setValue) Bad Rank for message.");
-
- // Setting Value
- // First we store the value length
- valueArray[Rank].length = length ;
-
- // then copy Value address into valueArray
- valueArray[Rank].value = (char *)Value ;
-}
-
-// ----------------------------------------------------------------------------
// setFEDid
//
void
@@ -661,12 +563,7 @@
handleArray[i] = msg.handleArray[i] ;
for (i=0 ; i < handleArraySize ; i++)
- {
- valueArray[i].length = msg.valueArray[i].length ;
- char * TempValue = new char[valueArray[i].length] ;
- memcpy(TempValue, (char *)*(msg.valueArray[i].value),
msg.valueArray[i].length );
- valueArray[i].value=TempValue ;
- }
+ valueArray[i] = msg.valueArray[i] ;
FEDid = msg.FEDid ;
@@ -722,16 +619,16 @@
printf("(%s) valueArray size=%d\n",titre,(int)valueArray.size());
for (int i=0; i<(int)valueArray.size();i++)
{
- printf("%d : length=%d : value=",i,(int)(valueArray[i].length));
- for (int k=0; k<(int)valueArray[i].length ;k++)
+ printf("%d : length=%d : value=",i,(int)(valueArray[i].length()));
+ for (int k=0; k<(int)valueArray[i].length() ;k++)
{
- if (isprint(valueArray[i].value[k]) == 0 )
+ if (isprint(valueArray[i][k]) == 0 )
{
- printf(" %x",valueArray[i].value[k]);
+ printf(" %x",valueArray[i][k]);
}
else
{
- printf("%c",valueArray[i].value[k]);
+ printf("%c",valueArray[i][k]);
}
}
printf("\n");
Index: libCERTI/Message.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/Message.hh,v
retrieving revision 3.49
retrieving revision 3.50
diff -u -b -r3.49 -r3.50
--- libCERTI/Message.hh 24 Jun 2008 08:56:49 -0000 3.49
+++ libCERTI/Message.hh 18 Sep 2008 14:41:28 -0000 3.50
@@ -265,32 +265,9 @@
void trace(const char* context);
- // -- Attribute Access Methods
- // Value Array Management
- // setValue : Value and its length are stored into valueArray[Rank]
- // Parameter 1 : Rank (int) : valueArray rank
- // Parameter 2 : Value (char *) : Value to store into valueArray[Rank]
- // Value is managed as a set of bytes
- // Parameter 3 : length (unsigned long) : byte number of Value
- void setValue(int Rank, const char *Value, unsigned long length)
- throw (RTIinternalError); // Bad Rank, Bad Value
-
- // If Value == NULL return a newly allocated copy of Value, else copy it
- // in Value.
- // getValue : Value and its length are tooken from valueArray[Rank]
- // Parameter 1 : Rank (int) : valueArray rank
- // Parameter 2 :length (unsigned long *) : byte number of Value tooken
- // from valueArray[Rank]
- // Parameter 3 : Value (char *) : Value address tooken from
valueArray[Rank]
- // Value is managed as a set of bytes
- // Note : if parametre 3 not present, Value is created and its address is
returned
- // by getValue
- char *getValue(int Rank, unsigned long *length, char *Value = 0) const
- throw (RTIinternalError); // Bad Rank
-
// Return a newly allocated ValueArray, exactly of size HandleArraySize.
- // containing the actual Attrib/Param values. You must FREE this structure.
- std::vector <ValueLengthPair> getValueArray();
+ // containing the actual Attrib/Param values.
+ std::vector <AttributeValue_t> getValueArray();
std::string getLabel() const { return label ; };
void setLabel(std::string new_label);
@@ -396,8 +373,8 @@
void setPHVPS(const RTI::ParameterHandleValuePairSet &);
void setAttributes(std::vector <AttributeHandle> &, ushort);
- void setAttributes(std::vector <AttributeHandle> &, std::vector
<ValueLengthPair> &, ushort);
- void setParameters(std::vector <ParameterHandle> &, std::vector
<ParameterLengthPair> &, ushort);
+ void setAttributes(std::vector <AttributeHandle> &, std::vector
<AttributeValue_t> &, ushort);
+ void setParameters(std::vector <ParameterHandle> &, std::vector
<ParameterValue_t> &, ushort);
void setException(TypeException, const char *the_reason = "\0");
TypeException getExceptionType() const { return exception ; };
@@ -446,6 +423,7 @@
// used for both Attributes and Parameters arrays.
UShort handleArraySize ;
std::vector <AttributeHandle> handleArray ;
+ std::vector <AttributeValue_t> valueArray ;
Message &operator=(const Message &);
@@ -497,8 +475,6 @@
std::string tag ;
std::string FEDid ;
-
- std::vector<ValueLengthPair> valueArray ;
};
} // namespace certi
Index: libCERTI/MessageBuffer.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/MessageBuffer.cc,v
retrieving revision 3.12
retrieving revision 3.13
diff -u -b -r3.12 -r3.13
--- libCERTI/MessageBuffer.cc 17 Sep 2008 11:59:27 -0000 3.12
+++ libCERTI/MessageBuffer.cc 18 Sep 2008 14:41:28 -0000 3.13
@@ -188,7 +188,7 @@
} /* end of setSizeInReservedBytes */
int32_t MessageBuffer::write_uint8s(const uint8_t* data, uint32_t n) {
- D.Out(pdTrace,"write_uint8s(%p = [%u ...] , %d)",data,data[0],n);
+ D.Out(pdTrace,"write_uint8s(%p = [%u ...] , %d)",data,n>0?data[0]:0,n);
if (n >= (bufferMaxSize - writeOffset)) {
/* reallocate buffer on-demand */
@@ -214,14 +214,14 @@
memcpy(data, buffer+readOffset, n);
readOffset += n;
- D.Out(pdTrace,"read_uint8s(%p = [%u ...], %d)",data,data[0],n);
+ D.Out(pdTrace,"read_uint8s(%p = [%u ...], %d)",data,n>0?data[0]:0,n);
return (readOffset-n);
} /* end of MessageBuffer::read_uint8s(uint8_t*, uint32_t) */
int32_t MessageBuffer::write_uint16s(const uint16_t* data, uint32_t n) {
uint32_t i;
uint16_t an_uint16;
- D.Out(pdTrace,"write_uint16s(%p = [%u ...], %d)",data,data[0],n);
+ D.Out(pdTrace,"write_uint16s(%p = [%u ...], %d)",data,n>0?data[0]:0,n);
if ((2*n) >= (bufferMaxSize - writeOffset)) {
/* reallocate buffer on-demand */
@@ -268,14 +268,14 @@
}
}
- D.Out(pdTrace,"read_uint16s(%p = [%u ...], %d)",data,data[0],n);
+ D.Out(pdTrace,"read_uint16s(%p = [%u ...], %d)",data,n>0?data[0]:0,n);
return (readOffset-2*n);
} /* end of MessageBuffer::read_uint16s(uint16_t*, uint32_t) */
int32_t MessageBuffer::write_uint32s(const uint32_t* data, uint32_t n) {
uint32_t i;
uint32_t an_uint32;
- D.Out(pdTrace,"write_uint32s(%p = [%u ...] , %d)",data,data[0],n);
+ D.Out(pdTrace,"write_uint32s(%p = [%u ...] , %d)",data,n>0?data[0]:0,n);
if ((4*n) >= (bufferMaxSize - writeOffset)) {
/* reallocate buffer on-demand */
@@ -321,7 +321,7 @@
readOffset += 4;
}
}
- D.Out(pdTrace,"read_uint32s(%p = [%u ...], %d)",data,data[0],n);
+ D.Out(pdTrace,"read_uint32s(%p = [%u ...], %d)",data,n>0?data[0]:0,n);
return (readOffset-4*n);
} /* end of read_uint32s */
@@ -399,7 +399,7 @@
int32_t MessageBuffer::write_floats(const float* data, uint32_t n) {
const uint32_t* data32;
- D.Out(pdTrace,"write_floats(%p = [%f ...], %d)",data,data[0],n);
+ D.Out(pdTrace,"write_floats(%p = [%f ...], %d)",data,n>0?data[0]:0,n);
data32 = reinterpret_cast<const uint32_t*>(data);
return write_uint32s(data32,n);
}
@@ -413,7 +413,7 @@
int32_t MessageBuffer::write_doubles(const double* data, uint32_t n) {
const uint64_t* data64;
- D.Out(pdTrace,"write_doubles(%p = [%f ...], %d)",data,data[0],n);
+ D.Out(pdTrace,"write_doubles(%p = [%f ...], %d)",data,n>0?data[0]:0,n);
data64 = reinterpret_cast<const uint64_t*>(data);
return write_uint64s(data64,n);
}
@@ -428,7 +428,7 @@
int32_t
MessageBuffer::write_string(const std::string& str) {
write_int32(str.length());
- return write_chars(str.c_str(),str.length());
+ return write_chars(str.data(),str.length());
} /* end of write_string */
std::string
Index: libCERTI/Message_R.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Message_R.cc,v
retrieving revision 3.30
retrieving revision 3.31
diff -u -b -r3.30 -r3.31
--- libCERTI/Message_R.cc 9 Jul 2008 13:48:29 -0000 3.30
+++ libCERTI/Message_R.cc 18 Sep 2008 14:41:28 -0000 3.31
@@ -17,7 +17,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: Message_R.cc,v 3.30 2008/07/09 13:48:29 erk Exp $
+// $Id: Message_R.cc,v 3.31 2008/09/18 14:41:28 gotthardp Exp $
// ----------------------------------------------------------------------------
@@ -616,17 +616,10 @@
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() ;
- char *TempValue = new char[valueArray[i].length] ;
- msgBuffer.read_bytes((char *) TempValue, valueArray[i].length);
- valueArray[i].value=TempValue;
- }
+ valueArray[i] = msgBuffer.read_string();
}
// ----------------------------------------------------------------------------
@@ -639,4 +632,4 @@
} // namespace certi
-// $Id: Message_R.cc,v 3.30 2008/07/09 13:48:29 erk Exp $
+// $Id: Message_R.cc,v 3.31 2008/09/18 14:41:28 gotthardp Exp $
Index: libCERTI/Message_W.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Message_W.cc,v
retrieving revision 3.35
retrieving revision 3.36
diff -u -b -r3.35 -r3.36
--- libCERTI/Message_W.cc 9 Jul 2008 13:48:29 -0000 3.35
+++ libCERTI/Message_W.cc 18 Sep 2008 14:41:29 -0000 3.36
@@ -17,7 +17,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: Message_W.cc,v 3.35 2008/07/09 13:48:29 erk Exp $
+// $Id: Message_W.cc,v 3.36 2008/09/18 14:41:29 gotthardp Exp $
// ----------------------------------------------------------------------------
@@ -587,13 +587,9 @@
// length and value are stored into valueArray
// so we have to write length and then value with a write_bytes
for (int i = 0 ; i < handleArraySize ; i ++)
- {
- msgBuffer.write_int64(valueArray[i].length) ;
- assert(valueArray[i].value != 0);
- msgBuffer.write_bytes((char *)(valueArray[i].value),
valueArray[i].length) ;
- }
+ msgBuffer.write_string(valueArray[i]) ;
}
} // namespace certi
-// $Id: Message_W.cc,v 3.35 2008/07/09 13:48:29 erk Exp $
+// $Id: Message_W.cc,v 3.36 2008/09/18 14:41:29 gotthardp Exp $
Index: libCERTI/NM_Classes.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/NM_Classes.cc,v
retrieving revision 3.12
retrieving revision 3.13
diff -u -b -r3.12 -r3.13
--- libCERTI/NM_Classes.cc 10 Jul 2008 20:20:06 -0000 3.12
+++ libCERTI/NM_Classes.cc 18 Sep 2008 14:41:29 -0000 3.13
@@ -998,10 +998,8 @@
msgBuffer.write_int32(object);
msgBuffer.write_int32(objectClass);
/* the value pre-encoded by the user (HLA 1.3) */
- for (i = 0 ; i < handleArraySize ; i++) {
- msgBuffer.write_int32(ValueArray[i].length) ;
- msgBuffer.write_bytes(ValueArray[i].value,
ValueArray[i].length);
- }
+ for (i = 0 ; i < handleArraySize ; i++)
+ msgBuffer.write_string(valueArray[i]) ;
} /* end of serialize */
void NM_Update_Attribute_Values::deserialize(MessageBuffer& msgBuffer) {
int i;
@@ -1011,13 +1009,9 @@
/* 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();
- char *tempValue = new char[ValueArray[i].length] ;
- msgBuffer.read_bytes(tempValue, ValueArray[i].length);
- ValueArray[i].value = tempValue ;
- }
+ valueArray.resize(handleArraySize) ;
+ for (i = 0; i < handleArraySize; i++)
+ valueArray[i] = msgBuffer.read_string();
} /* end of deserialize */
/*<END>---------- Update_Attribute_Values ------------<END>*/
@@ -1047,10 +1041,8 @@
msgBuffer.write_int32(region);
msgBuffer.write_int32(interactionClass);
/* the value pre-encoded by the user (HLA 1.3) */
- for (i = 0 ; i < handleArraySize ; i++) {
- msgBuffer.write_int32(ValueArray[i].length) ;
- msgBuffer.write_bytes((char *)ValueArray[i].value,
ValueArray[i].length);
- }
+ for (i = 0 ; i < handleArraySize ; i++)
+ msgBuffer.write_string(valueArray[i]);
} /* end of serialize */
void NM_Send_Interaction::deserialize(MessageBuffer& msgBuffer) {
int i;
@@ -1059,13 +1051,9 @@
/* 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();
- char *tempValue = new char[ValueArray[i].length] ;
- msgBuffer.read_bytes(tempValue, ValueArray[i].length);
- ValueArray[i].value = tempValue ;
- }
+ valueArray.resize(handleArraySize);
+ for (i = 0; i < handleArraySize; i++)
+ valueArray[i] = msgBuffer.read_string();
} /* end of deserialize */
/*<END>---------- Send_Interaction ------------<END>*/
Index: libCERTI/NetworkMessage.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/NetworkMessage.cc,v
retrieving revision 3.36
retrieving revision 3.37
diff -u -b -r3.36 -r3.37
--- libCERTI/NetworkMessage.cc 24 Jun 2008 08:56:49 -0000 3.36
+++ libCERTI/NetworkMessage.cc 18 Sep 2008 14:41:29 -0000 3.37
@@ -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.36 2008/06/24 08:56:49 rousse Exp $
+// $Id: NetworkMessage.cc,v 3.37 2008/09/18 14:41:29 gotthardp Exp $
// ----------------------------------------------------------------------------
@@ -65,7 +65,7 @@
interactionClass = 0 ;
handleArraySize = 0 ;
- ValueArray.empty();
+ valueArray.empty();
} /* end of NetworkMessage() */
@@ -74,88 +74,42 @@
}
// ----------------------------------------------------------------------------
-std::vector <ValueLengthPair>
+std::vector <AttributeValue_t>
NetworkMessage::getAttribValueArray()
{
-
- std::vector <ValueLengthPair> NewValueArray ;
-
+ std::vector <std::string> NewValueArray ;
NewValueArray.resize(handleArraySize) ;
for (int i = 0 ; i <handleArraySize ; i++)
- {
- NewValueArray[i].length = ValueArray[i].length ;
- NewValueArray[i].value = new char[NewValueArray[i].length] ;
-
memcpy(NewValueArray[i].value,ValueArray[i].value,NewValueArray[i].length);
- }
+ NewValueArray[i] = valueArray[i] ;
return NewValueArray ;
}
// ----------------------------------------------------------------------------
-std::vector <ParameterLengthPair>
+std::vector <ParameterValue_t>
NetworkMessage::getParamValueArray()
{
- std::vector <ParameterLengthPair> NewValueArray ;
+ std::vector <std::string> NewValueArray ;
NewValueArray.resize(handleArraySize) ;
-
for (int i = 0 ; i < handleArraySize ; i++)
- {
- NewValueArray[i].length = ValueArray[i].length ;
- NewValueArray[i].value = new char[NewValueArray[i].length] ;
-
memcpy(NewValueArray[i].value,ValueArray[i].value,NewValueArray[i].length);
- }
+ NewValueArray[i] = valueArray[i] ;
return NewValueArray ;
}
// ----------------------------------------------------------------------------
-char *
-NetworkMessage::getValue(int Rank, unsigned long *length, char *Value)
- throw (RTIinternalError)
-{
- // Pre-Checking
- if ((Rank < 0) || (Rank >= (int)ValueArray.size()))
- throw RTIinternalError("(getValue) Bad Rank in NMessage.");
-
- // Getting Value
- // First, the length of the Value
- *length = ValueArray[Rank].length ;
-
- if (Value != NULL)
- // Value exists, we copy it with memcpy instead of strcpy
- {
- memcpy(Value, (char *)*(ValueArray[Rank].value), *length);
- return NULL ;
- }
- else
- // Value doesn't exist, so create it then copy
- {
- char *TempValue = new char [*length] ;
- memcpy(TempValue,(char *)*(ValueArray[Rank].value), *length) ;
- Value = TempValue ;
- return Value ;
- }
-}
-
-// ----------------------------------------------------------------------------
void
NetworkMessage::removeAttribute(UShort Rank)
{
- UShort AttribIndex = 0 ;
-
- if (Rank >= ValueArray.size())
+ if (Rank >= valueArray.size())
throw RTIinternalError("Bad Rank while removing Nmessage attribute.");
- // Shift Attribute Handles and Values
- for (AttribIndex = Rank ; AttribIndex < handleArraySize - 1 ; AttribIndex
++) {
- handleArray[AttribIndex] = handleArray[AttribIndex + 1] ;
- ValueArray[AttribIndex].length = ValueArray[AttribIndex + 1].length ;
- ValueArray[AttribIndex].value = ValueArray[AttribIndex + 1].value ;
- }
+ handleArray.erase(handleArray.begin() + Rank);
+ valueArray.erase(valueArray.begin() + Rank);
handleArraySize -- ;
}
@@ -164,46 +118,16 @@
void
NetworkMessage::removeParameter(UShort Rank)
{
- UShort ParamIndex = 0 ;
-
- if (Rank >= ValueArray.size())
+ if (Rank >= valueArray.size())
throw RTIinternalError("Bad Rank while removing Nmessage parameter.");
- // Shift Parameter Handles and Values
- for (ParamIndex = Rank ; ParamIndex < handleArraySize - 1 ; ParamIndex ++)
{
- handleArray[ParamIndex] = handleArray[ParamIndex + 1] ;
- ValueArray[ParamIndex].length = ValueArray[ParamIndex + 1].length ;
- ValueArray[ParamIndex].value = ValueArray[ParamIndex + 1].value ;
- }
+ handleArray.erase(handleArray.begin() + Rank);
+ valueArray.erase(valueArray.begin() + Rank);
handleArraySize -- ;
}
// ----------------------------------------------------------------------------
-// Store Value into ValueArray[Rank)
-void
-NetworkMessage::setValue(int Rank, const char *Value, unsigned long length)
- throw (RTIinternalError)
-{
- // Pre-Checking
- if (Value == NULL)
- throw RTIinternalError("Bad Value (NULL) for Network message.");
-
- if ((Rank < 0) || (Rank >= (int)ValueArray.size() ))
- throw RTIinternalError("(setValue) Bad Rank for Nmessage.");
-
- // Setting Value
- // First we store the length
- ValueArray[Rank].length = length ;
-
- // then copy Value address into ValueArray
- char *tempValue = new char[length] ;
- memcpy(tempValue, Value, length);
- ValueArray[Rank].value = (char *)tempValue ;
-
-}
-
-// ----------------------------------------------------------------------------
void
NetworkMessage::setAHS(const std::vector <AttributeHandle> &attr, int size)
{
@@ -217,29 +141,27 @@
void
NetworkMessage::sizeValueArray(int size)
{
-ValueArray.resize(size) ;
+valueArray.resize(size) ;
}
// ----------------------------------------------------------------------------
void
NetworkMessage::displayValueArray(char *titre)
{
-printf("(%s) ValueArray size=%d\n",titre,(int)ValueArray.size());
-for (int i=0; i<(int)ValueArray.size();i++)
+ printf("(%s) valueArray size=%d\n",titre,(int)valueArray.size());
+ for (int i=0; i<(int)valueArray.size();i++)
{
- printf("%d : length=%d : value=",i,(int)(ValueArray[i].length));
- for (int k=0; k<(int)ValueArray[i].length ;k++)
- if (isprint(ValueArray[i].value[k]) == 0 )
- {
- printf(" %x",ValueArray[i].value[k]);
- }
+ printf("%d : length=%d : value=",i,(int)(valueArray[i].length()));
+
+ for(int k=0; k<(int)valueArray[i].length(); k++)
+ if (isprint(valueArray[i][k]) == 0 )
+ printf(" %x",valueArray[i][k]);
else
- {
- printf("%c",ValueArray[i].value[k]);
- }
-printf("\n");
+ printf("%c",valueArray[i][k]);
+
+ printf("\n");
}
}
} // namespace certi
-// $Id: NetworkMessage.cc,v 3.36 2008/06/24 08:56:49 rousse Exp $
+// $Id: NetworkMessage.cc,v 3.37 2008/09/18 14:41:29 gotthardp Exp $
Index: libCERTI/NetworkMessage.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/NetworkMessage.hh,v
retrieving revision 3.42
retrieving revision 3.43
diff -u -b -r3.42 -r3.43
--- libCERTI/NetworkMessage.hh 11 Jul 2008 06:06:19 -0000 3.42
+++ libCERTI/NetworkMessage.hh 18 Sep 2008 14:41:29 -0000 3.43
@@ -17,7 +17,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: NetworkMessage.hh,v 3.42 2008/07/11 06:06:19 erk Exp $
+// $Id: NetworkMessage.hh,v 3.43 2008/09/18 14:41:29 gotthardp Exp $
// ----------------------------------------------------------------------------
#ifndef CERTI_NETWORK_MESSAGE_HH
@@ -177,23 +177,13 @@
// Value Array Management
- // setValue : Value and its length are stored into ValueArray[Rank]
- void setValue(int Rank, const char *Value, unsigned long length)
- throw (RTIinternalError); // Bad Rank, Bad Value
-
- // getValue : Value and its length are tooken from ValueArray[Rank]
- // If Value == NULL return a newly allocated copy of Value, else copy it
- // in Value.
- char *getValue(int Rank, unsigned long *length, char *Value = NULL)
- throw (RTIinternalError); // Bad Rank
-
// Return a newly allocated ValueArray, exactly of size AttribArraySize.
// containing the actual Attribute values. You must FREE this structure.
- std::vector <ValueLengthPair> getAttribValueArray();
+ std::vector <AttributeValue_t> getAttribValueArray();
// Return a newly allocated ValueArray, exactly of size ParamArraySize,
// containing the actual Parameter values. You must FREE this structure.
- std::vector <ParameterLengthPair> getParamValueArray();
+ std::vector <ParameterValue_t> getParamValueArray();
void setAHS(const std::vector <AttributeHandle> &, int);
@@ -258,6 +248,7 @@
/* NM_WithHandleArray class specific fields */
UShort handleArraySize ;
std::vector <AttributeHandle> handleArray ;
+ std::vector <AttributeValue_t> valueArray ;
TransportType transport ;
OrderType order ;
@@ -305,9 +296,6 @@
*/
Message_T type;
- // ValueArray is now a ValueLengthPair
- std::vector <ValueLengthPair> ValueArray ;
-
private:
/**
* The date of message if it is dated.
@@ -357,4 +345,4 @@
#endif // CERTI_NETWORK_MESSAGE_HH
-// $Id: NetworkMessage.hh,v 3.42 2008/07/11 06:06:19 erk Exp $
+// $Id: NetworkMessage.hh,v 3.43 2008/09/18 14:41:29 gotthardp Exp $
Index: libCERTI/ObjectClass.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClass.cc,v
retrieving revision 3.52
retrieving revision 3.53
diff -u -b -r3.52 -r3.53
--- libCERTI/ObjectClass.cc 24 Jun 2008 08:56:49 -0000 3.52
+++ libCERTI/ObjectClass.cc 18 Sep 2008 14:41:29 -0000 3.53
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClass.cc,v 3.52 2008/06/24 08:56:49 rousse Exp $
+// $Id: ObjectClass.cc,v 3.53 2008/09/18 14:41:29 gotthardp Exp $
// ----------------------------------------------------------------------------
#include "Object.hh"
@@ -884,7 +884,7 @@
ObjectClass::updateAttributeValues(FederateHandle the_federate,
Object *object,
std::vector <AttributeHandle>
&the_attributes,
- std::vector <ValueLengthPair> &the_values,
+ std::vector <AttributeValue_t> &the_values,
int the_size,
FederationTime the_time,
const char *the_tag)
@@ -920,10 +920,7 @@
for (int i = 0 ; i < the_size ; i++) {
answer->handleArray[i] = the_attributes[i] ;
- // value recopy into answer
- char *tempValue = new char[the_values[i].length] ;
- memcpy(tempValue,the_values[i].value,the_values[i].length) ;
- answer->setValue(i, tempValue, the_values[i].length);
+ answer->valueArray[i] = the_values[i] ;
}
ocbList = new ObjectClassBroadcastList(answer, attributeSet.size());
@@ -951,7 +948,7 @@
ObjectClass::updateAttributeValues(FederateHandle the_federate,
Object *object,
std::vector <AttributeHandle>
&the_attributes,
- std::vector <ValueLengthPair> &the_values,
+ std::vector <AttributeValue_t> &the_values,
int the_size,
const char *the_tag)
throw (ObjectNotKnown,
@@ -987,10 +984,7 @@
for (int i = 0 ; i < the_size ; i++) {
answer->handleArray[i] = the_attributes[i] ;
- // value recopy into answer
- char *tempValue = new char[the_values[i].length] ;
- memcpy(tempValue,the_values[i].value,the_values[i].length) ;
- answer->setValue(i, tempValue, the_values[i].length);
+ answer->valueArray[i] = the_values[i];
}
ocbList = new ObjectClassBroadcastList(answer, attributeSet.size());
@@ -1832,4 +1826,4 @@
} // namespace certi
-// $Id: ObjectClass.cc,v 3.52 2008/06/24 08:56:49 rousse Exp $
+// $Id: ObjectClass.cc,v 3.53 2008/09/18 14:41:29 gotthardp Exp $
Index: libCERTI/ObjectClass.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClass.hh,v
retrieving revision 3.36
retrieving revision 3.37
diff -u -b -r3.36 -r3.37
--- libCERTI/ObjectClass.hh 11 Jun 2008 15:19:22 -0000 3.36
+++ libCERTI/ObjectClass.hh 18 Sep 2008 14:41:29 -0000 3.37
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClass.hh,v 3.36 2008/06/11 15:19:22 rousse Exp $
+// $Id: ObjectClass.hh,v 3.37 2008/09/18 14:41:29 gotthardp Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_OBJECT_CLASS_HH
@@ -201,13 +201,13 @@
ObjectClassBroadcastList *
updateAttributeValues(FederateHandle, Object *, std::vector
<AttributeHandle> &,
- std::vector <ValueLengthPair> &, int,
FederationTime, const char *)
+ std::vector <AttributeValue_t> &, int,
FederationTime, const char *)
throw (ObjectNotKnown, AttributeNotDefined, AttributeNotOwned,
RTIinternalError, InvalidObjectHandle);
ObjectClassBroadcastList *
updateAttributeValues(FederateHandle, Object *, std::vector
<AttributeHandle> &,
- std::vector <ValueLengthPair> &, int, const char *)
+ std::vector <AttributeValue_t> &, int, const char *)
throw (ObjectNotKnown, AttributeNotDefined, AttributeNotOwned,
RTIinternalError, InvalidObjectHandle);
@@ -262,4 +262,4 @@
#endif // _CERTI_OBJECT_CLASS_HH
-// $Id: ObjectClass.hh,v 3.36 2008/06/11 15:19:22 rousse Exp $
+// $Id: ObjectClass.hh,v 3.37 2008/09/18 14:41:29 gotthardp Exp $
Index: libCERTI/ObjectClassBroadcastList.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClassBroadcastList.cc,v
retrieving revision 3.24
retrieving revision 3.25
diff -u -b -r3.24 -r3.25
--- libCERTI/ObjectClassBroadcastList.cc 9 Jul 2008 15:04:26 -0000
3.24
+++ libCERTI/ObjectClassBroadcastList.cc 18 Sep 2008 14:41:29 -0000
3.25
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClassBroadcastList.cc,v 3.24 2008/07/09 15:04:26 rousse Exp $
+// $Id: ObjectClassBroadcastList.cc,v 3.25 2008/09/18 14:41:29 gotthardp Exp $
// ----------------------------------------------------------------------------
@@ -84,8 +84,6 @@
// Copy attributes that are in the bsWaiting state in Line.
UShort currentSize ;
AttributeHandle currentAttrib ;
- char *buffer =NULL;
- unsigned long length ;
reducedMessage->handleArraySize = 0 ;
@@ -106,11 +104,7 @@
if (message->getType() ==
NetworkMessage::REFLECT_ATTRIBUTE_VALUES) {
// Copy Attribute Value.
- message->getValue(i, &length, buffer);
- char *tempValue = new char[length] ;
- memcpy(tempValue,buffer,length) ;
- reducedMessage->setValue(currentSize, tempValue, length);
- buffer = NULL ;
+ reducedMessage->valueArray[currentSize] =
message->valueArray[i];
}
}
}
@@ -407,4 +401,4 @@
} // namespace certi
-// $Id: ObjectClassBroadcastList.cc,v 3.24 2008/07/09 15:04:26 rousse Exp $
+// $Id: ObjectClassBroadcastList.cc,v 3.25 2008/09/18 14:41:29 gotthardp Exp $
Index: libCERTI/ObjectClassSet.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClassSet.cc,v
retrieving revision 3.38
retrieving revision 3.39
diff -u -b -r3.38 -r3.39
--- libCERTI/ObjectClassSet.cc 23 Jun 2008 13:25:05 -0000 3.38
+++ libCERTI/ObjectClassSet.cc 18 Sep 2008 14:41:29 -0000 3.39
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClassSet.cc,v 3.38 2008/06/23 13:25:05 erk Exp $
+// $Id: ObjectClassSet.cc,v 3.39 2008/09/18 14:41:29 gotthardp Exp $
// ----------------------------------------------------------------------------
// Project
@@ -568,7 +568,7 @@
ObjectClassSet::updateAttributeValues(FederateHandle federate,
ObjectHandle object_handle,
std::vector <AttributeHandle>
&attributes,
- std::vector <ValueLengthPair> &values,
+ std::vector <AttributeValue_t> &values,
UShort nb,
FederationTime time,
const char *tag)
@@ -614,7 +614,7 @@
ObjectClassSet::updateAttributeValues(FederateHandle federate,
ObjectHandle object_handle,
std::vector <AttributeHandle>
&attributes,
- std::vector <ValueLengthPair> &values,
+ std::vector <AttributeValue_t> &values,
UShort nb,
const char *tag)
throw (ObjectNotKnown,
@@ -843,4 +843,4 @@
} // namespace certi
-// $Id: ObjectClassSet.cc,v 3.38 2008/06/23 13:25:05 erk Exp $
+// $Id: ObjectClassSet.cc,v 3.39 2008/09/18 14:41:29 gotthardp Exp $
Index: libCERTI/ObjectClassSet.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClassSet.hh,v
retrieving revision 3.30
retrieving revision 3.31
diff -u -b -r3.30 -r3.31
--- libCERTI/ObjectClassSet.hh 23 Jun 2008 13:25:04 -0000 3.30
+++ libCERTI/ObjectClassSet.hh 18 Sep 2008 14:41:30 -0000 3.31
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClassSet.hh,v 3.30 2008/06/23 13:25:04 erk Exp $
+// $Id: ObjectClassSet.hh,v 3.31 2008/09/18 14:41:30 gotthardp Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_OBJECT_CLASS_SET_HH
@@ -109,7 +109,7 @@
void updateAttributeValues(FederateHandle theFederateHandle,
ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &theAttribArray,
- std::vector <ValueLengthPair> &theValueArray,
+ std::vector <AttributeValue_t> &theValueArray,
UShort theArraySize,
FederationTime theTime,
const char *theUserTag)
@@ -119,7 +119,7 @@
void updateAttributeValues(FederateHandle theFederateHandle,
ObjectHandle theObjectHandle,
std::vector <AttributeHandle> &theAttribArray,
- std::vector <ValueLengthPair> &theValueArray,
+ std::vector <AttributeValue_t> &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.30 2008/06/23 13:25:04 erk Exp $
+// $Id: ObjectClassSet.hh,v 3.31 2008/09/18 14:41:30 gotthardp Exp $
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [certi-cvs] certi RTIA/ObjectManagement.cc RTIA/ObjectManag...,
certi-cvs <=