OTB  9.0.0
Orfeo Toolbox
Namespaces | Macros
otbMacro.h File Reference
#include "itkMacro.h"
#include "itkObject.h"
#include "otbConfigure.h"
#include "otbLogger.h"
+ Include dependency graph for otbMacro.h:

Go to the source code of this file.

Namespaces

 otb
 

Macros

#define otbClassContext(x)   << this->GetNameOfClass() << " (" << this << "): " x
 
#define otbControlConditionTestMacro(condition, message)
 
#define otbDebugMacro(x)   otbLogMacro(Debug, otbFileContext(otbClassContext(x)))
 
#define otbFileContext(x)   << "file " __FILE__ ", line " << __LINE__ << ", " x
 
#define otbGenericMsgDebugMacro(x)   otbLogMacro(Debug, x)
 
#define otbGenericMsgTestingMAcro(x)   otbLogMacro(Info, "[testing] " << x)
 
#define otbGenericWarningMacro(x)   otbLogMacro(Warning, otbFileContext(x))
 
#define otbLogMacro(level, msg)
 
#define otbMsgDebugMacro(x)   otbLogMacro(Debug, otbFileContext(x))
 
#define otbMsgDevMacro(x)   otbLogMacro(Debug, otbFileContext(x))
 
#define otbWarningMacro(x)   otbLogMacro(Warning, otbFileContext(otbClassContext(x)))
 
#define __has_attribute(attr)   0
 
#define OTB_FALLTHROUGH
 
#define otbGenericExceptionMacro(T, x)
 
#define otbGetObjectMemberConstMacro(object, name, type)
 
#define otbGetObjectMemberConstReferenceMacro(object, name, type)
 
#define otbGetObjectMemberMacro(object, name, type)
 
#define otbSetObjectMemberMacro(object, name, type)
 
#define otbTestingCheckNotValidCommand(command)
 
#define otbTestingCheckValidCommand(command)
 
#define otbUnusedMacro(x)
 
#define otbUseInDebug(name)   name
 
#define otbUseInRelease(name)
 

Macro Definition Documentation

◆ __has_attribute

#define __has_attribute (   attr)    0

Set built-in type. Creates member Set"name"() (e.g., SetVisibility());

Definition at line 208 of file otbMacro.h.

◆ OTB_FALLTHROUGH

#define OTB_FALLTHROUGH

Set built-in type. Creates member Set"name"() (e.g., SetVisibility());

Definition at line 216 of file otbMacro.h.

◆ otbClassContext

#define otbClassContext (   x)    << this->GetNameOfClass() << " (" << this << "): " x

Definition at line 49 of file otbMacro.h.

◆ otbControlConditionTestMacro

#define otbControlConditionTestMacro (   condition,
  message 
)
Value:
{ \
if ((condition)) \
itkGenericExceptionMacro(<< message); \
}

This macro is used to control condition. It use ONLY by the OTB developers

Definition at line 72 of file otbMacro.h.

◆ otbDebugMacro

#define otbDebugMacro (   x)    otbLogMacro(Debug, otbFileContext(otbClassContext(x)))

Definition at line 61 of file otbMacro.h.

◆ otbFileContext

#define otbFileContext (   x)    << "file " __FILE__ ", line " << __LINE__ << ", " x

Definition at line 47 of file otbMacro.h.

◆ otbGenericExceptionMacro

#define otbGenericExceptionMacro (   T,
 
)
Value:
{ \
std::ostringstream message; \
message << "otb::ERROR: " x; \
T e_(__FILE__, __LINE__, message.str(), ITK_LOCATION); \
throw e_; \
}

Set built-in type. Creates member Set"name"() (e.g., SetVisibility());

Definition at line 144 of file otbMacro.h.

◆ otbGenericMsgDebugMacro

#define otbGenericMsgDebugMacro (   x)    otbLogMacro(Debug, x)

Definition at line 63 of file otbMacro.h.

◆ otbGenericMsgTestingMAcro

#define otbGenericMsgTestingMAcro (   x)    otbLogMacro(Info, "[testing] " << x)

Definition at line 67 of file otbMacro.h.

◆ otbGenericWarningMacro

#define otbGenericWarningMacro (   x)    otbLogMacro(Warning, otbFileContext(x))

Definition at line 66 of file otbMacro.h.

◆ otbGetObjectMemberConstMacro

