#ifndef exception_h #define exception_h 1 #include extern const char* exceptionHeader; extern const char* exceptionFooter; class whereException { public: whereException(const char* here); ~whereException(); friend ostream& operator << (ostream& s, const whereException& e); protected: void put (ostream& s) const; private: char* w; }; class whichException { public: whichException(const char* which); ~whichException(); friend ostream& operator << (ostream& s, const whichException& e); protected: void put (ostream& s) const; private: char* w; }; class outOfRange { public: outOfRange(const char* iName, int iValue, int lowerRange, int upperRange); ~outOfRange(); friend ostream& operator << (ostream& s, const outOfRange& e); protected: void put (ostream& s) const; private: char* name; int value,lower,upper; }; class dimMismatch { public: dimMismatch (int m1, int n1, int m2, int n2); friend ostream& operator << (ostream& s, const dimMismatch& e); protected: void put (ostream& s) const; private: int mA,nA,mB,nB; }; class whereWhich : whereException, whichException { public: whereWhich(const char* here, const char* that); friend ostream& operator << (ostream& s, const whereWhich& e); }; class whereOutOfRange : whereException, outOfRange { public: whereOutOfRange(const char* here, const char* iName, int val, int lower, int upper); friend ostream& operator << (ostream& s, const whereOutOfRange& e); }; class whereDimMismatch : whereException, dimMismatch { public: whereDimMismatch(const char* here, int m1, int n1, int m2, int n2); friend ostream& operator << (ostream& s, const whereDimMismatch& e); }; #endif