glucat  0.8.2
errors_imp.h
Go to the documentation of this file.
1 #ifndef _GLUCAT_ERRORS_IMP_H
2 #define _GLUCAT_ERRORS_IMP_H
3 /***************************************************************************
4  GluCat : Generic library of universal Clifford algebra templates
5  errors_imp.h : Define error functions
6  -------------------
7  begin : Sun 2001-12-20
8  copyright : (C) 2001-2007 by Paul C. Leopardi
9  ***************************************************************************
10 
11  This library is free software: you can redistribute it and/or modify
12  it under the terms of the GNU Lesser General Public License as published
13  by the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  This library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU Lesser General Public License for more details.
20 
21  You should have received a copy of the GNU Lesser General Public License
22  along with this library. If not, see <http://www.gnu.org/licenses/>.
23 
24  ***************************************************************************
25  This library is based on a prototype written by Arvind Raja and was
26  licensed under the LGPL with permission of the author. See Arvind Raja,
27  "Object-oriented implementations of Clifford algebras in C++: a prototype",
28  in Ablamowicz, Lounesto and Parra (eds.)
29  "Clifford algebras with numeric and symbolic computations", Birkhauser, 1996.
30  ***************************************************************************
31  See also Arvind Raja's original header comments in glucat.h
32  ***************************************************************************/
33 
34 namespace glucat
35 {
37  template< class Class_T >
39  error(const std::string& msg)
40  : glucat_error(Class_T::classname(), msg)
41  { }
42 
43  template< class Class_T >
45  error(const std::string& context, const std::string& msg)
46  : glucat_error(context, msg)
47  { }
48 
49  template< class Class_T >
50  const std::string
52  heading() const throw()
53  { return "Error in glucat::"; }
54 
55  template< class Class_T >
56  const std::string
58  classname() const throw()
59  { return name; }
60 
61  template< class Class_T >
62  void
65  { std::cerr << heading() << classname() << std::endl << what() << std::endl; }
66 }
67 #endif // _GLUCAT_ERRORS_IMP_H
virtual const std::string classname() const
Definition: errors_imp.h:58
virtual void print_error_msg() const
Definition: errors_imp.h:64
virtual const std::string heading() const
Definition: errors_imp.h:52
Abstract exception class.
Definition: errors.h:41
error(const std::string &msg)
Specific exception class.
Definition: errors_imp.h:39