[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[certi-cvs] certi RTIA/ObjectManagement.cc RTIA/RTIA_federa...
From: |
certi-cvs |
Subject: |
[certi-cvs] certi RTIA/ObjectManagement.cc RTIA/RTIA_federa... |
Date: |
Tue, 13 May 2008 13:03:51 +0000 |
CVSROOT: /sources/certi
Module name: certi
Changes by: ROUSSELOT <rousse> 08/05/13 13:03:51
Modified files:
RTIA : ObjectManagement.cc RTIA_federate.cc
libCERTI : ObjectClass.cc ObjectClassSet.cc
libRTI : RTIambassador.cc
Log message:
Better management exception on Get attribute Handle
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/ObjectManagement.cc?cvsroot=certi&r1=3.42&r2=3.43
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/RTIA_federate.cc?cvsroot=certi&r1=3.76&r2=3.77
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClass.cc?cvsroot=certi&r1=3.43&r2=3.44
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClassSet.cc?cvsroot=certi&r1=3.33&r2=3.34
http://cvs.savannah.gnu.org/viewcvs/certi/libRTI/RTIambassador.cc?cvsroot=certi&r1=3.79&r2=3.80
Patches:
Index: RTIA/ObjectManagement.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/ObjectManagement.cc,v
retrieving revision 3.42
retrieving revision 3.43
diff -u -b -r3.42 -r3.43
--- RTIA/ObjectManagement.cc 9 May 2008 20:21:40 -0000 3.42
+++ RTIA/ObjectManagement.cc 13 May 2008 13:03:48 -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: ObjectManagement.cc,v 3.42 2008/05/09 20:21:40 erk Exp $
+// $Id: ObjectManagement.cc,v 3.43 2008/05/13 13:03:48 rousse Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -715,8 +715,6 @@
G.Out(pdGendoc,"exit ObjectManagement::getObjectClassHandle on
NameNotFound");
throw NameNotFound(theName);
}
-
- //return rootObject->ObjectClasses->getObjectClassHandle(theName);
}
@@ -750,8 +748,18 @@
ObjectManagement::getAttributeHandle(const char *theName,
ObjectClassHandle theClassHandle)
{
- return rootObject->ObjectClasses->getAttributeHandle(theName,
+ AttributeHandle handle ;
+ G.Out(pdGendoc,"enter ObjectManagement::getAttributeHandle");
+ try {
+ handle = rootObject->ObjectClasses->getAttributeHandle(theName,
theClassHandle);
+ G.Out(pdGendoc,"exit ObjectManagement::getAttributeHandle");
+ return handle;
+ }
+ catch (NameNotFound &e) {
+ G.Out(pdGendoc,"exit ObjectManagement::getAttributeHandle on
NameNotFound");
+ throw NameNotFound(theName);
+ }
}
// ----------------------------------------------------------------------------
@@ -812,4 +820,4 @@
}} // namespace certi/rtia
-// $Id: ObjectManagement.cc,v 3.42 2008/05/09 20:21:40 erk Exp $
+// $Id: ObjectManagement.cc,v 3.43 2008/05/13 13:03:48 rousse Exp $
Index: RTIA/RTIA_federate.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/RTIA_federate.cc,v
retrieving revision 3.76
retrieving revision 3.77
diff -u -b -r3.76 -r3.77
--- RTIA/RTIA_federate.cc 7 May 2008 09:55:01 -0000 3.76
+++ RTIA/RTIA_federate.cc 13 May 2008 13:03:49 -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: RTIA_federate.cc,v 3.76 2008/05/07 09:55:01 rousse Exp $
+// $Id: RTIA_federate.cc,v 3.77 2008/05/13 13:03:49 rousse Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -799,12 +799,19 @@
rep.setName(om->getObjectInstanceName(req->getObject()));
break ;
+ // May throw NameNotFound
+ // Exception catched and stored in rep Message for answer
case Message::GET_ATTRIBUTE_HANDLE:
D.Out(pdTrace,
"Receiving Message from Federate, type GetAttributeHandle.");
-
+ try {
rep.setAttribute(om->getAttributeHandle(req->getName(),
req->getObjectClass()));
+ }
+ catch (RTI::Exception &egah)
+ {
+
rep.setException(static_cast<TypeException>(egah.getType()),egah._reason);
+ }
break ;
case Message::GET_ATTRIBUTE_NAME:
@@ -1429,4 +1436,4 @@
}} // namespace certi/rtia
-// $Id: RTIA_federate.cc,v 3.76 2008/05/07 09:55:01 rousse Exp $
+// $Id: RTIA_federate.cc,v 3.77 2008/05/13 13:03:49 rousse Exp $
Index: libCERTI/ObjectClass.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClass.cc,v
retrieving revision 3.43
retrieving revision 3.44
diff -u -b -r3.43 -r3.44
--- libCERTI/ObjectClass.cc 29 Apr 2008 08:57:48 -0000 3.43
+++ libCERTI/ObjectClass.cc 13 May 2008 13:03:49 -0000 3.44
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClass.cc,v 3.43 2008/04/29 08:57:48 erk Exp $
+// $Id: ObjectClass.cc,v 3.44 2008/05/13 13:03:49 rousse Exp $
// ----------------------------------------------------------------------------
#include "Object.hh"
@@ -484,16 +484,20 @@
ObjectClass::getAttributeHandle(const char *the_name) const
throw (NameNotFound, RTIinternalError)
{
+ G.Out(pdGendoc,"enter ObjectClass::getAttributeHandle");
+
list<ObjectClassAttribute *>::const_iterator a ;
for (a = attributeSet.begin(); a != attributeSet.end(); a++) {
- if (strcmp((*a)->getCName(), the_name) == 0)
+ if (strcmp((*a)->getCName(), the_name) == 0) {
+ G.Out(pdGendoc,"exit ObjectClass::getAttributeHandle");
return (*a)->getHandle();
}
+ }
D.Out(pdExcept, "ObjectClass %u: Attribute \"%s\" not defined.",
handle, the_name);
-
- throw NameNotFound("");
+ G.Out(pdGendoc,"exit ObjectClass::getAttributeHandle on NameNotFound");
+ throw NameNotFound(the_name);
}
// ----------------------------------------------------------------------------
@@ -1806,4 +1810,4 @@
} // namespace certi
-// $Id: ObjectClass.cc,v 3.43 2008/04/29 08:57:48 erk Exp $
+// $Id: ObjectClass.cc,v 3.44 2008/05/13 13:03:49 rousse Exp $
Index: libCERTI/ObjectClassSet.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClassSet.cc,v
retrieving revision 3.33
retrieving revision 3.34
diff -u -b -r3.33 -r3.34
--- libCERTI/ObjectClassSet.cc 7 May 2008 09:55:02 -0000 3.33
+++ libCERTI/ObjectClassSet.cc 13 May 2008 13:03:50 -0000 3.34
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClassSet.cc,v 3.33 2008/05/07 09:55:02 rousse Exp $
+// $Id: ObjectClassSet.cc,v 3.34 2008/05/13 13:03:50 rousse Exp $
// ----------------------------------------------------------------------------
// Project
@@ -238,10 +238,13 @@
ObjectClassHandle the_class) const
throw (NameNotFound, ObjectClassNotDefined, RTIinternalError)
{
+ G.Out(pdGendoc,"enter ObjectClassSet::getAttributeHandle");
+
ObjectClass *objectClass = 0 ;
+ AttributeHandle handle ;
if (the_name == 0)
- throw RTIinternalError("");
+ throw RTIinternalError("name is null");
D.Out(pdRequest, "Looking for attribute \"%s\" of class %u...",
the_name, the_class);
@@ -249,7 +252,18 @@
// It may throw ObjectClassNotDefined.
objectClass = getWithHandle(the_class);
- return objectClass->getAttributeHandle(the_name);
+
+ try
+ {
+ handle = objectClass->getAttributeHandle(the_name);
+ G.Out(pdGendoc,"exit ObjectClassSet::getAttributeHandle");
+ return handle ;
+ }
+ catch ( NameNotFound )
+ {
+ G.Out(pdGendoc,"exit ObjectClassset::getAttributeHandle on
NameNotFound");
+ throw NameNotFound (the_name) ;
+ }
}
// ----------------------------------------------------------------------------
@@ -829,4 +843,4 @@
} // namespace certi
-// $Id: ObjectClassSet.cc,v 3.33 2008/05/07 09:55:02 rousse Exp $
+// $Id: ObjectClassSet.cc,v 3.34 2008/05/13 13:03:50 rousse Exp $
Index: libRTI/RTIambassador.cc
===================================================================
RCS file: /sources/certi/certi/libRTI/RTIambassador.cc,v
retrieving revision 3.79
retrieving revision 3.80
diff -u -b -r3.79 -r3.80
--- libRTI/RTIambassador.cc 12 May 2008 12:16:58 -0000 3.79
+++ libRTI/RTIambassador.cc 13 May 2008 13:03:50 -0000 3.80
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: RTIambassador.cc,v 3.79 2008/05/12 12:16:58 erk Exp $
+// $Id: RTIambassador.cc,v 3.80 2008/05/13 13:03:50 rousse Exp $
// ----------------------------------------------------------------------------
@@ -2508,11 +2508,13 @@
RTIinternalError)
{
+ G.Out(pdGendoc,"enter RTI::RTIambassador::getAttributeHandle");
Message req, rep ;
req.type = Message::GET_ATTRIBUTE_HANDLE ;
req.setName(theName);
req.setObjectClass(whichClass);
privateRefs->executeService(&req, &rep);
+ G.Out(pdGendoc,"exit RTI::RTIambassador::getAttributeHandle");
return rep.getAttribute();
}
@@ -2956,4 +2958,4 @@
privateRefs->executeService(&req, &rep);
}
-// $Id: RTIambassador.cc,v 3.79 2008/05/12 12:16:58 erk Exp $
+// $Id: RTIambassador.cc,v 3.80 2008/05/13 13:03:50 rousse Exp $
- [certi-cvs] certi RTIA/ObjectManagement.cc RTIA/RTIA_federa...,
certi-cvs <=