1 // -*-C++-*- 2 // error.h (Class structures for errors thrown by the WFMath library) 3 // 4 // The WorldForge Project 5 // Copyright (C) 2001 The WorldForge Project 6 // 7 // This program is free software; you can redistribute it and/or modify 8 // it under the terms of the GNU General Public License as published by 9 // the Free Software Foundation; either version 2 of the License, or 10 // (at your option) any later version. 11 // 12 // This program is distributed in the hope that it will be useful, 13 // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 // GNU General Public License for more details. 16 // 17 // You should have received a copy of the GNU General Public License 18 // along with this program; if not, write to the Free Software 19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 // 21 // For information about WorldForge and its authors, please contact 22 // the Worldforge Web Site at http://www.worldforge.org. 23 24 // Author: Ron Steinke 25 // Created: 2001-12-7 26 27 #ifndef WFMATH_ERROR_H 28 #define WFMATH_ERROR_H 29 30 #include <stdexcept> 31 #include <wfmath/vector.h> 32 33 namespace WFMath { 34 35 /// An error thrown by certain functions when passed parallel vectors. 36 template<int dim> 37 struct ColinearVectors : virtual public std::exception { ColinearVectorsColinearVectors38 ColinearVectors(const Vector<dim>& v1_in, const Vector<dim>& v2_in) 39 : v1(v1_in), v2(v2_in) {} ~ColinearVectorsColinearVectors40 virtual ~ColinearVectors() throw () { } 41 42 Vector<dim> v1, v2; 43 }; 44 45 /// An error thrown by operator>>() when it fails to parse wfmath types 46 struct ParseError : virtual public std::exception { ~ParseErrorParseError47 virtual ~ParseError() throw () { } 48 }; 49 50 } // namespace WFMath 51 52 #endif // WFMATH_ERROR_H 53