certi-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[certi-cvs] certi/libCERTI Subscribable.cc fed.cc XmlParser...


From: certi-cvs
Subject: [certi-cvs] certi/libCERTI Subscribable.cc fed.cc XmlParser...
Date: Tue, 24 Nov 2009 16:39:20 +0000

CVSROOT:        /sources/certi
Module name:    certi
Changes by:     Eric NOULARD <erk>      09/11/24 16:39:20

Modified files:
        libCERTI       : Subscribable.cc fed.cc XmlParser.cc 
                         ObjectClassAttribute.hh Parameter.cc 
                         Parameter.hh Interaction.cc 
                         ObjectClassAttribute.cc ObjectClass.cc 
                         ObjectClass.hh Subscribable.hh RootObject.cc 

Log message:
        Check-in clean-up patch from Mathias
        patch #6994: No implicit attribute handle allocation

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Subscribable.cc?cvsroot=certi&r1=3.9&r2=3.10
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/fed.cc?cvsroot=certi&r1=3.21&r2=3.22
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/XmlParser.cc?cvsroot=certi&r1=3.32&r2=3.33
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClassAttribute.hh?cvsroot=certi&r1=3.27&r2=3.28
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Parameter.cc?cvsroot=certi&r1=3.11&r2=3.12
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Parameter.hh?cvsroot=certi&r1=3.8&r2=3.9
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Interaction.cc?cvsroot=certi&r1=3.57&r2=3.58
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClassAttribute.cc?cvsroot=certi&r1=3.35&r2=3.36
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClass.cc?cvsroot=certi&r1=3.74&r2=3.75
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/ObjectClass.hh?cvsroot=certi&r1=3.50&r2=3.51
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/Subscribable.hh?cvsroot=certi&r1=3.8&r2=3.9
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/RootObject.cc?cvsroot=certi&r1=3.47&r2=3.48

Patches:
Index: Subscribable.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Subscribable.cc,v
retrieving revision 3.9
retrieving revision 3.10
diff -u -b -r3.9 -r3.10
--- Subscribable.cc     21 Oct 2009 20:04:46 -0000      3.9
+++ Subscribable.cc     24 Nov 2009 16:39:20 -0000      3.10
@@ -17,7 +17,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: Subscribable.cc,v 3.9 2009/10/21 20:04:46 erk Exp $
+// $Id: Subscribable.cc,v 3.10 2009/11/24 16:39:20 erk Exp $
 // ----------------------------------------------------------------------------
 
 
@@ -94,6 +94,13 @@
 }
 
 // ----------------------------------------------------------------------------
+// Constructor
+Subscribable::Subscribable(const std::string& name)
+    : Named(name)
+{
+}
+
+// ----------------------------------------------------------------------------
 Subscribable::~Subscribable()
 {
     if (!subscribers.empty())
@@ -201,4 +208,4 @@
 
 } // namespace certi
 
-// $Id: Subscribable.cc,v 3.9 2009/10/21 20:04:46 erk Exp $
+// $Id: Subscribable.cc,v 3.10 2009/11/24 16:39:20 erk Exp $

Index: fed.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/fed.cc,v
retrieving revision 3.21
retrieving revision 3.22
diff -u -b -r3.21 -r3.22
--- fed.cc      21 Oct 2009 18:56:28 -0000      3.21
+++ fed.cc      24 Nov 2009 16:39:20 -0000      3.22
@@ -19,7 +19,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: fed.cc,v 3.21 2009/10/21 18:56:28 erk Exp $
+// $Id: fed.cc,v 3.22 2009/11/24 16:39:20 erk Exp $
 // ----------------------------------------------------------------------------
 
 // CERTI header
@@ -277,7 +277,10 @@
 void
 addAttribute()
 {
-       attribute = new ObjectClassAttribute(arg,transport,order);
+        AttributeHandle attributeHandle = 
objects.back()->getHandleClassAttributeMap().size() + 1;
+       attribute = new ObjectClassAttribute(arg, attributeHandle);
+        attribute->transport = transport;
+        attribute->order = order;
        objects.back()->addAttribute(attribute);
 
        indent();
@@ -358,9 +361,7 @@
 void
 addParameter()
 {
-       parameter = new Parameter();
-       parameter->setHandle(parameterHandle++);
-       parameter->setName(arg);
+        parameter = new Parameter(arg, parameterHandle++);
        interactions.back()->addParameter(parameter);
 
        indent();
@@ -452,4 +453,4 @@
 
 }} // namespaces
 
