SimpleITK  1.2.4
sitkExceptionObject.h
Go to the documentation of this file.
1 /*=========================================================================
2 *
3 * Copyright Insight Software Consortium
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18 #ifndef sitkExceptionObject_h
19 #define sitkExceptionObject_h
20 
21 #include "sitkMacro.h"
22 #include "sitkCommon.h"
23 
24 #ifndef sitkMacro_h
25 #error "sitkMacro.h must be included before sitkExceptionObject.h"
26 #endif // sitkMacro_h
27 #ifndef sitkCommon_h
28 #error "sitkCommon.h must be included before sitkExceptionObject.h"
29 #endif // sitkCommon_h
30 
31 
32 namespace itk
33 {
34 
35 // forward declaration for encapsulation
36 class ExceptionObject;
37 
38 namespace simple
39 {
40 
45  public std::exception
46 {
47 public:
52 
54  GenericException(const char *file, unsigned int lineNumber) SITK_NOEXCEPT;
55 
57  GenericException(const std::string & file, unsigned int lineNumber) SITK_NOEXCEPT;
58 
60  GenericException(const std::string & file,
61  unsigned int lineNumber,
62  const std::string & desc) SITK_NOEXCEPT;
63 
66 
68  GenericException & operator=(const GenericException & orig);
69 
71  virtual bool operator==(const GenericException & orig) const;
72 
73 
75  std::string ToString() const;
76 
77  const char * what() const SITK_NOEXCEPT;
78 
79  virtual const char * GetNameOfClass() const;
80 
81  virtual const char * GetLocation() const;
82 
83  virtual const char * GetDescription() const;
84 
86  virtual const char * GetFile() const;
87 
89  virtual unsigned int GetLine() const;
90 
91 private:
92  const ExceptionObject *m_PimpleException;
93 };
94 
95 }
96 }
97 
98 #endif // sitkExceptionObject_h
bool operator==(const NeighborhoodAllocator< TPixel > &lhs, const NeighborhoodAllocator< TPixel > &rhs)
#define SITKCommon_EXPORT
Definition: sitkCommon.h:41
const ExceptionObject * m_PimpleException
#define SITK_NOEXCEPT
Definition: sitkMacro.h:68
The base SimpleITK exception class.