You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ed...@apache.org on 2006/05/17 10:16:51 UTC
svn commit: r407197 - in
/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo:
DataFactoryImpl.cpp RefCountingPointer.h SDORuntimeException.h
Author: edslattery
Date: Wed May 17 01:16:50 2006
New Revision: 407197
URL: http://svn.apache.org/viewcvs?rev=407197&view=rev
Log:
SDONullPointerException to be thrown when dereferencing an empty refcountingpointer
Modified:
incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataFactoryImpl.cpp
incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingPointer.h
incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDORuntimeException.h
Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataFactoryImpl.cpp
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataFactoryImpl.cpp?rev=407197&r1=407196&r2=407197&view=diff
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataFactoryImpl.cpp (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/DataFactoryImpl.cpp Wed May 17 01:16:50 2006
@@ -74,6 +74,7 @@
rootElementName = 0;
+
}
Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingPointer.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/RefCountingPointer.h?rev=407197&r1=407196&r2=407197&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 Wed May 17 01:16:50 2006
@@ -22,6 +22,7 @@
#include "commonj/sdo/export.h"
+#include "commonj/sdo/SDORuntimeException.h"
#include <iostream>
using namespace std;
@@ -147,6 +148,8 @@
template<class T>
/*SDO_API*/ T* RefCountingPointer<T>::operator->() const
{
+ if (pointee == 0)
+ SDO_THROW_EXCEPTION("Pointer",SDONullPointerException, "");
return pointee;
}
Modified: incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDORuntimeException.h
URL: http://svn.apache.org/viewcvs/incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDORuntimeException.h?rev=407197&r1=407196&r2=407197&view=diff
==============================================================================
--- incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDORuntimeException.h (original)
+++ incubator/tuscany/cpp/sdo/runtime/core/src/commonj/sdo/SDORuntimeException.h Wed May 17 01:16:50 2006
@@ -260,6 +260,24 @@
private:
}; // End SDOOutOfMemory class definition
+/**
+ ***************************************************************************
+ *
+ * SDONullPointerException - Exception for no-storage
+ *
+ * ***************************************************************************
+ */
+
+class SDONullPointerException: public SDORuntimeException
+{
+ public:
+ SDONullPointerException(const char* param)
+ : SDORuntimeException("SDONullPointerException", Warning,
+ "The referenced object is null ")
+ {
+ }
+ private:
+}; // End SDOOutOfMemory class definition
/**
***************************************************************************
*