OTB  6.7.0
Orfeo Toolbox
mvdSystemError.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef mvdSystemError_h
22 #define mvdSystemError_h
23 
24 //
25 // Configuration include.
27 #include "ConfigureMonteverdi.h"
28 
29 #include "OTBMonteverdiCoreExport.h"
30 
31 /*****************************************************************************/
32 /* INCLUDE SECTION */
33 
34 //
35 // Qt includes (sorted by alphabetic order)
37 
38 //
39 // System includes (sorted by alphabetic order)
40 #include <stdexcept>
41 
42 //
43 // ITK includes (sorted by alphabetic order)
44 #include "itksys/SystemTools.hxx"
45 
46 //
47 // OTB includes (sorted by alphabetic order)
48 
49 //
50 // Monteverdi includes (sorted by alphabetic order)
51 
52 /*****************************************************************************/
53 /* PRE-DECLARATION SECTION */
54 
55 //
56 // External classes pre-declaration.
57 namespace
58 {
59 }
60 
61 namespace mvd
62 {
63 //
64 // Internal classes pre-declaration.
65 
66 
67 /*****************************************************************************/
68 /* CLASS DEFINITION SECTION */
69 
77 class OTBMonteverdiCore_EXPORT SystemError :
78  public std::runtime_error
79 {
80 
81  /*-[ PUBLIC SECTION ]------------------------------------------------------*/
82 
83 //
84 // Public methods.
85 public:
86 
88  SystemError( const std::string& message =std::string() ) :
89  std::runtime_error( itksys::SystemTools::GetLastSystemError()
90  + ": " + message) {};
91 
93  ~SystemError() throw() override {};
94 
95  /*-[ PROTECTED SECTION ]---------------------------------------------------*/
96 
97 //
98 // Protected methods.
99 protected:
100 
101 //
102 // Protected attributes.
103 protected:
104 
105  /*-[ PRIVATE SECTION ]-----------------------------------------------------*/
106 
107 //
108 // Private methods.
109 private:
113 //
114 // Private attributes.
115 private:
116 
117 };
118 
119 } // end namespace 'mvd'.
120 
121 /*****************************************************************************/
122 /* INLINE SECTION */
123 
124 
125 #endif // mvdSystemError_h
~SystemError() override
Destructor.
SystemError(const std::string &message=std::string())
Constructor.