-// $Id: fed.cc,v 3.21 2009/10/21 18:56:28 erk Exp $
+// $Id: fed.cc,v 3.22 2009/11/24 16:39:20 erk Exp $

Index: XmlParser.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/XmlParser.cc,v
retrieving revision 3.32
retrieving revision 3.33
diff -u -b -r3.32 -r3.33
--- XmlParser.cc        19 Nov 2009 18:15:31 -0000      3.32
+++ XmlParser.cc        24 Nov 2009 16:39:20 -0000      3.33
@@ -168,17 +168,18 @@
         // Attributes
         if ((!xmlStrcmp(cur->name, NODE_ATTRIBUTE))) {
                std::string name = 
std::string(CleanXmlGetProp(cur,ATTRIBUTE_NAME));
-               TransportType transport;
-               OrderType order;
+            AttributeHandle attributeHandle = 
current->getHandleClassAttributeMap().size() + 1;
+
+            ObjectClassAttribute *attr = new ObjectClassAttribute(name, 
attributeHandle);
 
             // Transportation
             xmlChar* xtransport = xmlGetProp(cur, ATTRIBUTE_TRANSPORTATION);
             if (!xmlStrcmp(xtransport,VALUE_RELIABLE)) {
-                transport = RELIABLE ;
+                attr->transport = RELIABLE ;
             }
             else {
                if (!xmlStrcmp(xtransport,VALUE_BESTEFFORT)) {
-                       transport = BEST_EFFORT ;
+                       attr->transport = BEST_EFFORT ;
                }
             }
             xmlFree(xtransport);
@@ -186,15 +187,15 @@
             // Order
             xmlChar* xorder = xmlGetProp(cur, ATTRIBUTE_ORDER);
             if (!xmlStrcmp(xorder, VALUE_TSO)) {
-                order = TIMESTAMP ;
+                attr->order = TIMESTAMP ;
             }
             else {
                if (!xmlStrcmp(xorder, VALUE_RO)) {
-                       order = RECEIVE ;
+                       attr->order = RECEIVE ;
                }
             }
             xmlFree(xorder);
-            ObjectClassAttribute *attr = new 
ObjectClassAttribute(name,transport,order);
+
             // Routing space
             char *space = (char *) xmlGetProp(cur, ATTRIBUTE_SPACE);
             if (space) {
@@ -282,9 +283,8 @@
     cur = cur->xmlChildrenNode ;
     while (cur != NULL) {
         if ((!xmlStrcmp(cur->name, NODE_PARAMETER))) {
-            Parameter *param = new Parameter();
-            param->setName(std::string(CleanXmlGetProp(cur,ATTRIBUTE_NAME)));
-            param->setHandle(freeParameterHandle++);
+            std::string name(CleanXmlGetProp(cur,ATTRIBUTE_NAME));
+            Parameter *param = new Parameter(name, freeParameterHandle++);
             current->addParameter(param);
         }
         // Subinteraction

Index: ObjectClassAttribute.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClassAttribute.hh,v
retrieving revision 3.27
retrieving revision 3.28
diff -u -b -r3.27 -r3.28
--- ObjectClassAttribute.hh     19 Nov 2009 18:15:30 -0000      3.27
+++ ObjectClassAttribute.hh     24 Nov 2009 16:39:20 -0000      3.28
@@ -19,7 +19,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: ObjectClassAttribute.hh,v 3.27 2009/11/19 18:15:30 erk Exp $
+// $Id: ObjectClassAttribute.hh,v 3.28 2009/11/24 16:39:20 erk Exp $
 // ----------------------------------------------------------------------------
 
 #ifndef CERTI_OBJECT_CLASS_ATTRIBUTE_HH
@@ -54,13 +54,12 @@
      */
     typedef std::set<FederateHandle> PublishersList_t;
 
-    ObjectClassAttribute(const std::string& theName, TransportType 
theTransport, OrderType theOrder);
-    ObjectClassAttribute(ObjectClassAttribute *source);
+    ObjectClassAttribute(const std::string& name, AttributeHandle 
attributeHandle);
+    ObjectClassAttribute(const ObjectClassAttribute& objectClassAttribute);
     virtual ~ObjectClassAttribute();
 
     void display() const ;
 
-    void setHandle(AttributeHandle h);
     AttributeHandle getHandle() const ;
 
     void setSpace(SpaceHandle);
@@ -82,7 +81,7 @@
      * Getter for the attributes publisher list.
      * param[out] PublishersList_t @see ObjectClassAttribute::PublisherList_t
      */
-    PublishersList_t getPublishers(void);
+    const PublishersList_t& getPublishers(void) const { return publishers; }
 
     // Attributes
     SecurityLevelID level ;
@@ -96,9 +95,10 @@
         * one should not call it.
         */
        ObjectClassAttribute();
+
     void deletePublisher(FederateHandle);
 
-    AttributeHandle handle ; //!< The attribute handle.
+    const AttributeHandle handle ; //!< The attribute handle.
     SpaceHandle space ; //!< Routing space
 
     PublishersList_t publishers ; //!< The publisher's list.
@@ -108,4 +108,4 @@
 
 #endif // CERTI_OBJECT_CLASS_ATTRIBUTE_HH
 
-// $Id: ObjectClassAttribute.hh,v 3.27 2009/11/19 18:15:30 erk Exp $
+// $Id: ObjectClassAttribute.hh,v 3.28 2009/11/24 16:39:20 erk Exp $

Index: Parameter.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Parameter.cc,v
retrieving revision 3.11
retrieving revision 3.12
diff -u -b -r3.11 -r3.12
--- Parameter.cc        19 Nov 2009 18:15:30 -0000      3.11
+++ Parameter.cc        24 Nov 2009 16:39:20 -0000      3.12
@@ -19,35 +19,29 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: Parameter.cc,v 3.11 2009/11/19 18:15:30 erk Exp $
+// $Id: Parameter.cc,v 3.12 2009/11/24 16:39:20 erk Exp $
 // ----------------------------------------------------------------------------
 
 
 #include "Parameter.hh"
 
-#include <stdio.h>
 #include <iostream>
 
 namespace certi {
 
-Parameter::Parameter()
-    : LevelID(PublicLevelID), handle(0)
-{
-}
-
-Parameter::Parameter(const std::string& s)
-    : Named(s), LevelID(PublicLevelID), handle(0)
+Parameter::Parameter(const std::string& name, ParameterHandle parameterHandle)
+    : Named(name), Handled<ParameterHandle>(parameterHandle), 
LevelID(PublicLevelID)
 {
 }
 
 void
 Parameter::display(void)
 {
-    std::cout << " Parameter " << handle << ": "
+    std::cout << " Parameter " << getHandle() << ": "
              << (name.length() == 0 ? "(no name)" : name.c_str())
              << " [Level " << LevelID << "]" << std::endl ;
 }
 
 } // namespace certi
 
-// $Id: Parameter.cc,v 3.11 2009/11/19 18:15:30 erk Exp $
+// $Id: Parameter.cc,v 3.12 2009/11/24 16:39:20 erk Exp $

Index: Parameter.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/Parameter.hh,v
retrieving revision 3.8
retrieving revision 3.9
diff -u -b -r3.8 -r3.9
--- Parameter.hh        19 Nov 2009 18:15:31 -0000      3.8
+++ Parameter.hh        24 Nov 2009 16:39:20 -0000      3.9
@@ -19,7 +19,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: Parameter.hh,v 3.8 2009/11/19 18:15:31 erk Exp $
+// $Id: Parameter.hh,v 3.9 2009/11/24 16:39:20 erk Exp $
 // ----------------------------------------------------------------------------
 
 #ifndef CERTI_PARAMETER_HH
@@ -27,31 +27,25 @@
 
 #include "certi.hh"
 #include "SecurityLevel.hh"
+#include "Handled.hh"
 #include "Named.hh"
 
 #include <string>
 
 namespace certi {
 
-class Parameter : public Named
+class Parameter : public Named, public Handled<ParameterHandle>
 {
 public:
-    Parameter();
-    Parameter(const std::string&);
+    Parameter(const std::string& name, ParameterHandle parameterHandle);
 
     void display();
     
-    void setHandle(Handle p) { handle = p ; };
-    Handle getHandle() const { return handle ; };
-
     SecurityLevelID LevelID ;
-
-private:
-    Handle handle ;
 };
 
 } // namespace certi
 
 #endif // CERTI_PARAMETER_HH
 
-// $Id: Parameter.hh,v 3.8 2009/11/19 18:15:31 erk Exp $
+// $Id: Parameter.hh,v 3.9 2009/11/24 16:39:20 erk Exp $

Index: Interaction.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/Interaction.cc,v
retrieving revision 3.57
retrieving revision 3.58
diff -u -b -r3.57 -r3.58
--- Interaction.cc      21 Nov 2009 15:13:08 -0000      3.57
+++ Interaction.cc      24 Nov 2009 16:39:20 -0000      3.58
@@ -19,7 +19,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: Interaction.cc,v 3.57 2009/11/21 15:13:08 erk Exp $
+// $Id: Interaction.cc,v 3.58 2009/11/24 16:39:20 erk Exp $
 // ----------------------------------------------------------------------------
 
 
@@ -44,10 +44,9 @@
 static PrettyDebug G("GENDOC",__FILE__) ;
 
 Interaction::Interaction(const std::string& theName, InteractionClassHandle 
theHandle, TransportType theTransport, OrderType theOrder)
-: parent(0), depth(0), transport(theTransport), order(theOrder), 
handle(theHandle),
+  : Subscribable(theName), parent(0), depth(0), transport(theTransport), 
order(theOrder), handle(theHandle),
   superClass(0), id(PublicLevelID), space(0)
 {
-       setName(theName);
        /*
         * The set of interaction subclass has no security server
         */
@@ -89,24 +88,27 @@
 ParameterHandle
 Interaction::addParameter(Parameter *the_parameter, bool is_inherited)
 {
-       // FIXME: the parameter handle has already been set
-       // in fed.cc::addParameter() why should it be set again
-       // here
-       //the_parameter->setHandle(parameterSet.size() + 1);
+        if (the_parameter == NULL)
+                throw RTIinternalError("Tried to add NULL parameter.");
+    
+        ParameterHandle parameterHandle = the_parameter->getHandle();
+        if (_handleParameterMap.find(parameterHandle) != 
_handleParameterMap.end()) {
+                throw RTIinternalError("Interaction::addParameter: Tried to 
add parameter with duplicate handle.");
+        }
 
        // An inherited parameter keeps its security level, any other get the
        // default security level of the class.
        if (!is_inherited)
                the_parameter->LevelID = id ;
 
-        _handleParameterMap[the_parameter->getHandle()] = the_parameter;
+        _handleParameterMap[parameterHandle] = the_parameter;
 
        Debug(D, pdRegister) << "Interaction " << handle << "[" << name
        << "] has a new parameter "
-       << the_parameter->getHandle() << "[" << the_parameter->getName() << "]"
+       << parameterHandle << "[" << the_parameter->getName() << "]"
        << std::flush;
 
-       return the_parameter->getHandle();
+       return parameterHandle;
 } /* end of addParameter */
 
 void
@@ -115,7 +117,7 @@
         for (HandleParameterMap::iterator i = _handleParameterMap.begin(); i 
!= _handleParameterMap.end(); ++i) {
                assert(i->second != NULL);
 
-                Parameter *child = new Parameter(*(i->second));
+                Parameter *child = new Parameter(*i->second);
                assert(child != NULL);
 
                D.Out(pdProtocol,
@@ -123,13 +125,6 @@
                                handle, i->second->getHandle(), 
the_child->handle);
 
                the_child->addParameter(child, true);
-
-               /* FIXME EN: what is the purpose of the check ?? */
-               if (child->getHandle() != i->second->getHandle()) {
-                       throw RTIinternalError("Error while copying child's 
attributes.");
-               } else {
-                       ;
-               }
        }
 } /* end of addInheritedClassParameter */
 
@@ -548,4 +543,4 @@
 
 } // namespace certi
 
-// $Id: Interaction.cc,v 3.57 2009/11/21 15:13:08 erk Exp $
+// $Id: Interaction.cc,v 3.58 2009/11/24 16:39:20 erk Exp $

Index: ObjectClassAttribute.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClassAttribute.cc,v
retrieving revision 3.35
retrieving revision 3.36
diff -u -b -r3.35 -r3.36
--- ObjectClassAttribute.cc     19 Nov 2009 18:15:32 -0000      3.35
+++ ObjectClassAttribute.cc     24 Nov 2009 16:39:20 -0000      3.36
@@ -19,20 +19,16 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: ObjectClassAttribute.cc,v 3.35 2009/11/19 18:15:32 erk Exp $
+// $Id: ObjectClassAttribute.cc,v 3.36 2009/11/24 16:39:20 erk Exp $
 // ----------------------------------------------------------------------------
 
 #include "ObjectClassAttribute.hh"
 #include "ObjectClassBroadcastList.hh"
 #include "SecurityServer.hh"
 #include "PrettyDebug.hh"
-#include "helper.hh"
 
 #include <iostream>
-#include <list>
-#include <assert.h>
 
-using std::list ;
 using std::cout ;
 using std::endl ;
 
@@ -40,35 +36,24 @@
 
 static PrettyDebug D("OBJECTCLASSATTRIBUTE", "(Obj.Cl.Attr) ");
 
-ObjectClassAttribute::ObjectClassAttribute(const std::string& theName, 
TransportType theTransport, OrderType theOrder)
-  : level(PublicLevelID), order(theOrder), transport(theTransport), server(0), 
handle(0), space(0) {
-       setName(theName);
-
-}
 // ----------------------------------------------------------------------------
-//! No parameters constructor.
-/*! This constructor initialize the attribute with default parameters.
- */
-ObjectClassAttribute::ObjectClassAttribute()
-    : level(PublicLevelID), order(RECEIVE),
-      transport(BEST_EFFORT), server(0), handle(0), space(0)
+//! Constructor : Set const attribute handle and name
+ObjectClassAttribute::ObjectClassAttribute(const std::string& name, 
AttributeHandle attributeHandle)
+  : Subscribable(name), level(PublicLevelID), order(0), transport(0), 
server(0), handle(attributeHandle), space(0)
 {
 }
 
 // ----------------------------------------------------------------------------
 //! Constructor : Copy Handle, Name, Space, Order and Transport
-ObjectClassAttribute::ObjectClassAttribute(ObjectClassAttribute *source)
+ObjectClassAttribute::ObjectClassAttribute(const ObjectClassAttribute& 
objectClassAttribute)
+  : Subscribable(objectClassAttribute.getName()),
+    level(objectClassAttribute.level),
+    order(objectClassAttribute.order),
+    transport(objectClassAttribute.transport),
+    server(objectClassAttribute.server),
+    handle(objectClassAttribute.handle),
+    space(objectClassAttribute.space)
 {
-    if (source == 0)
-        throw RTIinternalError("NULL Attribute when copying it.");
-
-    handle = source->getHandle();
-    level = source->level ;
-    space = source->getSpace();
-    setName(source->getName());
-    order = source->order ;
-    transport = source->transport ;
-    server = source->server ;
 }
 
 // ----------------------------------------------------------------------------
@@ -162,13 +147,6 @@
 }
 
 // ----------------------------------------------------------------------------
-void
-ObjectClassAttribute::setHandle(AttributeHandle h)
-{
-    handle = h ;
-}
-
-// ----------------------------------------------------------------------------
 AttributeHandle
 ObjectClassAttribute::getHandle() const
 {
@@ -212,11 +190,6 @@
     }
 }
 
-ObjectClassAttribute::PublishersList_t
-ObjectClassAttribute::getPublishers(void) {
-    return publishers;
-}
-
 } // namespace
 
-// $Id: ObjectClassAttribute.cc,v 3.35 2009/11/19 18:15:32 erk Exp $
+// $Id: ObjectClassAttribute.cc,v 3.36 2009/11/24 16:39:20 erk Exp $

Index: ObjectClass.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClass.cc,v
retrieving revision 3.74
retrieving revision 3.75
diff -u -b -r3.74 -r3.75
--- ObjectClass.cc      23 Nov 2009 07:34:28 -0000      3.74
+++ ObjectClass.cc      24 Nov 2009 16:39:20 -0000      3.75
@@ -19,7 +19,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: ObjectClass.cc,v 3.74 2009/11/23 07:34:28 erk Exp $
+// $Id: ObjectClass.cc,v 3.75 2009/11/24 16:39:20 erk Exp $
 // ----------------------------------------------------------------------------
 
 #include  "Object.hh"
@@ -61,7 +61,11 @@
     if (theAttribute == NULL)
         throw RTIinternalError("Tried to add NULL attribute.");
 
-    theAttribute->setHandle(_handleClassAttributeMap.size() + 1);
+    AttributeHandle attributeHandle = theAttribute->getHandle();
+    if (_handleClassAttributeMap.find(attributeHandle) != 
_handleClassAttributeMap.end()) {
+        throw RTIinternalError("ObjectClass::addAttribute: Tried to add 
attribute with duplicate handle.");
+    }
+
     theAttribute->server = server ;
 
     // If the attribute is inherited, it keeps its security level.
@@ -69,12 +73,12 @@
     if (!is_inherited)
         theAttribute->level = securityLevelId ;
 
-    _handleClassAttributeMap[theAttribute->getHandle()] = theAttribute;
+    _handleClassAttributeMap[attributeHandle] = theAttribute;
 
     D.Out(pdProtocol, "ObjectClass %u has a new attribute %u.",
-          handle, theAttribute->getHandle());
+          handle, attributeHandle);
 
-    return theAttribute->getHandle();
+    return attributeHandle;
 }
 
 // ----------------------------------------------------------------------------
