]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/src/AliHLTMUONError.h
Also dropping references to AliMUONTriggerCircuit which are depricated. This is a...
[u/mrichter/AliRoot.git] / HLT / MUON / src / AliHLTMUONError.h
1 #ifndef ALIHLTMUONERROR_H
2 #define ALIHLTMUONERROR_H
3 /**************************************************************************
4  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  *                                                                        *
6  * Author: The ALICE Off-line Project.                                    *
7  * Contributors are mentioned in the code where appropriate.              *
8  *                                                                        *
9  * Permission to use, copy, modify and distribute this software and its   *
10  * documentation strictly for non-commercial purposes is hereby granted   *
11  * without fee, provided that the above copyright notice appears in all   *
12  * copies and that both the copyright notice and this permission notice   *
13  * appear in the supporting documentation. The authors make no claims     *
14  * about the suitability of this software for any purpose. It is          *
15  * provided "as is" without express or implied warranty.                  *
16  **************************************************************************/
17
18 /* $Id$ */
19
20 ////////////////////////////////////////////////////////////////////////////////
21 //
22 // Author: Artur Szostak
23 // Email:  artur@alice.phy.uct.ac.za | artursz@iafrica.com
24 //
25 // AliHLTMUONError is the base excpetion class used by the dHLT subsystem.
26 // All child classes used to throw exceptions should be derived from this
27 // class to allow easy catching of classes of errors.
28 // 
29 ////////////////////////////////////////////////////////////////////////////////
30
31 #include "AliHLTMUONBasicTypes.h"
32 #include <exception>
33 #include <ostream>
34
35
36 class AliHLTMUONError : public std::exception
37 {
38         /* Define the << operator for streams to be able to do something like:
39
40                AliHLTMUONError myerror;
41                cout << myerror << endl;
42         */
43         friend std::ostream& operator << (std::ostream& os, const AliHLTMUONError& error)
44         {
45                 os << error.Message();
46                 return os;
47         };
48         
49 public:
50
51         AliHLTMUONError() throw() {};
52         virtual ~AliHLTMUONError() throw() {};
53
54         /* Should return a human readable string containing a description of the
55            error.
56          */
57         virtual const char* Message() const throw() = 0;
58         
59         /* Returns an error code describing the error. The error code should be
60            unique to the entire system
61          */
62         virtual Int ErrorCode() const throw() = 0;
63         
64         virtual const char* what() const throw()
65         {
66                 return Message();
67         };
68 };
69
70
71 #endif // ALIHLTMUONERROR_H