About the MRPT_START / MRPT_END macros

Most MRPT functions and methods have the pair of macros MRPT_START and MRPT_END around their code:

These macros have two simultaneous purposes:

 

  • Exception propagation: To build the reverse call stack textual representation of exceptions.
  • Global profiler: If the CMake flag MRPT_ENABLE_EMBEDDED_GLOBAL_PROFILER is enabled, all MRPT_START/MRPT_END blocks will automatically become profiled, and at the end of execution of any program a big table with stats will be dumped to console with the number of invokations, min, average and max execution times of all functions.

Note that users could also put these macros around their code as well in order to extend both effects above to their programs.