 |
Orfeo Toolbox
3.16
|
Go to the documentation of this file.
30 #include "otbConfigure.h"
44 #define otbDebugMacro(x) itkDebugMacro(x)
53 #define otbMsgDebugMacro(x) \
55 if (this->GetDebug() && ::itk::Object::GetGlobalWarningDisplay()) \
57 std::ostringstream itkmsg; \
58 itkmsg << " Msg Debug: " x << "\n"; \
59 ::itk::OutputWindowDisplayDebugText(itkmsg.str().c_str()); \
65 #define otbGenericMsgDebugMacro(x) \
67 if (::itk::Object::GetGlobalWarningDisplay()) \
69 std::ostringstream itkmsg; \
70 itkmsg << " Generic Msg Debug: " x << "\n"; \
71 ::itk::OutputWindowDisplayDebugText(itkmsg.str().c_str()); \
75 #define otbGenericMsgDebugMacro(x)
78 #define otbGenericMsgTestingMacro(x) \
80 std::cout x << std::endl; \
83 #ifdef OTB_SHOW_ALL_MSG_DEBUG
84 #define otbMsgDevMacro(x) \
87 std::ostringstream itkmsg; \
88 itkmsg << " Msg Dev: (" << __FILE__ << ":" << __LINE__ << ") " x << "\n"; \
89 ::itk::OutputWindowDisplayDebugText(itkmsg.str().c_str()); \
93 #define otbMsgDevMacro(x)
99 #define otbWarningMacro(x) \
101 if (itk::Object::GetGlobalWarningDisplay()) \
103 std::ostringstream itkmsg; \
104 itkmsg << "WARNING: In " __FILE__ ", line " << __LINE__ << "\n" \
105 << this->GetNameOfClass() << " (" << this << "): " x \
107 itk::OutputWindowDisplayWarningText(itkmsg.str().c_str()); \
111 #define otbGenericWarningMacro(x) \
113 if (itk::Object::GetGlobalWarningDisplay()) \
115 std::ostringstream itkmsg; \
116 itkmsg << "WARNING: In " __FILE__ ", line " << __LINE__ << ": " x <<"\n";\
117 itk::OutputWindowDisplayWarningText(itkmsg.str().c_str()); \
124 #define otbControlConditionTestMacro(condition, message) \
126 if ((condition)) itkGenericExceptionMacro(<< message); \
130 #define otbSetObjectMemberMacro(object, name, type) \
131 virtual void Set ## name (const type _arg) \
133 itkDebugMacro("setting member " # name " to " << _arg); \
134 this->m_ ## object->Set ## name(_arg); \
139 #define otbGetObjectMemberMacro(object, name, type) \
140 virtual type Get ## name () \
142 itkDebugMacro("returning " << # name " of " << this->m_ ## object->Get ## name()); \
143 return this->m_ ## object->Get ## name(); \
149 #define otbGetObjectMemberConstMacro(object, name, type) \
150 virtual type Get ## name () const \
152 itkDebugMacro("returning " << # name " of " << this->m_ ## object->Get ## name()); \
153 return this->m_ ## object->Get ## name(); \
160 #define otbGetObjectMemberConstReferenceMacro(object, name, type) \
161 virtual const type &Get ## name () const \
163 itkDebugMacro("returning " << # name " of " << this->m_ ## object->Get ## name()); \
164 return this->m_ ## object->Get ## name(); \
170 #define otbTestingCheckValidCommand(command) \
176 catch (const std::exception&) { \
180 std::ostringstream message; \
181 message << "otb::ERROR Unknow error while running " << # command << " (catch(...) )"; \
182 ::itk::ExceptionObject e_(__FILE__, __LINE__, message.str().c_str(), ITK_LOCATION); \
185 std::cout << " Checking valid command " << # command " ok." << std::endl; \
188 #define otbGenericExceptionMacro(T, x) \
190 ::itk::OStringStream message; \
191 message << "otb::ERROR: " x; \
192 T e_(__FILE__, __LINE__, message.str(),ITK_LOCATION); \
196 #define otbTestingCheckNotValidCommand(command) \
203 catch (std::bad_alloc& err) { \
205 catch (itk::ExceptionObject&) { std::cout << "Checking not valid Command " << # command " ok." << std::endl; \
207 catch (const std::exception& stde) { \
211 std::ostringstream message; \
212 message << "otb::ERROR Unknow error while running " << # command << " (catch(...) )"; \
213 ::itk::ExceptionObject e_(__FILE__, __LINE__, message.str().c_str(), ITK_LOCATION); \
218 std::ostringstream message; \
219 message << "otb::ERROR: " << # command << " should be throwing an exception."; \
220 ::itk::ExceptionObject e_(__FILE__, __LINE__, message.str().c_str(), ITK_LOCATION); \
225 #endif //end of otbMacro.h
Generated at Sun May 26 2013 00:37:03 for Orfeo Toolbox with doxygen 1.8.3.1