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 2006/08/10 18:25:36 UTC
svn commit: r430425 - in
/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo: DataObjectImpl.cpp
DataObjectImpl.h RefCountingObject.cpp RefCountingObject.h
RefCountingPointer.h
Author: robbinspg
Date: Thu Aug 10 09:25:35 2006
New Revision: 430425
URL: http://svn.apache.org/viewvc?rev=430425&view=rev
Log:
TUSCANY-614 improve SDO diagnostics
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/RefCountingObject.cpp
incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingObject.h
incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingPointer.h
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=430425&r1=430424&r2=430425&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 Thu Aug 10 09:25:35 2006
@@ -38,6 +38,7 @@
#include "commonj/sdo/ChangeSummaryImpl.h"
#include "commonj/sdo/DataFactoryImpl.h"
+#include "commonj/sdo/SDOUtils.h"
#include <string>
#include <stdio.h>
@@ -4301,6 +4302,12 @@
void DataObjectImpl::setUserData(void* value)
{
userdata = value;
+ }
+
+ std::ostream& DataObjectImpl::printSelf(std::ostream &os)
+ {
+ SDOUtils::printDataObject(os, this);
+ return os;
}
};
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=430425&r1=430424&r2=430425&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 Thu Aug 10 09:25:35 2006
@@ -559,6 +559,8 @@
virtual void transferChildren(DataObject* d, DataFactory* f);
virtual void setDataFactory(DataFactory *df);
+ virtual std::ostream& printSelf(std::ostream &os);
+
private:
virtual void validateIndex(unsigned int index);
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=430425&r1=430424&r2=430425&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 Thu Aug 10 09:25:35 2006
@@ -70,5 +70,12 @@
}
+SDO_API std::ostream& RefCountingObject::printSelf(std::ostream &os)
+{
+ os << "RefCountingObject: reference count = " << refCount <<endl;
+ return os;
+}
+
+
};
};
Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingObject.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingObject.h?rev=430425&r1=430424&r2=430425&view=diff
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingObject.h (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingObject.h Thu Aug 10 09:25:35 2006
@@ -22,7 +22,7 @@
#include "commonj/sdo/export.h"
-
+#include <iostream>
namespace commonj {
namespace sdo {
@@ -47,6 +47,12 @@
* Subtract from the the reference count - a reference has dropped.
*/
SDO_API void releaseRef();
+
+/**
+ * Print contents to stream
+ */
+ SDO_API virtual std::ostream& printSelf(std::ostream &os);
+
private:
unsigned int refCount;
Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingPointer.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingPointer.h?rev=430425&r1=430424&r2=430425&view=diff
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingPointer.h (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingPointer.h Thu Aug 10 09:25:35 2006
@@ -85,6 +85,20 @@
return RefCountingPointer<otherType>(pointee);
}
+ friend std::ostream& operator<< (std::ostream &os, const RefCountingPointer<T>& ptr)
+ {
+ if (!ptr)
+ {
+ os << "RefCountingPointer is NULL" << endl;
+ }
+ else
+ {
+ ptr->printSelf(os);
+ }
+
+ return os;
+ }
+
private:
T *pointee;
void init();
@@ -157,6 +171,7 @@
{
return *pointee;
}
+
class DataObject;
typedef RefCountingPointer<DataObject> DataObjectPtr;
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org