[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
certi/libCERTI ObjectClassSet.cc ObjectClassSet...
From: |
certi-cvs |
Subject: |
certi/libCERTI ObjectClassSet.cc ObjectClassSet... |
Date: |
Mon, 19 Nov 2007 09:29:04 +0000 |
CVSROOT: /sources/certi
Module name: certi
Changes by: Eric NOULARD <erk> 07/11/19 09:29:04
Modified files:
libCERTI : ObjectClassSet.cc ObjectClassSet.hh
RootObject.hh
Log message:
Add name collision detection (before full hierarchical support)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClassSet.cc?cvsroot=certi&r1=3.28&r2=3.29
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClassSet.hh?cvsroot=certi&r1=3.24&r2=3.25
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/RootObject.hh?cvsroot=certi&r1=3.23&r2=3.24
Patches:
Index: ObjectClassSet.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClassSet.cc,v
retrieving revision 3.28
retrieving revision 3.29
diff -u -b -r3.28 -r3.29
--- ObjectClassSet.cc 31 Oct 2007 10:30:20 -0000 3.28
+++ ObjectClassSet.cc 19 Nov 2007 09:29:03 -0000 3.29
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClassSet.cc,v 3.28 2007/10/31 10:30:20 erk Exp $
+// $Id: ObjectClassSet.cc,v 3.29 2007/11/19 09:29:03 erk Exp $
// ----------------------------------------------------------------------------
// Project
@@ -47,12 +47,31 @@
// ----------------------------------------------------------------------------
//! The class is not allocated, only the pointer is memorized.
void
-ObjectClassSet::addClass(ObjectClass *newClass)
+ObjectClassSet::addClass(ObjectClass *newClass) throw (RTIinternalError)
{
+ Name2ObjectClassMap_t::iterator findit;
+ std::stringstream msg;
+
D.Out(pdInit, "Adding new object class %d.", newClass->getHandle());
/* link to server */
newClass->server = server ;
+ /*
+ * Check whether addition of this object clas
+ * will generate a name collision or not.
+ * i.e. we may not add an object class of the SAME
+ * name to the object class set
+ */
+ findit = OCFromName.find(newClass->getName());
+ if (findit != OCFromName.end()) {
+ msg << "Name collision another object class named <"
+ << newClass->getName()
+ << "> with handle <"
+ << findit->second->getHandle()
+ << "> was found when trying to add identically named object class
with handle <"
+ << newClass->getHandle();
+ throw RTIinternalError(msg.str().c_str());
+ }
/* store ref to new class in ObjectClass from Handle Map */
OCFromHandle[newClass->getHandle()] = newClass;
/* store ref to new class in ObjectClass from Name Map */
@@ -760,4 +779,4 @@
} // namespace certi
-// $Id: ObjectClassSet.cc,v 3.28 2007/10/31 10:30:20 erk Exp $
+// $Id: ObjectClassSet.cc,v 3.29 2007/11/19 09:29:03 erk Exp $
Index: ObjectClassSet.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClassSet.hh,v
retrieving revision 3.24
retrieving revision 3.25
diff -u -b -r3.24 -r3.25
--- ObjectClassSet.hh 31 Oct 2007 10:30:23 -0000 3.24
+++ ObjectClassSet.hh 19 Nov 2007 09:29:03 -0000 3.25
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: ObjectClassSet.hh,v 3.24 2007/10/31 10:30:23 erk Exp $
+// $Id: ObjectClassSet.hh,v 3.25 2007/11/19 09:29:03 erk Exp $
// ----------------------------------------------------------------------------
#ifndef _CERTI_OBJECT_CLASS_SET_HH
@@ -50,7 +50,7 @@
ObjectClassSet(SecurityServer *theSecurityServer, bool
isRootClassSet=false);
~ObjectClassSet();
- void addClass(ObjectClass *theClass);
+ void addClass(ObjectClass *theClass) throw (RTIinternalError);
void buildParentRelation(ObjectClass *Child, ObjectClass *Parent);
void display() const ;
@@ -204,4 +204,4 @@
#endif // _CERTI_OBJECT_CLASS_SET_HH
-// $Id: ObjectClassSet.hh,v 3.24 2007/10/31 10:30:23 erk Exp $
+// $Id: ObjectClassSet.hh,v 3.25 2007/11/19 09:29:03 erk Exp $
Index: RootObject.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/RootObject.hh,v
retrieving revision 3.23
retrieving revision 3.24
diff -u -b -r3.23 -r3.24
--- RootObject.hh 31 Oct 2007 10:30:23 -0000 3.23
+++ RootObject.hh 19 Nov 2007 09:29:04 -0000 3.24
@@ -19,7 +19,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
-// $Id: RootObject.hh,v 3.23 2007/10/31 10:30:23 erk Exp $
+// $Id: RootObject.hh,v 3.24 2007/11/19 09:29:04 erk Exp $
// ----------------------------------------------------------------------------
#ifndef LIBCERTI_ROOT_OBJECT
@@ -47,6 +47,11 @@
namespace certi {
+/**
+ * The RootObject is literally the "root" object
+ * of the HLA object class hierarchy.
+ * It contains
+ */
class CERTI_EXPORT RootObject
{
public:
@@ -113,4 +118,4 @@
#endif // LIBCERTI_ROOT_OBJECT
-// $Id: RootObject.hh,v 3.23 2007/10/31 10:30:23 erk Exp $
+// $Id: RootObject.hh,v 3.24 2007/11/19 09:29:04 erk Exp $
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- certi/libCERTI ObjectClassSet.cc ObjectClassSet...,
certi-cvs <=