You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ro...@apache.org on 2007/08/08 19:21:19 UTC

svn commit: r563950 [1/2] - in /incubator/tuscany/cpp: sca/runtime/core/src/tuscany/sca/util/ sca/runtime/extensions/python/src/tuscany/sca/python/ sca/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/ sca/runtime/extensions/rest/service/htt...

Author: robbinspg
Date: Wed Aug  8 10:21:09 2007
New Revision: 563950

URL: http://svn.apache.org/viewvc?view=rev&rev=563950
Log:
TUSCANY-1376 Apply Michael Yoder's patch

Modified:
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/SDOUtils.cpp
    incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp
    incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp
    incubator/tuscany/cpp/sca/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.cpp
    incubator/tuscany/cpp/sca/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.h
    incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp
    incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp
    incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp
    incubator/tuscany/cpp/sdo/runtime/core/sdo_axiom/sdo_axiom.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummary.h
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummaryBuilder.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummaryBuilder.h
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummaryImpl.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/CopyHelper.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/CopyHelper.h
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObject.h
    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/DataObjectInstance.h
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectListImpl.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectListImpl.h
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/PropertyImpl.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingPointer.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingPointer.h
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSAX2Parser.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOSAX2Parser.h
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDOXMLWriter.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SequenceImpl.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SequenceImpl.h
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/Setting.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/XMLHelperImpl.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/XMLHelperImpl.h
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/XSDHelperImpl.cpp
    incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/XSDHelperImpl.h
    incubator/tuscany/cpp/sdo/runtime/core/test/main.cpp
    incubator/tuscany/cpp/sdo/runtime/core/test/sdotest.cpp
    incubator/tuscany/cpp/sdo/runtime/core/test/sdotest.h
    incubator/tuscany/cpp/sdo/runtime/core/test/utils.cpp

Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/SDOUtils.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/SDOUtils.cpp?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/SDOUtils.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/util/SDOUtils.cpp Wed Aug  8 10:21:09 2007
@@ -111,7 +111,7 @@
                 const Type& type = dataObject->getType();
                 if (type.isSequencedType())
                 {
-                    Sequence* sequence = dataObject->getSequence();
+                    SequencePtr sequence = dataObject->getSequence();
                     int size = sequence->size();
                     for (int i = 0; i < size; i++)
                     {

Modified: incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp Wed Aug  8 10:21:09 2007
@@ -388,7 +388,7 @@
 
                                         // Convert a DataObject to a xml.etree.ElementTree Element object
                                         Composite* composite = component->getComposite();                                    
-                                        XMLHelper* xmlHelper = composite->getXMLHelper();
+                                        XMLHelperPtr xmlHelper = composite->getXMLHelper();
                                         char* str = xmlHelper->save(
                                             dob,
                                             dob->getType().getURI(),
@@ -819,7 +819,7 @@
                                     loginfo("Converting Python ElementTree to SDO DataObject: %s", data);
 
                                     Composite* composite = component->getComposite();                                   
-                                    XMLHelper* xmlHelper = composite->getXMLHelper();
+                                    XMLHelperPtr xmlHelper = composite->getXMLHelper();
                                     XMLDocumentPtr xmlDoc = xmlHelper->load(data);
                                     DataObjectPtr* dataObjectData = new DataObjectPtr;
                                     if (xmlDoc != NULL)

Modified: incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp Wed Aug  8 10:21:09 2007
@@ -333,7 +333,7 @@
                 loginfo("Converting Python ElementTree to SDO DataObject: %s", data);
 
                 Composite* composite = component->getComposite();                                   
-                XMLHelper* xmlHelper = composite->getXMLHelper();
+                XMLHelperPtr xmlHelper = composite->getXMLHelper();
                 XMLDocumentPtr xmlDoc = xmlHelper->load(data);
 
                 DataObjectPtr* dataObjectData = new DataObjectPtr;
@@ -483,7 +483,7 @@
 
                     // Convert a DataObject to a xml.etree.ElementTree Element object
                     Composite* composite = component->getComposite();                                    
-                    XMLHelper* xmlHelper = composite->getXMLHelper();
+                    XMLHelperPtr xmlHelper = composite->getXMLHelper();
                     char* str = xmlHelper->save(
                         dob,
                         dob->getType().getURI(),

Modified: incubator/tuscany/cpp/sca/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.cpp?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.cpp Wed Aug  8 10:21:09 2007
@@ -211,7 +211,7 @@
                 Service* service = getService();
                 CompositeReference* compositeReference = (CompositeReference*)service->getComponent();
                 Composite* composite = compositeReference->getComposite();
-                XMLHelper* xmlHelper = composite->getXMLHelper();
+                XMLHelperPtr xmlHelper = composite->getXMLHelper();
 
                 // Get the REST binding
                 RESTServiceBinding* binding = (RESTServiceBinding *)service->getBinding();
@@ -927,7 +927,7 @@
             }
             
             
-            void RESTServiceWrapper::writeParameter(XMLHelper* xmlHelper, ostringstream& os, const Operation::Parameter& parm)
+            void RESTServiceWrapper::writeParameter(XMLHelperPtr xmlHelper, ostringstream& os, const Operation::Parameter& parm)
             {
                 logentry();
 
@@ -1007,7 +1007,7 @@
                 }
             }
 
-             void RESTServiceWrapper::setReturn(XMLHelper* xmlHelper, string& payload,
+             void RESTServiceWrapper::setReturn(XMLHelperPtr xmlHelper, string& payload,
                  Operation& operation)
              {  
                 logentry();

Modified: incubator/tuscany/cpp/sca/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.h?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.h (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/rest/reference/curl/src/tuscany/sca/rest/RESTServiceWrapper.h Wed Aug  8 10:21:09 2007
@@ -75,12 +75,12 @@
                 /**
                  * Write a parameter into a URL
                  */
-                void writeParameter(commonj::sdo::XMLHelper* xmlHelper, std::ostringstream& os, const Operation::Parameter& parm);
+                void writeParameter(commonj::sdo::XMLHelperPtr xmlHelper, std::ostringstream& os, const Operation::Parameter& parm);
                 
                 /**
                  * Set the return value on the given operation
                  */
-                void setReturn(commonj::sdo::XMLHelper* xmlHelper, std::string& payload, Operation& operation);
+                void setReturn(commonj::sdo::XMLHelperPtr xmlHelper, std::string& payload, Operation& operation);
                 
             };
         } // End namespace rest

Modified: incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/rest/service/httpd/src/tuscany/sca/rest/ModREST.cpp Wed Aug  8 10:21:09 2007
@@ -102,7 +102,7 @@
             DataObjectPtr createPayload(DataFactoryPtr dataFactory,
                 Operation& operation, const WSDLOperation& wsdlOperation);
 
-            void addPart(XMLHelper* xmlHelper, string& payload, Operation& operation);
+            void addPart(XMLHelperPtr xmlHelper, string& payload, Operation& operation);
              
             int logHeaders(void* request, const char* key, const char* value);
 
@@ -367,7 +367,7 @@
                         throwException(SystemConfigurationException,
                             "Failed to initialize SCA runtime, could not get DataFactory");
                     }
-                    XMLHelper* xmlHelper = composite->getXMLHelper();
+                    XMLHelperPtr xmlHelper = composite->getXMLHelper();
         
                     // Get the REST binding
                     Reference* reference = compositeService->getReference();
@@ -1195,7 +1195,7 @@
                 return inputDataObject;
              }
 
-             void addPart(XMLHelper* xmlHelper, string& payload, Operation& operation)
+             void addPart(XMLHelperPtr xmlHelper, string& payload, Operation& operation)
              {  
                 logentry();
                 

Modified: incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp Wed Aug  8 10:21:09 2007
@@ -231,7 +231,7 @@
                                 loginfo("Converting Ruby Rexml document to SDO DataObject: %s", str.c_str());
                                                                 
                                 Composite* composite = getReference()->getComponent()->getComposite();                                   
-                                commonj::sdo::XMLHelper* xmlHelper = composite->getXMLHelper();
+                                commonj::sdo::XMLHelperPtr xmlHelper = composite->getXMLHelper();
                                 commonj::sdo::XMLDocumentPtr xmlDoc = xmlHelper->load(str.c_str());
                                 
                                 DataObjectPtr dob;
@@ -342,7 +342,7 @@
 
                             // Convert a DataObject to a REXML Document object
                             Composite* composite = component->getComposite();                                   
-                            commonj::sdo::XMLHelper* xmlHelper = composite->getXMLHelper();
+                            commonj::sdo::XMLHelperPtr xmlHelper = composite->getXMLHelper();
                             char* str = xmlHelper->save(
                                 dob,
                                 dob->getType().getURI(),

Modified: incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp Wed Aug  8 10:21:09 2007
@@ -254,7 +254,7 @@
 
                                     // Convert a DataObject to a REXML Document object
                                     Composite* composite = component->getComposite();                                    
-                                    commonj::sdo::XMLHelper* xmlHelper = composite->getXMLHelper();
+                                    commonj::sdo::XMLHelperPtr xmlHelper = composite->getXMLHelper();
                                     char* str = xmlHelper->save(
                                         dob,
                                         dob->getType().getURI(),
@@ -743,7 +743,7 @@
                                 loginfo("Converting Ruby Rexml document to SDO DataObject: %s", str.c_str());
                                         
                                 Composite* composite = component->getComposite();                                   
-                                commonj::sdo::XMLHelper* xmlHelper = composite->getXMLHelper();
+                                commonj::sdo::XMLHelperPtr xmlHelper = composite->getXMLHelper();
                                 commonj::sdo::XMLDocumentPtr xmlDoc = xmlHelper->load(str.c_str());
                                
                                 DataObjectPtr* dataObjectData = new DataObjectPtr;

Modified: incubator/tuscany/cpp/sdo/runtime/core/sdo_axiom/sdo_axiom.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/sdo_axiom/sdo_axiom.cpp?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/sdo_axiom/sdo_axiom.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/sdo_axiom/sdo_axiom.cpp Wed Aug  8 10:21:09 2007
@@ -105,7 +105,7 @@
             const char* targetNamespaceURI, const char* elementName)
         {
 
-            DataFactory* df = dob->getDataFactory();
+            DataFactoryPtr df = dob->getDataFactory();
             XSDHelperPtr xs = HelperProvider::getXSDHelper(df);
             XMLHelperPtr xm = HelperProvider::getXMLHelper(df);
             if (!the_env)

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummary.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummary.h?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummary.h (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummary.h Wed Aug  8 10:21:09 2007
@@ -38,7 +38,7 @@
      * back-end storage when required.
       */
  
-    class ChangeSummary 
+    class ChangeSummary : public RefCountingObject
     {
       public:
 

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummaryBuilder.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummaryBuilder.cpp?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummaryBuilder.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummaryBuilder.cpp Wed Aug  8 10:21:09 2007
@@ -62,7 +62,7 @@
 // Deletion handling
 // ========================================================================
 
-        void ChangeSummaryBuilder::populateDeletion(ChangeSummaryImpl* csi,DataObjectPtr dob,
+        void ChangeSummaryBuilder::populateDeletion(ChangeSummaryImplPtr csi,DataObjectPtr dob,
                                             int currentIndex)
         {
             LOGENTRY(INFO,"CSBuilder populateDeletion");
@@ -135,7 +135,7 @@
 // ========================================================================
 
         void ChangeSummaryBuilder::handleDeletion(
-                              ChangeSummaryImpl* csi, 
+                              ChangeSummaryImplPtr csi, 
                               int currentIndex, 
                               DataObjectPtr cont,
                               SDOXMLString path,
@@ -167,7 +167,7 @@
 // ========================================================================
 
         void ChangeSummaryBuilder::handleDeletion(
-                              ChangeSummaryImpl* csi, 
+                              ChangeSummaryImplPtr csi, 
                               int currentIndex, 
                               SDOXMLString path)
         {
@@ -338,15 +338,14 @@
                     LOGEXIT(INFO,"CSBuilder:buildChangeSummary Exit1");
                     return;
                 }
-                ChangeSummary* cs = changeSummaryDO->getChangeSummary();
-                if (cs == 0)
+                ChangeSummaryImplPtr csi = 
+                    staticCast<ChangeSummaryImplPtr>(changeSummaryDO->getChangeSummary());
+                if (!csi)
                 {
                     // there is no change summary - this shouldnt happen
                     LOGEXIT(INFO,"CSBuilder:buildChangeSummary Exit2");
                     return;
                 }
-
-                ChangeSummaryImpl* csi = (ChangeSummaryImpl*)cs;
 
                 // add the creations and deletions in order
 

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummaryBuilder.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummaryBuilder.h?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummaryBuilder.h (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummaryBuilder.h Wed Aug  8 10:21:09 2007
@@ -254,17 +254,17 @@
             virtual void buildChangeSummary(
                  DataObjectPtr changeSummaryDO);
 
-            virtual void populateDeletion(ChangeSummaryImpl* csi, DataObjectPtr dob,
+            virtual void populateDeletion(ChangeSummaryImplPtr csi, DataObjectPtr dob,
                                             int index);
 
             virtual void handleDeletion(
-                              ChangeSummaryImpl* csi, 
+                              ChangeSummaryImplPtr csi, 
                               int currentIndex, 
                               DataObjectPtr cont,
                               SDOXMLString path,
                               SDOXMLString prop);
 
-            virtual void handleDeletion(ChangeSummaryImpl* csi,
+            virtual void handleDeletion(ChangeSummaryImplPtr csi,
                 int index,
                 SDOXMLString path);
 

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummaryImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummaryImpl.cpp?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummaryImpl.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/ChangeSummaryImpl.cpp Wed Aug  8 10:21:09 2007
@@ -64,7 +64,7 @@
     {
         DELETELOG_MAP::iterator deleteLogIter;
 
-        DataObject* ob = dob;
+        DataObject* ob = getRawPointer(dob);
         deleteLogIter = deletedMap.find((DataObjectImpl*)ob);
 
         if (deleteLogIter != deletedMap.end())
@@ -241,13 +241,13 @@
                         DataObjectList& dl = ob->getList(pl[i]);
                         for (int j = dl.size() - 1; j>=0; j--)
                         {
-                            dob = dl[j];
+                            dob = getRawPointer(dl[j]);
                             if (dob)logDeletion((DataObjectImpl*)dob,ob,pl[i],
                                 dob->objectToXPath(), true);
                         }
                     }
                     else {
-                        dob = ob->getDataObject(pl[i]);
+                        dob = getRawPointer(ob->getDataObject(pl[i]));
                         if (dob)logDeletion((DataObjectImpl*)(dob),ob,pl[i],
                             dob->objectToXPath(), true);
                     }
@@ -289,7 +289,7 @@
                         sl.append(new Setting(true,false,value,len,pl[i],j));
                     }
                     else {
-                        value = (void*)dol[j];
+                        value = (void*)getRawPointer(dol[j]);
                         sl.append(new Setting(true,false,value,0,pl[i],j));
                     }
                 }
@@ -391,14 +391,14 @@
                         DataObjectList& dol = ob->getList(thisprop);
                         for (unsigned int ds = 0; ds < dol.size(); ds++) 
                         {
-                            dp = dol[ds];
+                            dp = getRawPointer(dol[ds]);
                             if (!dp) continue; 
                             logCreation((DataObjectImpl*)dp,ob,thisprop);
                         }
                     }
                     else 
                     {
-                        dp = ob->getDataObject(thisprop); 
+                        dp = getRawPointer(ob->getDataObject(thisprop)); 
                         if (dp)
                         {  
                             logCreation((DataObjectImpl*)dp,ob,thisprop);
@@ -584,7 +584,7 @@
                 }
                 else
                 {
-                    *value = (void*)ob->getDataObject(prop);
+                    *value = (void*)getRawPointer(ob->getDataObject(prop));
                 }
                 break;
             default:
@@ -839,7 +839,7 @@
             }
             for (unsigned int i=0;i< dol.size(); i++)
             {
-                DataObject* dob = dol[i];
+                DataObject* dob = getRawPointer(dol[i]);
                 if (prop.getType().isDataType()) {
                     setManyPropValue(&value, &len, (DataObjectImpl*)ob,
                         (DataObjectImpl*)dob, prop);
@@ -1059,7 +1059,7 @@
     bool ChangeSummaryImpl::isCreated(DataObjectPtr dol)
     {
         CREATELOG_MAP::iterator createLogIter;
-        DataObject* dob = dol;
+        DataObject* dob = getRawPointer(dol);
         createLogIter = createdMap.find((DataObjectImpl*)dob);
         
         if (createLogIter != createdMap.end())
@@ -1070,7 +1070,7 @@
     bool ChangeSummaryImpl::isDeleted(DataObjectPtr dol)
     {
         DELETELOG_MAP::iterator deleteLogIter;
-        DataObject* dob = dol;
+        DataObject* dob = getRawPointer(dol);
         deleteLogIter = deletedMap.find((DataObjectImpl*)dob);
         
         if (deleteLogIter != deletedMap.end())
@@ -1081,7 +1081,7 @@
     bool ChangeSummaryImpl::isModified(DataObjectPtr dol)
     {
         CHANGELOG_MAP::iterator changeLogIter;
-        DataObject* dob = dol;
+        DataObject* dob = getRawPointer(dol);
         changeLogIter = changedMap.find((DataObjectImpl*)dob);
         
         if (changeLogIter != changedMap.end())
@@ -1095,7 +1095,7 @@
     {
         CHANGELOG_MAP::iterator changeLogIter;
         DELETELOG_MAP::iterator deleteLogIter;
-        DataObject* dob = dol;
+        DataObject* dob = getRawPointer(dol);
         // start with the deleted map...
         deleteLogIter = deletedMap.find((DataObjectImpl*)dob);
         if (deleteLogIter != deletedMap.end()){
@@ -1114,7 +1114,7 @@
     const char* ChangeSummaryImpl::getOldXpath(RefCountingPointer<commonj::sdo::DataObject> dol)
     {
         DELETELOG_MAP::iterator deleteLogIter;
-        DataObject* dob = dol;
+        DataObject* dob = getRawPointer(dol);
         deleteLogIter = deletedMap.find((DataObjectImpl*)dob);
         if (deleteLogIter != deletedMap.end()){
             return ((deleteLogIter->second).getOldXpath());
@@ -1127,7 +1127,7 @@
     { 
         DELETELOG_MAP::iterator deleteLogIter;
         CHANGELOG_MAP::iterator changeLogIter;
-        DataObject* dob = dol;
+        DataObject* dob = getRawPointer(dol);
 
         deleteLogIter = deletedMap.find((DataObjectImpl*)dob);
         if (deleteLogIter != deletedMap.end())
@@ -1160,7 +1160,7 @@
     DataObjectPtr ChangeSummaryImpl::getOldContainer(DataObjectPtr dol)
     {
         CHANGELOG_MAP::iterator changeLogIter;
-        DataObject* dob = dol;
+        DataObject* dob = getRawPointer(dol);
         changeLogIter = changedMap.find((DataObjectImpl*)dob);
        
         if (changeLogIter != changedMap.end())
@@ -1173,7 +1173,7 @@
     const Property& ChangeSummaryImpl::getOldContainmentProperty(DataObjectPtr dol)
       {
         CHANGELOG_MAP::iterator changeLogIter;
-        DataObject* dob = dol;
+        DataObject* dob = getRawPointer(dol);
         changeLogIter = changedMap.find((DataObjectImpl*)dob);
        
         if (changeLogIter == changedMap.end())
@@ -1196,8 +1196,8 @@
         DataObjectPtr    dob, DataObjectPtr cont)
     {
         LOGINFO(INFO,"ChangeSummary: Appending to creations list");
-        DataObject* pdob = (DataObject*)dob;
-        DataObject* pcont = (DataObject*)cont;
+        DataObject* pdob = getRawPointer(dob);
+        DataObject* pcont = getRawPointer(cont);
         logCreation((DataObjectImpl*)pdob,(DataObjectImpl*)pcont,p);
         return;
     }
@@ -1210,8 +1210,8 @@
 
         LOGINFO_1(INFO,"ChangeSummary:Appending to deletions list %s",oldpath);
 
-        DataObject* pdob = (DataObject*)dob;
-        DataObject* pcont = (DataObject*)cont;
+        DataObject* pdob = getRawPointer(dob);
+        DataObject* pcont = getRawPointer(cont);
         logDeletion((DataObjectImpl*)pdob,(DataObjectImpl*)pcont,p,
             oldpath, false);
         return;
@@ -1319,7 +1319,7 @@
 
         LOGINFO(INFO,"ChangeSummary Appending to changes list");
 
-        DataObject* pdob = (DataObject*)dob;
+        DataObject* pdob = getRawPointer(dob);
         
 
         changeLogIter = changedMap.find((DataObjectImpl*)pdob);
@@ -1366,7 +1366,7 @@
 
         LOGINFO(INFO,"ChangeSummary Appending to changes list (2)");
 
-        DataObject* pdob = (DataObject*)dob;
+        DataObject* pdob = getRawPointer(dob);
 
         changeLogIter = changedMap.find((DataObjectImpl*)pdob);
         if (changeLogIter == changedMap.end())
@@ -1394,7 +1394,7 @@
         // against existing settings
 
 
-        slist.append(new Setting(true,false,(void*)indob,0,p,index));
+        slist.append(new Setting(true,false,(void*)getRawPointer(indob),0,p,index));
     
      }
 
@@ -1439,7 +1439,7 @@
     {
         if (seq) 
         {
-            theSequence = new SequenceImpl((SequenceImpl*)seq);
+            theSequence = new SequenceImpl((SequenceImpl*)getRawPointer(seq));
         }
         else 
         {
@@ -1451,8 +1451,12 @@
         theOldContainmentProperty(cin.theOldContainmentProperty),
         theType(cin.theType)
     {
-        if (cin.theSequence) theSequence = new SequenceImpl((SequenceImpl*)cin.theSequence);
-        else theSequence = 0;
+        if (cin.theSequence) {
+            theSequence = new SequenceImpl((SequenceImpl*)getRawPointer(cin.theSequence));
+        }
+        else {
+          theSequence = 0;
+        }
         theOldContainer = cin.theOldContainer;
         theSettings = cin.theSettings;
 
@@ -1460,7 +1464,6 @@
 
     changeLogItem::~changeLogItem()
     {
-        if (theSequence) delete theSequence;
     }
 
     DataObjectImpl* changeLogItem::getOldContainer()
@@ -1499,7 +1502,7 @@
     {
         if (seq) 
         {
-            theSequence = new SequenceImpl((SequenceImpl*)seq);
+            theSequence = new SequenceImpl((SequenceImpl*)getRawPointer(seq));
         }
         else 
         {
@@ -1530,8 +1533,12 @@
         theOldContainmentProperty(cin.theOldContainmentProperty),
         theType(cin.theType), theActualObject(cin.theActualObject)
     {
-        if (cin.theSequence) theSequence = new SequenceImpl((SequenceImpl*)cin.theSequence);
-        else theSequence = 0;
+        if (cin.theSequence) {
+            theSequence = new SequenceImpl((SequenceImpl*)getRawPointer(cin.theSequence));
+        }
+        else {
+            theSequence = 0;
+        }
         theOldContainer = cin.theOldContainer;
         theSettings = cin.theSettings;
         if (cin.theOldXpath != 0)
@@ -1548,7 +1555,6 @@
     deleteLogItem::~deleteLogItem()
     {
         theActualObject = 0;
-        if (theSequence) delete theSequence;
         if (theOldXpath != 0) 
         {
             delete[] theOldXpath;
@@ -1577,9 +1583,8 @@
 
     void deleteLogItem::setSequence(SequencePtr s)
     {
-        if (theSequence) delete theSequence;
         if (s) {
-            theSequence = new SequenceImpl((SequenceImpl*)s);
+            theSequence = new SequenceImpl((SequenceImpl*)getRawPointer(s));
         }
         else {
             theSequence = 0;

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/CopyHelper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/CopyHelper.cpp?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/CopyHelper.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/CopyHelper.cpp Wed Aug  8 10:21:09 2007
@@ -206,7 +206,7 @@
 
 
 
-    void CopyHelper::transfersequenceitem(Sequence *to, Sequence *from, const Property& p, int index)
+    void CopyHelper::transfersequenceitem(SequencePtr to, SequencePtr from, const Property& p, int index)
     {
         switch (p.getTypeEnum())
         {
@@ -308,7 +308,7 @@
                                            bool fullCopy)
     {
 
-        DataObject* theob = dataObject;
+        DataObject* theob = getRawPointer(dataObject);
         if (!theob) return 0;
 
         DataFactoryPtr fac = ((DataObjectImpl*)theob)->getDataFactory();
@@ -320,10 +320,10 @@
 
         if ( dataObject->getType().isSequencedType() )
         {
-            Sequence* fromSequence = dataObject->getSequence();
+            SequencePtr fromSequence = dataObject->getSequence();
             int sequence_length = fromSequence->size();
             
-            Sequence* toSequence = newob->getSequence();
+            SequencePtr toSequence = newob->getSequence();
             
             for (int i=0;i < sequence_length; i++)
             {
@@ -484,10 +484,10 @@
 
         if ( obj->getType().isSequencedType() )
         {
-            Sequence* fromSequence = obj->getSequence();
+            SequencePtr fromSequence = obj->getSequence();
             int sequence_length = fromSequence->size();
             
-            Sequence* toSequence = newObj->getSequence();
+            SequencePtr toSequence = newObj->getSequence();
             
             for (int i=0;i < sequence_length; i++)
             {

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/CopyHelper.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/CopyHelper.h?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/CopyHelper.h (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/CopyHelper.h Wed Aug  8 10:21:09 2007
@@ -62,7 +62,7 @@
     private:
     static void transferlist(DataObjectList& to, DataObjectList& from, Type::Types t);
     static void transferitem(DataObjectPtr   to, DataObjectPtr   from, const Property& p);
-    static void transfersequenceitem(Sequence *to, Sequence *from, const Property& p, int index);
+    static void transfersequenceitem(SequencePtr to, SequencePtr from, const Property& p, int index);
 
     static DataObjectPtr internalCopy(DataObjectPtr dataObject, bool fullCopy);
     static void resolveReferences(DataObjectPtr oldDO, DataObjectPtr newDO);

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObject.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObject.h?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObject.h (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObject.h Wed Aug  8 10:21:09 2007
@@ -132,7 +132,7 @@
      * return the data factory which created this object
      */
 
-    virtual SDO_API DataFactory* getDataFactory() = 0;
+    virtual SDO_API DataFactoryPtr getDataFactory() = 0;
 
     /**  getContainer get the containing object
      *

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?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectImpl.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectImpl.cpp Wed Aug  8 10:21:09 2007
@@ -349,13 +349,12 @@
                                          false,
                                          false,
                                          true));
-      DataFactory* df = factory;
-      ((DataFactoryImpl*)df)->addOpenProperty(PropertyImpl(getType(),
-                                                           propname,
-                                                           (TypeImpl&)t,
-                                                           false,
-                                                           false,
-                                                           true));
+      factory->addOpenProperty(PropertyImpl(getType(),
+                                            propname,
+                                            (TypeImpl&)t,
+                                            false,
+                                            false,
+                                            true));
 
       return getPropertyImpl(propname);
    }
@@ -388,8 +387,7 @@
             openProperties.begin();
         for (unsigned int i=0;i<point;i++)++it; /* there must be a better way */
 
-        DataFactory* df = factory;
-        ((DataFactoryImpl*)df)->removeOpenProperty((*it).getName());
+        factory->removeOpenProperty((*it).getName());
         
         openProperties.erase(it);
         
@@ -403,8 +401,7 @@
             openProperties.end(), PropertyImpl(getType(),propname,
             (TypeImpl&)t, true, false, true));
 
-        DataFactory* df = factory;
-        ((DataFactoryImpl*)df)->addOpenProperty(PropertyImpl(getType(),propname,
+        factory->addOpenProperty(PropertyImpl(getType(),propname,
             (TypeImpl&)t, true, false, true));
 
         return getPropertyImpl(propname);
@@ -607,9 +604,8 @@
       }
       // The property was not set yet...
       logChange(propertyIndex);
-      DataFactory* df = getDataFactory();
       DataObjectImpl* b =
-         new DataObjectImpl(df, getProperty(propertyIndex).getType());
+         new DataObjectImpl(factory, getProperty(propertyIndex).getType());
       b->setContainer(this);
       PropertyValues.push_back(rdo(propertyIndex,b));
       b->setNull();
@@ -756,12 +752,11 @@
         if (d == 0) {
             // There is no list yet, so we need to create an 
             // empty data object to hold the list
-            DataFactory* df = getDataFactory();
-            d = new DataObjectImpl(df, df->getType(Type::SDOTypeNamespaceURI,"DataObject"));
+            d = new DataObjectImpl(factory, factory->getType(Type::SDOTypeNamespaceURI,"DataObject"));
             PropertyValues.push_back(rdo(propIndex, d));
             d->setContainer(this);
             
-            DataObjectListImpl* list = new DataObjectListImpl(df,this,
+            DataObjectListImpl* list = new DataObjectListImpl(factory,this,
                 propIndex,p.getType().getURI(),p.getType().getName());
             d->setList(list); 
 
@@ -1049,7 +1044,7 @@
             
             if (val >=0 && val < list.size())
             {
-                DataObject* dob = list[val];
+                DataObject* dob = getRawPointer(list[val]);
                 *index = val;
                 return (DataObjectImpl*)dob;
             }
@@ -1202,7 +1197,7 @@
             
             if (ok == 1)
             {
-                DataObject* dob = list[li];
+                DataObject* dob = getRawPointer(list[li]);
                 *index = li;
                 return (DataObjectImpl*)dob;
             }
@@ -1358,8 +1353,7 @@
                         (*j).isReadOnly(),
                         (*j).isContainment()));
 
-                    DataFactory* df = factory;
-                    ((DataFactoryImpl*)df)->addOpenProperty(
+                    factory->addOpenProperty(
                         PropertyImpl(getType(),
                         (*j).getName(),
                         (TypeImpl&)*t,
@@ -1386,7 +1380,7 @@
    // When Type.isSequencedType() == false, null is returned.  
    // @return the <code>Sequence</code> or null.
 
-    SequenceImpl* DataObjectImpl::getSequenceImpl()
+    SequenceImplPtr DataObjectImpl::getSequenceImpl()
     {
 
          return sequence;
@@ -1394,7 +1388,7 @@
 
     SequencePtr DataObjectImpl::getSequence()
     {
-        return (SequencePtr)sequence;
+        return sequence;
     }
 
     SequencePtr DataObjectImpl::getSequence(const char* path)
@@ -1404,21 +1398,21 @@
 
     SequencePtr DataObjectImpl::getSequence(const SDOString& path)
     {
-        DataObject* d = (DataObject*)getDataObject(path);
+        DataObject* d = getRawPointer(getDataObject(path));
          if (d) return d->getSequence();
         return 0;
     }
 
     SequencePtr DataObjectImpl::getSequence(unsigned int propertyIndex)
     {
-        DataObject* d = (DataObject*)getDataObject(propertyIndex);
+        DataObject* d = getRawPointer(getDataObject(propertyIndex));
          if (d) return d->getSequence();
         return 0;
     }
 
     SequencePtr DataObjectImpl::getSequence(const Property& property)
     {
-        DataObject* d = (DataObject*)getDataObject(property);
+        DataObject* d = getRawPointer(getDataObject(property));
          if (d) return d->getSequence();
         return 0;
     }
@@ -1459,25 +1453,10 @@
 
     ChangeSummaryPtr DataObjectImpl::getChangeSummary()
     {
-        if (getType().isChangeSummaryType())
-        {
-            return (ChangeSummaryPtr)localCS;
-        }
-		
-        DataObjectImpl* dob = getContainerImpl();
-        while (dob != 0) 
-		{
-            if (dob->getType().isChangeSummaryType())
-            {
-				return (ChangeSummaryPtr)dob->getSummary();
-            }
-            dob = dob->getContainerImpl();
-        }
-        return 0;
+      return getChangeSummaryImpl();
     }
 
-
-    ChangeSummaryImpl* DataObjectImpl::getChangeSummaryImpl()
+    ChangeSummaryImplPtr DataObjectImpl::getChangeSummaryImpl()
     {
         if (getType().isChangeSummaryType())
         {
@@ -1489,14 +1468,14 @@
 		{
             if (dob->getType().isChangeSummaryType())
             {
-				return dob->getSummary();
+                return dob->getSummary();
             }
             dob = dob->getContainerImpl();
         }
         return 0;
     }
 
-    ChangeSummaryImpl* DataObjectImpl::getSummary()
+    ChangeSummaryImplPtr DataObjectImpl::getSummary()
     {
         return localCS;
     }
@@ -1612,7 +1591,7 @@
         unsigned int propertyIndex)
     {
         
-        DataObjectImpl* d = (DataObjectImpl*)(DataObject*)dob;
+        DataObjectImpl* d = (DataObjectImpl*)getRawPointer(dob);
 
         if (d->getDataFactory() == getDataFactory()) return;
 
@@ -1642,9 +1621,7 @@
         const Type& propType = prop.getType();
         if (propType.equals(objectType)) return;
 
-        DataFactory* df = (DataFactory*)factory;
-
-        const TypeImpl* ti = ((DataFactoryImpl*)df)->findTypeImpl
+        const TypeImpl* ti = factory->findTypeImpl
             (objectType.getURI(),objectType.getName());
         if (ti != 0)
         {
@@ -1719,7 +1696,7 @@
       {
          r1 = r1->getContainerImpl();
       }
-      DataObjectImpl* r2 = (DataObjectImpl*) (DataObject*) value;
+      DataObjectImpl* r2 = (DataObjectImpl*)getRawPointer(value);
       while (r2->getContainerImpl() != 0)
       {
          r2 = r2->getContainerImpl();
@@ -1764,16 +1741,15 @@
                ((*j).second)->logDeletion();
             }
             logChange(prop);
-            (*j).second = RefCountingPointer<DataObjectImpl>(0);
+            (*j).second = DataObjectImplPtr(0);
             // We have just changed the value of this property, therefore
             // if this is a sequenced data object, then we must update the
             // sequence so that the new setting appears at the end (and
             // the existing entry is removed).
             if ((getType().isSequencedType()) && updateSequence)
             {
-               SequenceImpl* mySequence = getSequenceImpl();
-               mySequence->removeAll(prop);
-               mySequence->push(prop, 0);
+               sequence->removeAll(prop);
+               sequence->push(prop, 0);
             }
 
             return;
@@ -1793,7 +1769,7 @@
       return;
    }
 
-   DataObject* dob = value;
+   DataObject* dob = getRawPointer(value);
    PropertyValueMap::iterator i;
    for (i = PropertyValues.begin(); i != PropertyValues.end(); ++i)
    {
@@ -1811,7 +1787,7 @@
          }
          logChange(prop);
 
-         (*i).second = RefCountingPointer<DataObjectImpl>((DataObjectImpl*) dob);
+         (*i).second = DataObjectImplPtr((DataObjectImpl*) dob);
 
          if (prop.isReference())
          {
@@ -1819,7 +1795,7 @@
          }
          else
          {
-            logCreation((*i).second, this, prop);
+            logCreation(getRawPointer((*i).second), this, prop);
          }
          return;
       }
@@ -1945,7 +1921,7 @@
             if ((*i).first == propertyIndex) {
                 if (prop.isMany())
                 {
-                    DataObjectImpl* dol = (*i).second;
+                    DataObjectImpl* dol = getRawPointer((*i).second);
                     if (dol != 0 && dol->getList().size() == 0)
                     {
                         return false;
@@ -2040,8 +2016,7 @@
 
         if (getType().isSequencedType())
         {
-            Sequence* sq = getSequence();
-            sq->removeAll(p);
+            sequence->removeAll(p);
         }
 
         for (i = PropertyValues.begin(); i != PropertyValues.end(); ++i)
@@ -2076,7 +2051,7 @@
                                 {
                                     if (p.getType().isDataObjectType())
                                     {
-                                        DataObject* dob = dl[0];
+                                        DataObject* dob = getRawPointer(dl[0]);
                                         ((DataObjectImpl*)dob)->logDeletion();
                                     }
                                     // the remove will record a change
@@ -2208,7 +2183,7 @@
       {
          if ((*i).first == propertyIndex)
          {
-            DataObject* dob = (*i).second;
+            DataObject* dob = getRawPointer((*i).second);
             if ((dob == 0) || ((DataObjectImpl*) dob)->isNull())
             {
                return 0;
@@ -2298,11 +2273,10 @@
             msg.c_str());
         }
 
-        DataFactory* df = getDataFactory();
         if (property.isMany()) {
             /* add to the list */
-            RefCountingPointer<DataObject> ptr = df->create(namespaceURI, typeName);
-            DataObject* dob = ptr;
+            RefCountingPointer<DataObject> ptr = factory->create(namespaceURI, typeName);
+            DataObject* dob = getRawPointer(ptr);
             ((DataObjectImpl*)dob)->setContainer(this);
             
             // log creation before adding to list - the change must record the old state 
@@ -2314,15 +2288,15 @@
             if ( theDO == 0) { /* No value set yet */
                 unsigned int ind = getPropertyIndex(property);
                 RefCountingPointer<DataObject> listptr = 
-                    df->create(Type::SDOTypeNamespaceURI,"DataObject");
+                    factory->create(Type::SDOTypeNamespaceURI,"DataObject");
 
-                DataObject* doptr = listptr;
+                DataObject* doptr = getRawPointer(listptr);
 
                 PropertyValues.push_back(rdo(ind, (DataObjectImpl*) doptr));
 
                 ((DataObjectImpl*)doptr)->setContainer(this);
 
-                DataObjectListImpl* list = new DataObjectListImpl(df,
+                DataObjectListImpl* list = new DataObjectListImpl(factory,
                     this, ind, namespaceURI,typeName);
 
                 ((DataObjectImpl*)doptr)->setList(list);
@@ -2355,7 +2329,7 @@
         else {
             unset(property);
             DataObjectImpl* ditem = 
-              new DataObjectImpl(df, df->getType(namespaceURI, typeName));
+              new DataObjectImpl(factory, factory->getType(namespaceURI, typeName));
             ditem->setContainer(this);
 
             // log both creation and change - creations no longer log
@@ -2368,8 +2342,7 @@
 
             if (getType().isSequencedType())
             {
-                SequenceImpl* sq = getSequenceImpl();
-                sq->push(property,0);
+                sequence->push(property,0);
             }
             return RefCountingPointer<DataObject>((DataObject*)ditem);
         }
@@ -2403,7 +2376,7 @@
                     }
                 }
             }
-            DataObjectImpl* tmp = (*i).second;
+            DataObjectImpl* tmp = getRawPointer((*i).second);
             if (tmp == indol) {
                 indol->logDeletion();
                 logChange(prop);
@@ -2564,16 +2537,16 @@
         return 0;
     }
 
-    DataFactory* DataObjectImpl::getDataFactory()
+    DataFactoryPtr DataObjectImpl::getDataFactory()
     {
         return factory;
     }
 
-    void DataObjectImpl::setDataFactory(DataFactory* df)
+    void DataObjectImpl::setDataFactory(DataFactoryImplPtr df)
     {
-        ObjectType = (TypeImpl*)&(df->getType(ObjectType->getURI(),
-                        ObjectType->getName()));
         factory = df;
+        ObjectType = (TypeImpl*)&(factory->getType(ObjectType->getURI(),
+                        ObjectType->getName()));
     }
 
     ///////////////////////////////////////////////////////////////////////////
@@ -3219,7 +3192,7 @@
    }
 
 
-   DataObjectImpl::DataObjectImpl(DataFactory* df, const Type& t) :
+   DataObjectImpl::DataObjectImpl(DataFactoryImplPtr df, const Type& t) :
       ObjectType((TypeImpl*) &t),
       factory(df),
       container(0),
@@ -3269,7 +3242,7 @@
 
 
         clearReferences();
-         PropertyValueMap::iterator i = PropertyValues.begin();
+        PropertyValueMap::iterator i = PropertyValues.begin();
         while (i != PropertyValues.end()) 
         {
             unsigned int pindx = (*i).first;
@@ -3294,21 +3267,6 @@
         {
            sdoValue = SDOValue::unsetSDOValue;
         }
-        
-        if (getType().isSequencedType()) 
-        {
-            if (sequence != 0) delete sequence;
-        }
-
-
-        if (getTypeImpl().isChangeSummaryType()    )
-        {
-            if (getChangeSummary() != 0) 
-            {
-                delete localCS; 
-                localCS = 0;
-            }
-        }
     }
 
     void DataObjectImpl::logCreation(DataObjectImpl* dol, DataObjectImpl* cont,
@@ -3784,21 +3742,19 @@
             // is not a multi-valued property.
             if ((getType().isSequencedType()) && updateSequence)
             {
-                   SequenceImpl* mySequence = getSequenceImpl();
-                   mySequence->removeAll(getProperty(propertyIndex));
-                   mySequence->push(getProperty(propertyIndex), 0);
+                   sequence->removeAll(getProperty(propertyIndex));
+                   sequence->push(getProperty(propertyIndex), 0);
             }
             return;
          }
       }
 
       // No existing property has the given index.
-      DataFactory* df = getDataFactory();
       // It is tempting to use the raw data type from the SDOValue object to
       // set the type of the created DataObjectImpl but we can't because the
       // SDOValue specifies a C++ type while we need an SDO type.
       DataObjectImpl* b =
-         new DataObjectImpl(df, df->getType(Type::SDOTypeNamespaceURI, dataType.c_str()));
+         new DataObjectImpl(factory, factory->getType(Type::SDOTypeNamespaceURI, dataType.c_str()));
       b->setContainer(this);
       logChange(propertyIndex);
       PropertyValues.push_back(rdo(propertyIndex, b));
@@ -3809,9 +3765,8 @@
       // is not a multi-valued property.
       if ((getType().isSequencedType()) && updateSequence)
       {
-         SequenceImpl* mySequence = getSequenceImpl();
-         mySequence->removeAll(getProperty(propertyIndex));
-         mySequence->push(getProperty(propertyIndex), 0);
+         sequence->removeAll(getProperty(propertyIndex));
+         sequence->push(getProperty(propertyIndex), 0);
       }
 
       return;

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?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectImpl.h (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectImpl.h Wed Aug  8 10:21:09 2007
@@ -108,7 +108,7 @@
 
     DataObjectImpl();
     DataObjectImpl(const TypeImpl& t);
-    DataObjectImpl(DataFactory* dataFactory, const Type& t);
+    DataObjectImpl(DataFactoryImplPtr dataFactory, const Type& t);
 
     // This one only needs the values, and the type/prop info. The rest
     // is not copied and would be unsafe to do so. This is used to
@@ -403,7 +403,7 @@
      * the specified path. See Sequence.
      */
 
-    virtual SequenceImpl* getSequenceImpl();
+    virtual SequenceImplPtr getSequenceImpl();
     virtual SequencePtr getSequence();
     virtual SequencePtr getSequence(const char* path);
     virtual SequencePtr getSequence(const SDOString& path);
@@ -483,7 +483,7 @@
     virtual SDO_API ChangeSummaryPtr getChangeSummary(const SDOString& path);
     virtual SDO_API ChangeSummaryPtr getChangeSummary(unsigned int propIndex);
     virtual SDO_API ChangeSummaryPtr getChangeSummary(const Property& prop);
-      virtual SDO_API ChangeSummaryPtr getChangeSummary();
+    virtual SDO_API ChangeSummaryPtr getChangeSummary();
 
 
     virtual bool getBoolean();
@@ -554,7 +554,7 @@
     // the Type system of this data object
     // 
       
-    SDO_API DataFactory* getDataFactory();
+    SDO_API DataFactoryPtr getDataFactory();
 
     // open type support
     virtual void   setInstancePropertyType(unsigned int index,
@@ -589,7 +589,7 @@
     virtual const PropertyImpl* defineList(const char* propname);
     virtual void  undefineProperty(unsigned int index);
     virtual const TypeImpl& getTypeImpl();
-    virtual void setDataFactory(DataFactory *df);
+    virtual void setDataFactory(DataFactoryImplPtr df);
 
     virtual std::ostream& printSelf(std::ostream &os);
 
@@ -663,7 +663,7 @@
     std::string asXPathBuffer;
 
     // The data object holds a counted reference to the data factory.
-    DataFactoryPtr factory;
+    DataFactoryImplPtr factory;
 
  
     // Support for open types
@@ -678,21 +678,14 @@
     // user supplied 32 bit value.
     void* userdata;
 
-    //
-    // The sequence, if this is a sequenced type - not
-    // reference counted by the data object
-    //
-    SequenceImpl* sequence;
+    SequenceImplPtr sequence;
 
     //
     // The change summary if this is a summarised type
-    // not reference counted by the data object - only by
-    // clients
-    //
 
-    ChangeSummaryImpl* getChangeSummaryImpl();
-    ChangeSummaryImpl* getSummary();
-    ChangeSummaryImpl* localCS;
+    ChangeSummaryImplPtr getChangeSummaryImpl();
+    ChangeSummaryImplPtr getSummary();
+    ChangeSummaryImplPtr localCS;
 
 
     // reference type support
@@ -723,7 +716,7 @@
 
   
 };
-};
-};
+}
+}
  
 #endif //_DATAOBJECTIMPL_H_

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectInstance.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectInstance.h?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectInstance.h (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectInstance.h Wed Aug  8 10:21:09 2007
@@ -49,7 +49,7 @@
             SDO_API bool operator!() {return (!dataObject);}
             SDO_API operator bool() {return !!dataObject;}
 
-            SDO_API DataObject* operator->() {return dataObject;}
+            SDO_API DataObject* operator->() {return getRawPointer(dataObject);}
 
             SDO_API DataObjectPtr getDataObject() {return dataObject;}
             SDO_API operator DataObjectPtr() {return dataObject;}

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?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectListImpl.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectListImpl.cpp Wed Aug  8 10:21:09 2007
@@ -83,7 +83,7 @@
     isReference = false;
 }
 
-DataObjectListImpl::DataObjectListImpl(DataFactory* df, 
+DataObjectListImpl::DataObjectListImpl(DataFactoryImplPtr df, 
                                        DataObjectImpl* cont,
                                        unsigned int inpindex,
                                        const char* intypeURI,
@@ -140,18 +140,18 @@
     }
 }
 
-RefCountingPointer<DataObject> DataObjectListImpl::operator[] (unsigned int pos)
+DataObjectPtr DataObjectListImpl::operator[] (unsigned int pos)
 {
     validateIndex(pos);
     return plist[pos];
 }
 
-const RefCountingPointer<DataObject> DataObjectListImpl::operator[] (unsigned int pos) const
+const DataObjectPtr DataObjectListImpl::operator[] (unsigned int pos) const
 {
     validateIndex(pos);
     RefCountingPointer<DataObjectImpl> d = plist[pos];
-    DataObjectImpl* dob = d;
-    return  RefCountingPointer<DataObject>((DataObject*)dob);
+    DataObjectImpl* dob = getRawPointer(d);
+    return  DataObjectPtr((DataObject*)dob);
 }
 
 
@@ -234,7 +234,7 @@
     const Property& property = container->getProperty(pindex);
     ASSERT_WRITABLE(property,insert)
 
-    DataObject* dob = d; // unwrap the data object ready for a downcasting hack.
+    DataObject* dob = getRawPointer(d); // unwrap the data object ready for a downcasting hack.
     DataObjectImpl* con  = ((DataObjectImpl*)dob)->getContainerImpl();  
     if (!isReference)
     {
@@ -266,7 +266,7 @@
     {
         if (container->getType().isSequencedType())
         {
-            SequenceImpl* sq = container->getSequenceImpl();
+            SequenceImplPtr sq = container->getSequenceImpl();
             if (sq)sq->push(property,index);
         }
     }
@@ -278,7 +278,7 @@
   void DataObjectListImpl::checkFactory(DataObjectPtr dob)
     {
         
-        DataObjectImpl* d = (DataObjectImpl*)(DataObject*)dob;
+        DataObjectImpl* d = (DataObjectImpl*)getRawPointer(dob);
 
         if (d->getDataFactory() == theFactory) return;
 
@@ -306,7 +306,7 @@
     {
         if (listType.equals(objectType)) return;
 
-        const TypeImpl* ti = ((DataFactoryImpl*)theFactory)->findTypeImpl
+        const TypeImpl* ti = theFactory->findTypeImpl
             (objectType.getURI(),objectType.getName());
         if (ti != 0)
         {
@@ -353,7 +353,7 @@
     // need to check for an opentype list which has not been set up yet
     if (name == 0) return;
 
-    const TypeImpl* t = ((DataFactoryImpl*)theFactory)->findTypeImpl(uri,name);
+    const TypeImpl* t = theFactory->findTypeImpl(uri,name);
     if (t == 0) return; // cannot set to a type which is not avilable
 
     // need to modify the instance property of the container
@@ -381,7 +381,7 @@
     // need to check for an opentype list which has not been set up yet
     // if (name == 0) return;
 
-    const TypeImpl* t = ((DataFactoryImpl*)theFactory)->findTypeImpl(uri.c_str(), name.c_str());
+    const TypeImpl* t = theFactory->findTypeImpl(uri.c_str(), name.c_str());
     if (t == 0) return; // cannot set to a type which is not avilable
 
     // need to modify the instance property of the container
@@ -432,7 +432,7 @@
    const Property& property = container->getProperty(pindex);
    ASSERT_WRITABLE(property, append);
 
-   DataObject* dob = d; // unwrap the data object ready for a downcasting hack.
+   DataObject* dob = getRawPointer(d); // unwrap the data object ready for a downcasting hack.
    DataObjectImpl* con  = ((DataObjectImpl*) dob)->getContainerImpl();
 
    if (!isReference)
@@ -467,7 +467,7 @@
    if (container != 0) {
       if (container->getType().isSequencedType())
       {
-         SequenceImpl* sq = container->getSequenceImpl();
+         SequenceImplPtr sq = container->getSequenceImpl();
          if (sq)
          {
             sq->push(property, (plist.size() - 1));
@@ -482,8 +482,8 @@
     
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, BooleanLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setBoolean(d);
     insert(index, dol);
 }
@@ -494,8 +494,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, BooleanLiteral);
     
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setBoolean(d);
     append( dol);
 }
@@ -506,8 +506,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, ByteLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setByte(d);
     insert(index, dol);
 }
@@ -518,8 +518,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, ByteLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setByte(d);
     append( dol);
 }
@@ -530,8 +530,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, CharacterLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setCharacter(d);
     insert(index, dol);
 }
@@ -542,8 +542,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, CharacterLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setCharacter(d);
     append( dol);
 }
@@ -554,8 +554,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, StringLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setString(d, length);
     insert(index, dol);
 }
@@ -566,8 +566,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, StringLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setString(d, length);
     append( dol);
 }
@@ -577,8 +577,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, BytesLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setBytes(d, length);
     insert(index, dol);
 }
@@ -589,8 +589,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, BytesLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setBytes(d, length);
     append( dol);
 }
@@ -600,8 +600,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, StringLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setCString(d);
     insert(index, dol);
 }
@@ -611,8 +611,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, StringLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setCString(d);
     insert(index, dol);
 }
@@ -623,8 +623,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, StringLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setCString(d);
     append( dol);
 }
@@ -635,8 +635,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, StringLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setCString(d);
     append( dol);
 }
@@ -647,8 +647,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, StringLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setSDOValue(sval);
     append(dol);
 }
@@ -659,8 +659,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, ShortLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setShort(d);
     insert(index, dol);
 }
@@ -671,8 +671,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, ShortLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setShort(d);
     append( dol);
 }
@@ -685,8 +685,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, IntegerLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setInteger(d);
     insert(index, dol);
 }
@@ -697,8 +697,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, IntegerLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setInteger(d);
     append( dol);
 }
@@ -710,8 +710,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, DateLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setDate(d);
     insert(index, dol);
 }
@@ -722,8 +722,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, DateLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setDate(d);
     append( dol);
 }
@@ -734,8 +734,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, LongLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setLong(d);
     insert(index, dol);
 }
@@ -746,8 +746,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, LongLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setLong(d);
     append( dol);
 }
@@ -758,8 +758,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, FloatLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setFloat(d);
     insert(index, dol);
 }
@@ -770,8 +770,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, FloatLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setFloat(d);
     append( dol);
 }
@@ -782,8 +782,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, DoubleLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setDouble(d);
     insert(index, dol);
 }
@@ -794,8 +794,8 @@
 
     if (typeUnset)setType(Type::SDOTypeNamespaceURI, DoubleLiteral);
 
-    RefCountingPointer<DataObject> dol = theFactory->create(typeURI, typeName);
-    DataObject* dob = dol;
+    DataObjectPtr dol = theFactory->create(typeURI, typeName);
+    DataObject* dob = getRawPointer(dol);
     ((DataObjectImpl*)dob)->setDouble(d);
     append( dol);
 }
@@ -807,14 +807,14 @@
 }
 
 
-RefCountingPointer<DataObject> DataObjectListImpl::remove(unsigned int index)
+DataObjectPtr DataObjectListImpl::remove(unsigned int index)
 {
     validateIndex(index);
     if (container != 0)
     {
         container->logChange(pindex);
     }
-    RefCountingPointer<DataObject> d = (*this)[index];
+    DataObjectPtr d = (*this)[index];
     
     // log deletion only if the list is of data objects.
     if (theFactory != 0) 
@@ -827,7 +827,7 @@
         }
     }
     plist.erase(plist.begin()+index);
-    DataObject* dob = d;
+    DataObject* dob = getRawPointer(d);
     ((DataObjectImpl*)dob)->setContainer(0);
     return d;
 }
@@ -850,85 +850,85 @@
 bool        DataObjectListImpl::getBoolean(unsigned int index) const
 {
     validateIndex(index);
-    RefCountingPointer<DataObject> d = ((*this)[index]);
-    DataObject* dob = d;
+    DataObjectPtr d = ((*this)[index]);
+    DataObject* dob = getRawPointer(d);
     return ((DataObjectImpl*)dob)->getBoolean();
 }
 char        DataObjectListImpl::getByte(unsigned int index) const
 {
     validateIndex(index);
-    RefCountingPointer<DataObject> d = ((*this)[index]);
-    DataObject* dob = d;
+    DataObjectPtr d = ((*this)[index]);
+    DataObject* dob = getRawPointer(d);
     return ((DataObjectImpl*)dob)->getByte();
 }
 wchar_t     DataObjectListImpl::getCharacter(unsigned int index) const
 {
     validateIndex(index);
-    RefCountingPointer<DataObject> d = ((*this)[index]);
-    DataObject* dob = d;
+    DataObjectPtr d = ((*this)[index]);
+    DataObject* dob = getRawPointer(d);
     return ((DataObjectImpl*)dob)->getCharacter();
 }
 unsigned int  DataObjectListImpl::getBytes(unsigned int index, char* value, unsigned int max) const
 {
     validateIndex(index);
-    RefCountingPointer<DataObject> d = ((*this)[index]);
-    DataObject* dob = d;
+    DataObjectPtr d = ((*this)[index]);
+    DataObject* dob = getRawPointer(d);
     return ((DataObjectImpl*)dob)->getBytes(value, max);
 }
 unsigned int  DataObjectListImpl::getString(unsigned int index, wchar_t* value, unsigned int max) const
 {
     validateIndex(index);
-    RefCountingPointer<DataObject> d = ((*this)[index]);
-    DataObject* dob = d;
+    DataObjectPtr d = ((*this)[index]);
+    DataObject* dob = getRawPointer(d);
     return ((DataObjectImpl*)dob)->getString(value, max);
 }
 short       DataObjectListImpl::getShort(unsigned int index) const
 {
     validateIndex(index);
-    RefCountingPointer<DataObject> d = ((*this)[index]);
-    DataObject* dob = d;
+    DataObjectPtr d = ((*this)[index]);
+    DataObject* dob = getRawPointer(d);
     return ((DataObjectImpl*)dob)->getShort();
 }
 long         DataObjectListImpl::getInteger(unsigned int index) const
 {
     validateIndex(index);
-    RefCountingPointer<DataObject> d = ((*this)[index]);
-    DataObject* dob = d;
+    DataObjectPtr d = ((*this)[index]);
+    DataObject* dob = getRawPointer(d);
     return ((DataObjectImpl*)dob)->getInteger();
 }
 int64_t     DataObjectListImpl::getLong(unsigned int index) const
 {
     validateIndex(index);
-    RefCountingPointer<DataObject> d = ((*this)[index]);
-    DataObject* dob = d;
+    DataObjectPtr d = ((*this)[index]);
+    DataObject* dob = getRawPointer(d);
     return ((DataObjectImpl*)dob)->getLong();
 }
 float       DataObjectListImpl::getFloat(unsigned int index) const 
 {
     validateIndex(index);
-    RefCountingPointer<DataObject> d = ((*this)[index]); 
-    DataObject* dob = d;
+    DataObjectPtr d = ((*this)[index]); 
+    DataObject* dob = getRawPointer(d);
     return ((DataObjectImpl*)dob)->getFloat();
 }
 long double DataObjectListImpl::getDouble(unsigned int index) const 
 {
     validateIndex(index);
-    RefCountingPointer<DataObject> d = ((*this)[index]);
-    DataObject* dob = d;
+    DataObjectPtr d = ((*this)[index]);
+    DataObject* dob = getRawPointer(d);
     return ((DataObjectImpl*)dob)->getDouble();
 }
 const SDODate      DataObjectListImpl::getDate(unsigned int index) const
 {
     validateIndex(index);
-    RefCountingPointer<DataObject> d = ((*this)[index]);
-    DataObject* dob = d;
+    DataObjectPtr d = ((*this)[index]);
+    DataObject* dob = getRawPointer(d);
     return ((DataObjectImpl*)dob)->getDate();
 }
 const char* DataObjectListImpl::getCString(unsigned int index) const
 {
     validateIndex(index);
-    RefCountingPointer<DataObject> d = ((*this)[index]);
-    DataObject* dob = d;
+    DataObjectPtr d = ((*this)[index]);
+    DataObject* dob = getRawPointer(d);
     return ((DataObjectImpl*)dob)->getCString();
 }
 
@@ -945,8 +945,8 @@
     {
         container->logChange(pindex);
     }
-    RefCountingPointer<DataObject> dd = ((*this)[index]);
-    DataObject* dob = dd;
+    DataObjectPtr dd = ((*this)[index]);
+    DataObject* dob = getRawPointer(dd);
     ((DataObjectImpl*)dob)->setBoolean(d);
 }
 void DataObjectListImpl::setByte(unsigned int index, char d) 
@@ -956,8 +956,8 @@
     {
         container->logChange(pindex);
     }
-    RefCountingPointer<DataObject> dd = ((*this)[index]);
-    DataObject* dob = dd;
+    DataObjectPtr dd = ((*this)[index]);
+    DataObject* dob = getRawPointer(dd);
     ((DataObjectImpl*)dob)->setByte(d);
 }
 void DataObjectListImpl::setCharacter(unsigned int index, wchar_t d) 
@@ -967,8 +967,8 @@
     {
         container->logChange(pindex);
     }
-    RefCountingPointer<DataObject> dd = ((*this)[index]);
-    DataObject* dob = dd;
+    DataObjectPtr dd = ((*this)[index]);
+    DataObject* dob = getRawPointer(dd);
     ((DataObjectImpl*)dob)->setCharacter(d);
 }
 
@@ -979,8 +979,8 @@
     {
         container->logChange(pindex);
     }
-    RefCountingPointer<DataObject> dd = ((*this)[index]);
-    DataObject* dob = dd;
+    DataObjectPtr dd = ((*this)[index]);
+    DataObject* dob = getRawPointer(dd);
     ((DataObjectImpl*)dob)->setString(d, len);
 }
 void DataObjectListImpl::setBytes(unsigned int index, const char* d, unsigned int len) 
@@ -990,8 +990,8 @@
     {
         container->logChange(pindex);
     }
-    RefCountingPointer<DataObject> dd = ((*this)[index]);
-    DataObject* dob = dd;
+    DataObjectPtr dd = ((*this)[index]);
+    DataObject* dob = getRawPointer(dd);
     ((DataObjectImpl*)dob)->setBytes(d, len);
 }
 
@@ -1002,8 +1002,8 @@
     {
         container->logChange(pindex);
     }
-    RefCountingPointer<DataObject> dd = ((*this)[index]);
-    DataObject* dob = dd;
+    DataObjectPtr dd = ((*this)[index]);
+    DataObject* dob = getRawPointer(dd);
     ((DataObjectImpl*)dob)->setShort(d);
 }
 void DataObjectListImpl::setInteger(unsigned int index, long d) 
@@ -1013,8 +1013,8 @@
     {
         container->logChange(pindex);
     }
-    RefCountingPointer<DataObject> dd = ((*this)[index]);
-    DataObject* dob = dd;
+    DataObjectPtr dd = ((*this)[index]);
+    DataObject* dob = getRawPointer(dd);
     ((DataObjectImpl*)dob)->setInteger(d);
 }
 void DataObjectListImpl::setLong(unsigned int index, int64_t d) 
@@ -1024,8 +1024,8 @@
     {
         container->logChange(pindex);
     }
-    RefCountingPointer<DataObject> dd = ((*this)[index]);
-    DataObject* dob = dd;
+    DataObjectPtr dd = ((*this)[index]);
+    DataObject* dob = getRawPointer(dd);
     ((DataObjectImpl*)dob)->setLong(d);
 }
 void DataObjectListImpl::setFloat(unsigned int index, float d) 
@@ -1035,8 +1035,8 @@
     {
         container->logChange(pindex);
     }
-    RefCountingPointer<DataObject> dd = ((*this)[index]);
-    DataObject* dob = dd;
+    DataObjectPtr dd = ((*this)[index]);
+    DataObject* dob = getRawPointer(dd);
     ((DataObjectImpl*)dob)->setFloat(d);
 }
 void DataObjectListImpl::setDouble(unsigned int index, long double d) 
@@ -1046,8 +1046,8 @@
     {
         container->logChange(pindex);
     }
-    RefCountingPointer<DataObject> dd = ((*this)[index]);
-    DataObject* dob = dd;
+    DataObjectPtr dd = ((*this)[index]);
+    DataObject* dob = getRawPointer(dd);
     ((DataObjectImpl*)dob)->setDouble(d);
 }
 void DataObjectListImpl::setDate(unsigned int index, const SDODate d) 
@@ -1057,8 +1057,8 @@
     {
         container->logChange(pindex);
     }
-    RefCountingPointer<DataObject> dd = ((*this)[index]);
-    DataObject* dob = dd;
+    DataObjectPtr dd = ((*this)[index]);
+    DataObject* dob = getRawPointer(dd);
     ((DataObjectImpl*)dob)->setDate(d);
 }
 void DataObjectListImpl::setCString(unsigned int index, char* d) 
@@ -1068,8 +1068,8 @@
     {
         container->logChange(pindex);
     }
-    RefCountingPointer<DataObject> dd = ((*this)[index]);
-    DataObject* dob = dd;
+    DataObjectPtr dd = ((*this)[index]);
+    DataObject* dob = getRawPointer(dd);
     ((DataObjectImpl*)dob)->setCString(d);
 }
 void DataObjectListImpl::setCString(unsigned int index, const SDOString& d) 
@@ -1079,8 +1079,8 @@
     {
         container->logChange(pindex);
     }
-    RefCountingPointer<DataObject> dd = ((*this)[index]);
-    DataObject* dob = dd;
+    DataObjectPtr dd = ((*this)[index]);
+    DataObject* dob = getRawPointer(dd);
     ((DataObjectImpl*)dob)->setCString(d);
 }
 
@@ -1108,8 +1108,8 @@
 unsigned int DataObjectListImpl::getLength(unsigned int index) const
 {
     validateIndex(index);
-    RefCountingPointer<DataObject> dd = ((*this)[index]);
-    DataObject* dob = dd;
+    DataObjectPtr dd = ((*this)[index]);
+    DataObject* dob = getRawPointer(dd);
     return dob->getLength();
 }
 

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectListImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectListImpl.h?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectListImpl.h (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataObjectListImpl.h Wed Aug  8 10:21:09 2007
@@ -34,10 +34,7 @@
 namespace commonj{
 namespace sdo{
 
-class DataObjectImpl;
-class DataFactory;
-
-typedef std::vector< RefCountingPointer<DataObjectImpl> > DATAOBJECT_VECTOR;
+typedef std::vector<DataObjectImplPtr> DATAOBJECT_VECTOR;
 
 /** 
  * DataObjectListImpl implements the abstract class DataObjectList.
@@ -55,7 +52,7 @@
     DataObjectListImpl(DATAOBJECT_VECTOR p);
     DataObjectListImpl(const DataObjectListImpl &pin);
     DataObjectListImpl();
-    DataObjectListImpl(DataFactory* df, DataObjectImpl* cont, unsigned int inpindex, 
+    DataObjectListImpl(DataFactoryImplPtr df, DataObjectImpl* cont, unsigned int inpindex, 
                        const char* tURI, const char* tName);
 
     virtual ~DataObjectListImpl();
@@ -187,8 +184,7 @@
 
     bool typeUnset;
 
-    // No reference count held on the factory
-    DataFactory* theFactory;
+    DataFactoryImplPtr theFactory;
 
     // For logging a change in the change summary when appending
     DataObjectImpl* container;

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/PropertyImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/PropertyImpl.cpp?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/PropertyImpl.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/PropertyImpl.cpp Wed Aug  8 10:21:09 2007
@@ -49,9 +49,9 @@
             const SDOString& inname,
             const Type& intype) : name(inname)
         {
-            DataFactory* f = (DataFactory*)mdg;
+            DataFactoryImplPtr f = staticCast<DataFactoryImplPtr>(mdg);
 
-            type = ((DataFactoryImpl*)f)->findType(intype.getURI(),intype.getName());
+            type = f->findType(intype.getURI(),intype.getName());
         }
 
         // Copy constructor

Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingPointer.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingPointer.cpp?view=diff&rev=563950&r1=563949&r2=563950
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingPointer.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingPointer.cpp Wed Aug  8 10:21:09 2007
@@ -50,7 +50,7 @@
             if (fptr2 == fptr || !fptr){}
             
             /* 5) Use the T*  and  * */
-            DataFactory* dmsf = fptr;
+            DataFactory* dmsf = getRawPointer(fptr);
             DataFactory& dmsr = *fptr;
             
             /* 1) construct */
@@ -66,7 +66,7 @@
             if (dfptr2 == dfptr || !dfptr){}
             
             /* 5) Use the T*  and  * */
-            DataFactory* ddmsf = dfptr;
+            DataFactory* ddmsf = getRawPointer(dfptr);
             DataFactory& ddmsr = *dfptr;
             
             /* 6) Use the -> */
@@ -78,7 +78,7 @@
             DataObjectPtr dptr2 = dptr;
             
             /* Use the T*  and  * */
-            DataObject* dof = dptr;
+            DataObject* dof = getRawPointer(dptr);
             DataObject& dor = *dptr;
             
             if (dptr2 == dptr || !dptr){}
@@ -88,7 +88,7 @@
             cptr = dptr->getChangeSummary();
             ChangeSummaryPtr cptr2 = cptr;
             
-            ChangeSummary* cof = cptr;
+            ChangeSummary* cof = getRawPointer(cptr);
             ChangeSummary& cop = *cptr;
             
             
@@ -100,7 +100,7 @@
             sptr = dptr->getSequence();
             SequencePtr sptr2 = sptr;
             
-            Sequence* sof = sptr;
+            Sequence* sof = getRawPointer(sptr);
             Sequence& sop = *sptr;
             
             
@@ -114,7 +114,7 @@
             XMLDocumentPtr xmldocptr2 = xmldocptr1;
             xmldocptr1 = xmldocptr2;
             if (xmldocptr2 == xmldocptr1 || !xmldocptr1){}
-            XMLDocument* xmldocp = xmldocptr1;
+            XMLDocument* xmldocp = getRawPointer(xmldocptr1);
             XMLDocument& xmldocref = *xmldocptr2;
             xmldocptr1->getEncoding();
 
@@ -123,7 +123,7 @@
             XSDHelperPtr xsdhptr2 = xsdhptr1;
             xsdhptr1 = xsdhptr2;
             if (xsdhptr2 == xsdhptr1 || !xsdhptr1){}
-            XSDHelper* xsdhp = xsdhptr1;
+            XSDHelper* xsdhp = getRawPointer(xsdhptr1);
             XSDHelper& xsdhref = *xsdhptr2;
             xsdhptr1->define("dummy");
 
@@ -132,7 +132,7 @@
             XMLHelperPtr xmlhptr2 = xmlhptr1;
             xmlhptr1 = xmlhptr2;
             if (xmlhptr2 == xmlhptr1 || !xmlhptr1){}
-            XMLHelper* xmlhp = xmlhptr1;
+            XMLHelper* xmlhp = getRawPointer(xmlhptr1);
             XMLHelper& xmlhref = *xmlhptr2;
             xmlhptr1->load("dummy");
 
@@ -141,7 +141,7 @@
             DataGraphPtr dgptr2 = dgptr1;
             dgptr1 = dgptr2;
             if (dgptr2 == dgptr1 || !dgptr1){}
-            DataGraph* dghp = dgptr1;
+            DataGraph* dghp = getRawPointer(dgptr1);
             DataGraph& dgref = *dgptr2;
             dgptr1->getRootObject();
 



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