Text archives Help
- From: sparker@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [Manta] r1953 - trunk/Core/Exceptions
- Date: Sun, 30 Dec 2007 23:34:20 -0700 (MST)
Author: sparker
Date: Sun Dec 30 23:34:19 2007
New Revision: 1953
Added:
trunk/Core/Exceptions/NullPointerException.cc
trunk/Core/Exceptions/NullPointerException.h
Log:
Added a null pointer exception class
Added: trunk/Core/Exceptions/NullPointerException.cc
==============================================================================
--- (empty file)
+++ trunk/Core/Exceptions/NullPointerException.cc Sun Dec 30 23:34:19
2007
@@ -0,0 +1,30 @@
+
+#include <Core/Exceptions/NullPointerException.h>
+
+using namespace Manta;
+using namespace std;
+
+NullPointerException::NullPointerException(const std::type_info& t)
+ : message_(string("Reference to null pointer of type: ") + t.name())
+{
+}
+
+NullPointerException::NullPointerException(const NullPointerException& copy)
+ : message_(copy.message_)
+{
+}
+
+NullPointerException::~NullPointerException()
+{
+}
+
+const char* NullPointerException::message() const
+{
+ return message_.c_str();
+}
+
+const char* NullPointerException::type() const
+{
+ return "NullPointerException";
+}
+
Added: trunk/Core/Exceptions/NullPointerException.h
==============================================================================
--- (empty file)
+++ trunk/Core/Exceptions/NullPointerException.h Sun Dec 30 23:34:19
2007
@@ -0,0 +1,25 @@
+
+#ifndef Manta_Core_NullPointerException_h
+#define Manta_Core_NullPointerException_h
+
+#include <Core/Exceptions/Exception.h>
+#include <typeinfo>
+#include <string>
+
+namespace Manta {
+ using namespace std;
+ class NullPointerException : public Exception {
+ public:
+ NullPointerException(const std::type_info& t);
+ NullPointerException(const NullPointerException&);
+ virtual ~NullPointerException();
+ virtual const char* message() const;
+ virtual const char* type() const;
+ protected:
+ private:
+ std::string message_;
+ NullPointerException& operator=(const NullPointerException&);
+ };
+}
+
+#endif
- [Manta] r1953 - trunk/Core/Exceptions, sparker, 12/31/2007
Archive powered by MHonArc 2.6.16.