KiTrack  1.7.0
KiTrackExceptions.h
1 #ifndef KiTrackExceptions_h
2 #define KiTrackExceptions_h
3 
4 #include <string>
5 #include <exception>
6 
7 //Exceptions for the KiTrack namespace
8 
9 namespace KiTrack {
10 
16  class KiTrackException : public std::exception {
17 
18 
19  protected:
20  std::string message ;
21 
22  KiTrackException(){ /*no_op*/ ; }
23 
24  public:
25  virtual ~KiTrackException() throw() { /*no_op*/; }
26 
27  KiTrackException( const std::string& text ){
28  message = "KiTrack::Exception: " + text ;
29  }
30 
31  virtual const char* what() const throw() { return message.c_str() ; }
32 
33  };
34 
35 
36 
40  class OutOfRange : public KiTrackException{
41 
42  protected:
43  OutOfRange() { /*no_op*/ ; }
44  public:
45  virtual ~OutOfRange() throw() { /*no_op*/; }
46 
47  OutOfRange( std::string text ){
48  message = "KiTrack::OutOfRange: " + text ;
49  }
50  };
51 
52 
57 
58  protected:
59  InvalidParameter() { /*no_op*/ ; }
60  public:
61  virtual ~InvalidParameter() throw() { /*no_op*/; }
62 
63  InvalidParameter( std::string text ){
64  message = "KiTrack::InvalidParameter: " + text ;
65  }
66  };
67 
68 
73 
74  protected:
75  BadSegmentLength() { /*no_op*/ ; }
76  public:
77  virtual ~BadSegmentLength() throw() { /*no_op*/; }
78 
79  BadSegmentLength( std::string text ){
80  message = "KiTrack::BadSegmentLength: " + text ;
81  }
82  };
83 
84 
85 
90 
91  protected:
92  UnknownCriterion() { /*no_op*/ ; }
93  public:
94  virtual ~UnknownCriterion() throw() { /*no_op*/; }
95 
96  UnknownCriterion( std::string text ){
97  message = "KiTrack::UnknownCriterion: " + text ;
98  }
99  };
100 
101 }
102 
103 #endif
104 
105 
Invalid Parameter exception.
Definition: KiTrackExceptions.h:56
Out of range exception, used when the user tries to access layers oder sensors, that are not implemen...
Definition: KiTrackExceptions.h:40
Wrong segment length exception.
Definition: KiTrackExceptions.h:72
Unknown criterion exception.
Definition: KiTrackExceptions.h:89
Base exception class for KiTrack - all other exceptions extend this.
Definition: KiTrackExceptions.h:16