![]() |
The Simons
|
00001 00002 // 00003 // SCL : Simons Component Library 00004 // 00006 // 00007 // Filename: DeviceError.h 00008 // Contents: DeviceError class, signalling a failed device 00009 // Author: Anthony J H Simons 00010 // Revised: 1 December 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_DEVICE_ERROR 00020 #define SCL_DEVICE_ERROR 00021 00022 #include "Exception.h" // Include my superclass type 00023 #include "DeviceErrorID.h" // Include my pointer type 00024 00025 #include "StringID.h" // Depend on the pointer type 00026 00033 00034 00035 class DeviceError : public Exception { 00036 protected: 00037 StringID deviceName; 00038 DeviceError(const DeviceError&); 00039 public: 00040 DeviceError(); 00041 virtual ~DeviceError(); 00042 DeviceError(ObjectID, StringID, StringID); 00043 StringID name() const; 00044 }; 00045 00047 00050 inline StringID DeviceError::name() const { return deviceName; } 00051 00052 00054 00057 inline DeviceErrorID::DeviceErrorID() {} 00058 00060 inline DeviceErrorID::~DeviceErrorID() {} 00061 00065 inline DeviceErrorID::DeviceErrorID(const Null* null) : 00066 ExceptionID(null) {} 00067 00071 inline DeviceErrorID::DeviceErrorID(const DeviceError* exception) : 00072 ExceptionID(exception) {} 00073 00077 inline DeviceErrorID::DeviceErrorID(const DeviceErrorID& pointer) : 00078 ExceptionID(pointer) {} 00079 00083 inline DeviceErrorID& DeviceErrorID::operator=(const DeviceError* exception) { 00084 assign(exception); 00085 return *this; 00086 } 00087 00092 inline DeviceErrorID& DeviceErrorID::operator=(const DeviceErrorID& pointer) { 00093 assign(pointer); 00094 return *this; 00095 } 00096 00097 00098 #endif 00099 00100