![]() |
The Simons
|
00001 00002 // 00003 // SCL : Simons Component Library 00004 // 00006 // 00007 // Filename: NullPointer.h 00008 // Contents: NullPointer class, signalling an invalid Object 00009 // Author: Anthony J H Simons 00010 // Revised: 29 November 2005 00011 00012 // This software is distributed free in the hope that others will 00013 // find it useful. However, it comes WITHOUT ANY WARRANTY. No 00014 // liability can be accepted for software failure, merchantability 00015 // or fitness for a particular purpose. You can redistribute this 00016 // software in its original form, or in a modified form, provided 00017 // that this disclaimer is retained in the file banner. 00018 00019 #ifndef SCL_NULL_POINTER 00020 #define SCL_NULL_POINTER 00021 00022 #include "ObjectError.h" // Include my superclass type 00023 #include "NullPointerID.h" // Include my pointer type 00024 00025 #include "TypeID.h" // Depend on the pointer type 00026 00039 00040 class NullPointer : public ObjectError { 00041 protected: 00042 NullPointer(const NullPointer&); 00043 public: 00044 NullPointer(); 00045 virtual ~NullPointer(); 00046 NullPointer(ObjectID, TypeID); 00047 NullPointer(ObjectID, ObjectID); 00048 virtual ObjectID clone() const; 00049 }; 00050 00052 00055 inline NullPointerID::NullPointerID() {} 00056 00058 inline NullPointerID::~NullPointerID() {} 00059 00063 inline NullPointerID::NullPointerID(const Null* null) : 00064 ObjectErrorID(null) {} 00065 00069 inline NullPointerID::NullPointerID(const NullPointer* exception) : 00070 ObjectErrorID(exception) {} 00071 00075 inline NullPointerID::NullPointerID(const NullPointerID& pointer) : 00076 ObjectErrorID(pointer) {} 00077 00081 inline NullPointerID& NullPointerID::operator=(const NullPointer* exception) { 00082 assign(exception); 00083 return *this; 00084 } 00085 00090 inline NullPointerID& NullPointerID::operator=(const NullPointerID& pointer) { 00091 assign(pointer); 00092 return *this; 00093 } 00094 00095 00096 #endif 00097