#define otbGetObjectMemberConstMacro (   object,
  name,
  type 
)
Value:
virtual type Get##name() const \
{ \
itkDebugMacro("returning " << #name " of " << this->m_##object->Get##name()); \
return this->m_##object->Get##name(); \
}

Get built-in type. Creates member Get"name"() (e.g., GetVisibility()); This is the "const" form of the itkGetMacro. It should be used unless the member can be changed through the "Get" access routine.

Definition at line 100 of file otbMacro.h.

◆ otbGetObjectMemberConstReferenceMacro

#define otbGetObjectMemberConstReferenceMacro (   object,
  name,
  type 
)
Value:
virtual const type& Get##name() const \
{ \
itkDebugMacro("returning " << #name " of " << this->m_##object->Get##name()); \
return this->m_##object->Get##name(); \
}

Get built-in type. Creates member Get"name"() (e.g., GetVisibility()); This is the "const" form of the itkGetMacro. It should be used unless the member can be changed through the "Get" access routine. This versions returns a const reference to the variable.

Definition at line 112 of file otbMacro.h.

◆ otbGetObjectMemberMacro

#define otbGetObjectMemberMacro (   object,
  name,
  type 
)
Value:
virtual type Get##name() \
{ \
itkDebugMacro("returning " << #name " of " << this->m_##object->Get##name()); \
return this->m_##object->Get##name(); \
}

Get built-in type. Creates member Get"name"() (e.g., GetVisibility());

Definition at line 89 of file otbMacro.h.

◆ otbLogMacro

#define otbLogMacro (   level,
  msg 
)
Value:
{ \
std::ostringstream itkmsg; \
itkmsg msg << "\n"; \
otb::Logger::Instance()->level(itkmsg.str().c_str()); \
}

Definition at line 52 of file otbMacro.h.

◆ otbMsgDebugMacro

#define otbMsgDebugMacro (   x)    otbLogMacro(Debug, otbFileContext(x))

Definition at line 62 of file otbMacro.h.

◆ otbMsgDevMacro

#define otbMsgDevMacro (   x)    otbLogMacro(Debug, otbFileContext(x))

Definition at line 64 of file otbMacro.h.

◆ otbSetObjectMemberMacro

#define otbSetObjectMemberMacro (   object,
  name,
  type 
)
Value:
virtual void Set##name(const type _arg) \
{ \
itkDebugMacro("setting member " #name " to " << _arg); \
this->m_##object->Set##name(_arg); \
this->Modified(); \
}

Set built-in type. Creates member Set"name"() (e.g., SetVisibility());

Definition at line 79 of file otbMacro.h.

◆ otbTestingCheckNotValidCommand

#define otbTestingCheckNotValidCommand (   command)

Set built-in type. Creates member Set"name"() (e.g., SetVisibility());

Definition at line 152 of file otbMacro.h.

◆ otbTestingCheckValidCommand

#define otbTestingCheckValidCommand (   command)
Value:
{ \
try \
{ \
command; \
} \
catch (const std::exception&) \
{ \
throw; \
} \
catch (...) \
{ \
std::ostringstream message; \
message << "otb::ERROR Unknown error while running " << #command << " (catch(...) )"; \
::itk::ExceptionObject e_(__FILE__, __LINE__, message.str(), ITK_LOCATION); \
throw e_; \
} \
std::cout << " Checking valid command " << #command " ok." << std::endl; \
}

Testing macro. This macro doesn't throw a exception if the called command generate a itk::ExceptionObject object. For all others use cases, the macro generate a exception.

Definition at line 123 of file otbMacro.h.

◆ otbUnusedMacro

#define otbUnusedMacro (   x)
Value:
do \
{ \
(void)sizeof(x); \
} while (0)

Set built-in type. Creates member Set"name"() (e.g., SetVisibility());

Definition at line 188 of file otbMacro.h.

◆ otbUseInDebug

#define otbUseInDebug (   name)    name

Set built-in type. Creates member Set"name"() (e.g., SetVisibility());

Definition at line 198 of file otbMacro.h.

◆ otbUseInRelease

#define otbUseInRelease (   name)

Set built-in type. Creates member Set"name"() (e.g., SetVisibility());

Definition at line 199 of file otbMacro.h.

◆ otbWarningMacro

#define otbWarningMacro (   x)    otbLogMacro(Warning, otbFileContext(otbClassContext(x)))

Definition at line 65 of file otbMacro.h.

otb::Logger::Instance
static Logger * Instance()