C++ Instrument Catalog
Macros
Helpers.h File Reference

Collection of utility macros for error messages. More...

#include <iostream>
#include <sstream>
#include <cassert>
#include <thread>
#include <chrono>

Go to the source code of this file.

Macros

#define MTL__STR_HELPER__(x)   #x
 
#define MTL__STR__(x)   MTL__STR_HELPER__(x)
 
#define MTL__LOCATION_HELPER__   __FILE__ ":" MTL__STR__(__LINE__)
 
#define MTL__LOCATION__   (MTL__LOCATION_HELPER__)
 
#define CERR(__X__)   std::cerr << __X__
 
#define COUT(__X__)   std::cout << __X__
 
#define WCOUT(__X__)   std::wcout << __X__
 
#define MTL_Assert   assert
 
#define MTL_StaticAssert   static_assert
 
#define MTL_SleepMs(_ms_)   std::this_thread::sleep_for(std::chrono::milliseconds(_ms_))
 
#define MTL_Unused(x)   (void)x;
 

Detailed Description

Collection of utility macros for error messages.

Definition in file Helpers.h.

Macro Definition Documentation

◆ CERR

#define CERR (   __X__)    std::cerr << __X__

Definition at line 28 of file Helpers.h.

◆ COUT

#define COUT (   __X__)    std::cout << __X__

Definition at line 29 of file Helpers.h.

◆ MTL__LOCATION__

#define MTL__LOCATION__   (MTL__LOCATION_HELPER__)

Definition at line 22 of file Helpers.h.

◆ MTL__LOCATION_HELPER__

#define MTL__LOCATION_HELPER__   __FILE__ ":" MTL__STR__(__LINE__)

Definition at line 21 of file Helpers.h.

◆ MTL__STR__

#define MTL__STR__ (   x)    MTL__STR_HELPER__(x)

Definition at line 20 of file Helpers.h.

◆ MTL__STR_HELPER__

#define MTL__STR_HELPER__ (   x)    #x

Definition at line 19 of file Helpers.h.

◆ MTL_Assert

#define MTL_Assert   assert

Definition at line 44 of file Helpers.h.

◆ MTL_SleepMs

#define MTL_SleepMs (   _ms_)    std::this_thread::sleep_for(std::chrono::milliseconds(_ms_))

Definition at line 46 of file Helpers.h.

◆ MTL_StaticAssert

#define MTL_StaticAssert   static_assert

Definition at line 45 of file Helpers.h.

◆ MTL_Unused

#define MTL_Unused (   x)    (void)x;

Definition at line 47 of file Helpers.h.

◆ WCOUT

#define WCOUT (   __X__)    std::wcout << __X__

Definition at line 30 of file Helpers.h.