@@ -92,10 +96,7 @@
               "ObjectClass %u adding new attribute %d to child class %u.",
               handle, a->second->getHandle(), the_child->getHandle());
 
-        the_child->addAttribute(childAttribute);
-
-        if (childAttribute->getHandle() != a->second->getHandle())
-            throw RTIinternalError("Error while copying child's attributes.");
+        the_child->addAttribute(childAttribute, true);
     }
 } /* end of addInheritedClassAttributes */
 
@@ -1725,4 +1726,4 @@
 
 } // namespace certi
 
-// $Id: ObjectClass.cc,v 3.74 2009/11/23 07:34:28 erk Exp $
+// $Id: ObjectClass.cc,v 3.75 2009/11/24 16:39:20 erk Exp $

Index: ObjectClass.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/ObjectClass.hh,v
retrieving revision 3.50
retrieving revision 3.51
diff -u -b -r3.50 -r3.51
--- ObjectClass.hh      23 Nov 2009 07:34:28 -0000      3.50
+++ ObjectClass.hh      24 Nov 2009 16:39:20 -0000      3.51
@@ -19,7 +19,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: ObjectClass.hh,v 3.50 2009/11/23 07:34:28 erk Exp $
+// $Id: ObjectClass.hh,v 3.51 2009/11/24 16:39:20 erk Exp $
 // ----------------------------------------------------------------------------
 
 #ifndef _CERTI_OBJECT_CLASS_HH
