You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ed...@apache.org on 2006/06/14 15:24:59 UTC

svn commit: r414241 - in /incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo: DataObjectImpl.cpp DataObjectImpl.h DataObjectListImpl.cpp RefCountingObject.cpp

Author: edslattery
Date: Wed Jun 14 06:24:59 2006
New Revision: 414241

URL: http://svn.apache.org/viewvc?rev=414241&view=rev
Log:
fix for problem when copying data objects from one factory to another

Modified:
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectImpl.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectImpl.h
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectListImpl.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingObject.cpp

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectImpl.cpp?rev=414241&r1=414240&r2=414241&view=diff
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectImpl.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectImpl.cpp Wed Jun 14 06:24:59 2006
@@ -2583,13 +2583,16 @@
 
     void DataObjectImpl::transferChildren(DataObject* d, DataFactory* f)
     {
+        bool isData = false;
         PropertyList pl = d->getInstanceProperties();
         for (int i=0;i<pl.size();i++)
         {
+            // even primitives need their DF fixed up
             if (pl[i].getType().isDataType())
             {
-                 continue;
+                 isData = true;
             }
+
             if (!d->isSet(pl[i]) || d->isNull(pl[i]))
             {
                 continue;
@@ -2603,7 +2606,7 @@
                     DataObject* d2 = dl[j];
                     if (d2) {
                         ((DataObjectImpl*)d2)->setDataFactory(f);
-                        transferChildren(d2,f);
+                        if (!isData)transferChildren(d2,f);
                     }
                 }
             }
@@ -2613,7 +2616,7 @@
                 if (d3)
                 { 
                     ((DataObjectImpl*)d3)->setDataFactory(f);
-                    transferChildren(d3,f);
+                    if (!isData)transferChildren(d3,f);
                 }
             }
         }
@@ -3492,17 +3495,17 @@
 
     const Type& DataObjectImpl::getType()
     {
-          return ObjectType;
+          return (const Type&)(*ObjectType);
     }
 
     const Type::Types DataObjectImpl::getTypeEnum()
     {
-           return ObjectType.getTypeEnum();
+           return ObjectType->getTypeEnum();
     }
 
     const TypeImpl& DataObjectImpl::getTypeImpl()
     {
-          return ObjectType;
+          return (const TypeImpl&)*ObjectType;
     }
 
 
@@ -3581,6 +3584,8 @@
 
     void DataObjectImpl::setDataFactory(DataFactory* df)
     {
+        ObjectType = (TypeImpl*)&(df->getType(ObjectType->getURI(),
+                        ObjectType->getName()));
         factory = df;
     }
 
@@ -3781,8 +3786,9 @@
     }
 
 
-    DataObjectImpl::DataObjectImpl(const TypeImpl& t) : ObjectType(t)
+    DataObjectImpl::DataObjectImpl(const TypeImpl& t) 
     {
+        ObjectType = (TypeImpl*)&t;
         container = 0;
         value = 0; /* Will be initialized when used */
         valuelength = 0;
@@ -3812,7 +3818,7 @@
 
 
 
-    DataObjectImpl::DataObjectImpl(DataFactory* df, const Type& t) : ObjectType((TypeImpl&)t),
+    DataObjectImpl::DataObjectImpl(DataFactory* df, const Type& t) : ObjectType((TypeImpl*)&t),
         factory(df)
     {
         container = 0;
@@ -3823,11 +3829,11 @@
         isnull = false;
 
         // open type support
-        openBase = ObjectType.getPropertiesSize() ;
+        openBase = ObjectType->getPropertiesSize() ;
 
         userdata = (void*)0xFFFFFFFF;
 
-        if (ObjectType.isChangeSummaryType())
+        if (ObjectType->isChangeSummaryType())
         {
             changesummaryobject = 0;
             localCS = new ChangeSummaryImpl();

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectImpl.h?rev=414241&r1=414240&r2=414241&view=diff
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectImpl.h (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectImpl.h Wed Jun 14 06:24:59 2006
@@ -598,7 +598,7 @@
 
     PropertyValueMap PropertyValues;
     
-    const TypeImpl& ObjectType;
+    TypeImpl* ObjectType;
 
     DataObjectListImpl* listValue;
     

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectListImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectListImpl.cpp?rev=414241&r1=414240&r2=414241&view=diff
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectListImpl.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectListImpl.cpp Wed Jun 14 06:24:59 2006
@@ -312,7 +312,7 @@
             return;
         }
 
-        std::string msg("Insertion into list fromm incompatible factory:");
+        std::string msg("Insertion into list from incompatible factory:");
         
         const Type& t = d->getType();
         msg += t.getURI();

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingObject.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingObject.cpp?rev=414241&r1=414240&r2=414241&view=diff
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingObject.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingObject.cpp Wed Jun 14 06:24:59 2006
@@ -60,7 +60,7 @@
 {
     
     ++refCount;
-    LOGINFO_2(HIGHVOLUME,"RCO:ADDREF:%p:%ld",this,refCount);
+     LOGINFO_2(HIGHVOLUME,"RCO:ADDREF:%p:%ld",this,refCount);
 }
 
 void RefCountingObject::releaseRef()



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org