![]() |
The Simons
|
00001 00002 // 00003 // SCL : Simons Component Library 00004 // 00006 // 00007 // Filename: ObjectError.h 00008 // Contents: ObjectError 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_OBJECT_ERROR 00020 #define SCL_OBJECT_ERROR 00021 00022 #include "Exception.h" // Include my superclass type 00023 #include "ObjectErrorID.h" // Include my pointer type 00024 00025 #include "StringID.h" // Depend on the pointer types 00026 #include "TypeID.h" 00027 00033 00034 class ObjectError : public Exception { 00035 protected: 00036 TypeID desiredType; 00037 ObjectError(const ObjectError&); 00038 public: 00039 ObjectError(); 00040 virtual ~ObjectError(); 00041 ObjectError(ObjectID, TypeID, StringID); 00042 TypeID expectedType() const; 00043 }; 00044 00046 00049 inline TypeID ObjectError::expectedType() const { return desiredType; } 00050 00051 00053 00056 inline ObjectErrorID::ObjectErrorID() {} 00057 00059 inline ObjectErrorID::~ObjectErrorID() {} 00060 00064 inline ObjectErrorID::ObjectErrorID(const Null* null) : 00065 ExceptionID(null) {} 00066 00070 inline ObjectErrorID::ObjectErrorID(const ObjectError* exception) : 00071 ExceptionID(exception) {} 00072 00076 inline ObjectErrorID::ObjectErrorID(const ObjectErrorID& pointer) : 00077 ExceptionID(pointer) {} 00078 00082 inline ObjectErrorID& ObjectErrorID::operator=(const ObjectError* exception) { 00083 assign(exception); 00084 return *this; 00085 } 00086 00091 inline ObjectErrorID& ObjectErrorID::operator=(const ObjectErrorID& pointer) { 00092 assign(pointer); 00093 return *this; 00094 } 00095 00096 00097 #endif 00098 00099