@@ -118,7 +118,7 @@
         * Get the super class handle.
         * @return the super class handle
         */
-       ObjectClassHandle getSuperclass() const { return superClass ; };
+       ObjectClassHandle getSuperclass() const { return superClass ; }
 
        /**
         * Add a subclass to this object class.
@@ -135,13 +135,13 @@
        /**
         * Get the whole set of subclasses.
         */
-       ObjectClassSet* getSubClasses() {return subClasses;};
+       ObjectClassSet* getSubClasses() {return subClasses;}
 
        // Security Methods
        void checkFederateAccess(FederateHandle, const std::string&)
        throw (SecurityError);
 
-       SecurityLevelID getSecurityLevelId() const { return securityLevelId ; };
+       SecurityLevelID getSecurityLevelId() const { return securityLevelId ; }
 
        void setSecurityLevelId(SecurityLevelID newLevelID) throw 
(SecurityError);
 
@@ -307,7 +307,7 @@
        bool sendDiscoverMessages(FederateHandle, ObjectClassHandle);
 
        // Attributes
-       ObjectClassHandle handle ;
+       const ObjectClassHandle handle ;
        FederateHandle maxSubscriberHandle ; //! greatest subscriber handle
        /**
         * The security level ID attached to this object class.
@@ -342,4 +342,4 @@
 
 #endif // _CERTI_OBJECT_CLASS_HH
 
-// $Id: ObjectClass.hh,v 3.50 2009/11/23 07:34:28 erk Exp $
+// $Id: ObjectClass.hh,v 3.51 2009/11/24 16:39:20 erk Exp $

Index: Subscribable.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/Subscribable.hh,v
retrieving revision 3.8
retrieving revision 3.9
diff -u -b -r3.8 -r3.9
--- Subscribable.hh     19 Nov 2009 18:15:31 -0000      3.8
+++ Subscribable.hh     24 Nov 2009 16:39:20 -0000      3.9
@@ -17,7 +17,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: Subscribable.hh,v 3.8 2009/11/19 18:15:31 erk Exp $
+// $Id: Subscribable.hh,v 3.9 2009/11/24 16:39:20 erk Exp $
 // ----------------------------------------------------------------------------
 
 #ifndef CERTI_SUBSCRIBABLE_HH
@@ -61,6 +61,7 @@
 class CERTI_EXPORT Subscribable : public Named
 {
 public:
+    Subscribable(const std::string& name);
     virtual ~Subscribable();
 
     virtual void checkFederateAccess(FederateHandle, const std::string&) const 
= 0 ;
@@ -85,4 +86,4 @@
 
 #endif // CERTI_SUBSCRIBABLE_HH
 
-// $Id: Subscribable.hh,v 3.8 2009/11/19 18:15:31 erk Exp $
+// $Id: Subscribable.hh,v 3.9 2009/11/24 16:39:20 erk Exp $

Index: RootObject.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/RootObject.cc,v
retrieving revision 3.47
retrieving revision 3.48
diff -u -b -r3.47 -r3.48
--- RootObject.cc       23 Nov 2009 07:34:28 -0000      3.47
+++ RootObject.cc       24 Nov 2009 16:39:20 -0000      3.48
@@ -19,7 +19,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 // USA
 //
-// $Id: RootObject.cc,v 3.47 2009/11/23 07:34:28 erk Exp $
+// $Id: RootObject.cc,v 3.48 2009/11/24 16:39:20 erk Exp $
 // ----------------------------------------------------------------------------
 
 #include "Object.hh"
@@ -521,12 +521,15 @@
                 for (uint32_t j = 0; j < attributeCount; ++j) {
                         const NM_FOM_Attribute& ma = moc.getAttribute(j);
 
-                        OrderType order = ma.getOrder();
-                        TransportType transport = ma.getTransport();
-                        ObjectClassAttribute *attribute = new 
ObjectClassAttribute(ma.getName(), transport, order);
-                        current->addAttribute(attribute);
+                        // OrderType order = ma.getOrder();
+                        // TransportType transport = ma.getTransport();
+                        ObjectClassAttribute *attribute = new 
ObjectClassAttribute(ma.getName(), ma.getHandle());
+                        // attribute->setTransport(ma.getTransport());
+                        attribute->transport = ma.getTransport();
+                        // attribute->setOrder(ma.getOrder());
+                        attribute->order = ma.getOrder();
                         attribute->setSpace(ma.getSpaceHandle());
-                        assert(attribute->getHandle() == ma.getHandle());
+                        current->addAttribute(attribute);
                 }
         }
 
@@ -549,9 +552,7 @@
                 for (uint32_t j = 0; j < parameterCount; ++j) {
                         const NM_FOM_Parameter& mp = mic.getParameter(j);
 
-                        Parameter *parameter = new Parameter;
-                        parameter->setName(mp.getName());
-                        parameter->setHandle(mp.getHandle());
+                        Parameter *parameter = new Parameter(mp.getName(), 
mp.getHandle());
                         current->addParameter(parameter);
                 }
         }
@@ -559,4 +560,4 @@
 
 } // namespace certi
 
-// $Id: RootObject.cc,v 3.47 2009/11/23 07:34:28 erk Exp $
+// $Id: RootObject.cc,v 3.48 2009/11/24 16:39:20 erk Exp $




reply via email to

[Prev in Thread] Current Thread [Next in Thread]