[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[certi-cvs] certi libRTI/RTIambassador.cc include/RTIambSer...
From: |
certi-cvs |
Subject: |
[certi-cvs] certi libRTI/RTIambassador.cc include/RTIambSer... |
Date: |
Wed, 10 Nov 2010 11:41:11 +0000 |
CVSROOT: /sources/certi
Module name: certi
Changes by: Eric NOULARD <erk> 10/11/10 11:41:11
Modified files:
libRTI : RTIambassador.cc
include : RTIambServices.hh
Log message:
Tolerate NULL user supplied tag for UAV and SI
this way we shuold support the legacy behavior of RTI-NG.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/libRTI/RTIambassador.cc?cvsroot=certi&r1=3.119&r2=3.120
http://cvs.savannah.gnu.org/viewcvs/certi/include/RTIambServices.hh?cvsroot=certi&r1=3.7&r2=3.8
Patches:
Index: libRTI/RTIambassador.cc
===================================================================
RCS file: /sources/certi/certi/libRTI/RTIambassador.cc,v
retrieving revision 3.119
retrieving revision 3.120
diff -u -b -r3.119 -r3.120
--- libRTI/RTIambassador.cc 8 Nov 2010 15:30:41 -0000 3.119
+++ libRTI/RTIambassador.cc 10 Nov 2010 11:41:10 -0000 3.120
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: RTIambassador.cc,v 3.119 2010/11/08 15:30:41 erk Exp $
+// $Id: RTIambassador.cc,v 3.120 2010/11/10 11:41:10 erk Exp $
// ----------------------------------------------------------------------------
#include "RTI.hh"
@@ -1113,10 +1113,13 @@
const std::vector<AttributeHandleValuePair_t>& AHVPS =
certi_cast<AttributeHandleValuePairSetImp>()(theAttributes).getAttributeHandleValuePairs();
req.setObject(theObject);
req.setDate(certi_cast<RTIfedTime>()(theTime).getTime());
- if ( theTag == NULL) {
- throw RTI::RTIinternalError ("Calling updateAttributeValues
with Tag NULL");
- }
+ /*
+ * Tolerate NULL tag (DMSO RTI-NG behavior)
+ * by not transmitting the tag in the CERTI message.
+ */
+ if ( theTag != NULL) {
req.setTag(theTag);
+ }
req.setAttributesSize(AHVPS.size());
req.setValuesSize(AHVPS.size());
for (uint32_t i=0;i<AHVPS.size();++i) {
@@ -1132,15 +1135,6 @@
}
// ----------------------------------------------------------------------------
-// Update Attribute Values without time
-/** Realization of the Create Federation Execution federation management
service
- without time (HLA 1.3).
- Provide current values to the federation for instance attributes owned by
- the federate.
- @param theObject Object instance designator
- @param theAttributes Set of attribute designator and value pairs
- @param theTag User supplied tag
- */
void
RTI::RTIambassador::updateAttributeValues(ObjectHandle the_object,
const AttributeHandleValuePairSet& theAttributes,
@@ -1154,11 +1148,13 @@
const std::vector<AttributeHandleValuePair_t>& AHVPS =
certi_cast<AttributeHandleValuePairSetImp>()(theAttributes).getAttributeHandleValuePairs();
req.setObject(the_object);
- if ( theTag == NULL)
- {
- throw RTI::RTIinternalError ("Calling updateAttributeValues
with Tag NULL");
- }
+ /*
+ * Tolerate NULL tag (DMSO RTI-NG behavior)
+ * by not transmitting the tag in the CERTI message.
+ */
+ if ( theTag != NULL) {
req.setTag(theTag);
+ }
req.setAttributesSize(AHVPS.size());
req.setValuesSize(AHVPS.size());
for (uint32_t i=0;i<AHVPS.size();++i) {
@@ -1170,14 +1166,6 @@
}
// ----------------------------------------------------------------------------
-/** Send Interaction with time
- This service (HLA 1.3) send an interaction into the federation.
- As the federation time argument is supplied, an event retraction
designator is returned.
- @param theInteraction Interaction class designator
- @param theParameters Set of interaction parameters designator and value
pairs
- @param theTime Federation time
- @param theTag User-supplied tag
- */
RTI::EventRetractionHandle
RTI::RTIambassador::sendInteraction(InteractionClassHandle theInteraction,
const ParameterHandleValuePairSet& theParameters,
@@ -1197,10 +1185,14 @@
RTI::EventRetractionHandle eventRetraction;
req.setInteractionClass(theInteraction);
req.setDate(certi_cast<RTIfedTime>()(theTime).getTime());
- if (theTag == NULL) {
- throw RTI::RTIinternalError ("Calling sendInteraction with Tag
NULL") ;
+ /*
+ * Tolerate NULL tag (DMSO RTI-NG behavior)
+ * by not transmitting the tag in the CERTI message.
+ */
+ if ( theTag != NULL) {
+ req.setTag(theTag);
}
- req.setTag(std::string(theTag));
+
assignPHVPSToRequest(certi_cast<ParameterHandleValuePairSetImp>()(theParameters).getParameterHandleValuePairs(),req);
req.setRegion(0);
@@ -1233,15 +1225,18 @@
M_Send_Interaction req, rep ;
req.setInteractionClass(theInteraction);
- if (theTag == NULL)
- {
- throw RTI::RTIinternalError ("Calling sendIntercation with Tag
NULL") ;
+ /*
+ * Tolerate NULL tag (DMSO RTI-NG behavior)
+ * by not transmitting the tag in the CERTI message.
+ */
+ if ( theTag != NULL) {
+ req.setTag(theTag);
}
- req.setTag(std::string(theTag));
+
assignPHVPSToRequest(certi_cast<ParameterHandleValuePairSetImp>()(theParameters).getParameterHandleValuePairs(),req);
req.setRegion(0);
privateRefs->executeService(&req, &rep);
- }
+}
// ----------------------------------------------------------------------------
/** Delete Object with time
@@ -3040,4 +3035,4 @@
privateRefs->executeService(&req, &rep);
}
-// $Id: RTIambassador.cc,v 3.119 2010/11/08 15:30:41 erk Exp $
+// $Id: RTIambassador.cc,v 3.120 2010/11/10 11:41:10 erk Exp $
Index: include/RTIambServices.hh
===================================================================
RCS file: /sources/certi/certi/include/RTIambServices.hh,v
retrieving revision 3.7
retrieving revision 3.8
diff -u -b -r3.7 -r3.8
--- include/RTIambServices.hh 20 Aug 2010 14:51:52 -0000 3.7
+++ include/RTIambServices.hh 10 Nov 2010 11:41:11 -0000 3.8
@@ -1,5 +1,5 @@
// HLA 1.3 Header "RTIambServices.hh"
-// $Id: RTIambServices.hh,v 3.7 2010/08/20 14:51:52 erk Exp $
+// $Id: RTIambServices.hh,v 3.8 2010/11/10 11:41:11 erk Exp $
typedef FederateAmbassador *FederateAmbassadorPtr ;
@@ -134,12 +134,29 @@
FederateNotExecutionMember, ConcurrentAccessAttempted,
SaveInProgress,
RestoreInProgress, RTIinternalError);
-void updateAttributeValues(ObjectHandle, const AttributeHandleValuePairSet &,
const char *)
+/**
+ * Realization of the Update Attribute Values (without time) service (HLA 1.3).
+ * Provide current values to the federation for instance attributes owned by
+ * the federate.
+ * @param object Object instance designator
+ * @param attributes Set of attribute designator and value pairs
+ * @param tag User supplied tag
+ */
+void updateAttributeValues(ObjectHandle object, const
AttributeHandleValuePairSet& attributes, const char * tag)
throw (ObjectNotKnown, AttributeNotDefined, AttributeNotOwned,
FederateNotExecutionMember,
ConcurrentAccessAttempted, SaveInProgress, RestoreInProgress,
RTIinternalError);
-EventRetractionHandle sendInteraction(InteractionClassHandle, const
ParameterHandleValuePairSet &,
- const FedTime &, const char *)
+/**
+ * Send Interaction with time
+ * This service (HLA 1.3) send an interaction into the federation.
+ * As the federation time argument is supplied, an event retraction designator
is returned.
+ * @param interactionClassHandle Interaction class designator
+ * @param parameters Set of interaction parameters designator and value pairs
+ * @param time Federation time
+ * @param tag User-supplied tag
+ */
+EventRetractionHandle sendInteraction(InteractionClassHandle
interactionClassHandle, const ParameterHandleValuePairSet& parameters,
+ const FedTime& time, const char * tag)
throw (InteractionClassNotDefined, InteractionClassNotPublished,
InteractionParameterNotDefined,
InvalidFederationTime, FederateNotExecutionMember,
ConcurrentAccessAttempted, SaveInProgress,
RestoreInProgress, RTIinternalError);
@@ -528,4 +545,4 @@
Region *getRegion(RegionToken)
throw (FederateNotExecutionMember, ConcurrentAccessAttempted,
RegionNotKnown, RTIinternalError);
-// $Id: RTIambServices.hh,v 3.7 2010/08/20 14:51:52 erk Exp $
+// $Id: RTIambServices.hh,v 3.8 2010/11/10 11:41:11 erk Exp $
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [certi-cvs] certi libRTI/RTIambassador.cc include/RTIambSer...,
certi-cvs <=