Defines
contrib/rpl/rgrl/rgrl_macros.h File Reference
#include <vcl_typeinfo.h>
#include <vcl_iostream.h>

Go to the source code of this file.

Defines

#define RGRL_HERE   __FILE__
#define DebugMacro(level, x)
 Macro to print the debug message in a class member functions.
#define DebugMacro_abv(level, x)
 Macro to print the debug message without preprocessor info.
#define WarningMacro(x)
 Macro to print the warning message in a class member functions.
#define WarningMacro_abv(x)
 Macro to print the warning message without class info.
#define DebugFuncMacro(flag, level, x)
 Macro to print the debug message in a stand-alone function.
#define DebugFuncMacro_abv(flag, level, x)
 Macro to print the debug message in a stand-alone function without preprocessor info.
#define rgrl_type_macro(classname, superclassname)
 Macro to define type-related functions of the class.

Detailed Description

Definition in file rgrl_macros.h.


Define Documentation

#define DebugFuncMacro (   flag,
  level,
 
)
Value:
do \
{ if (flag >= level) { \
    vcl_cout<< "Debug: " << RGRL_HERE << " ( line " \
            << __LINE__ <<" )\n" << "       "<<x; } \
} while (false)

Macro to print the debug message in a stand-alone function.

Definition at line 42 of file rgrl_macros.h.

#define DebugFuncMacro_abv (   flag,
  level,
 
)
Value:
do \
{ if (flag >= level) { vcl_cout<<"       "<<x; } \
} while (false)

Macro to print the debug message in a stand-alone function without preprocessor info.

Definition at line 49 of file rgrl_macros.h.

#define DebugMacro (   level,
 
)
Value:
do \
{ if (level == 0 || this->debug_flag() >= level) { \
    vcl_cout<< "Debug: "<< RGRL_HERE << " ( line " \
            << __LINE__ <<" )\n" << "       "<<x; } \
} while (false)

Macro to print the debug message in a class member functions.

Definition at line 16 of file rgrl_macros.h.

#define DebugMacro_abv (   level,
 
)
Value:
do \
{ if (level == 0 || this->debug_flag() >= level) { vcl_cout<<"       "<<x; } \
} while (false)

Macro to print the debug message without preprocessor info.

Definition at line 23 of file rgrl_macros.h.

#define RGRL_HERE   __FILE__

Definition at line 12 of file rgrl_macros.h.

#define rgrl_type_macro (   classname,
  superclassname 
)
Value:
typedef classname       self; \
     typedef superclassname  superclass; \
     static const vcl_type_info& type_id() \
         { return typeid(self); } \
     virtual bool is_type( const vcl_type_info& type ) const\
         { return (typeid(self) == type)!=0 || this->superclass::is_type(type); }

Macro to define type-related functions of the class.

Please note, type_id() is static, and therefore non-virtual. Always do class::type_id(), not class_instance.type_id(). If the type_id of a class instance is needed, use RTTI (run-time-type-identification), i.e. typeid(class_instance).

is_type(.) checks if the instance is a type of classname or superclass.

Definition at line 63 of file rgrl_macros.h.

#define WarningMacro (   x)
Value:
do \
{  if ( this->warning() ) { \
     vcl_cout<< "WARNING: "<< RGRL_HERE <<" ( line " \
             << __LINE__ <<" )\n" \
             << "       "<<x; }  \
} while (false)

Macro to print the warning message in a class member functions.

Definition at line 28 of file rgrl_macros.h.

#define WarningMacro_abv (   x)
Value:
do \
{ if ( this->warning() ) { \
    vcl_cout<<<"WARNING: "<<x; } \
} while (false)

Macro to print the warning message without class info.

Definition at line 36 of file rgrl_macros.h.