#ifndef BOUNDARY_VIOLATION_EXCEPTION_H #define BOUNDARY_VIOLATION_EXCEPTION_H #include using namespace std; /** * Generic Exception class */ class RuntimeException { private: string errorMsg; public: RuntimeException(const string& err) { errorMsg = err; } string getMessage() const { return errorMsg; } }; inline std::ostream& operator<<(std::ostream& out, const RuntimeException& e) { return out << e.getMessage(); } /** * Exception thrown when illegal rank is used */ class BoundaryViolationException : public RuntimeException { public: BoundaryViolationException(const string& err) : RuntimeException(err) {} }; #endif