C++Instrument Catalog MFC 1.2
Metrolab C++InstrumentCatalog for MFC
Loading...
Searching...
No Matches
Helpers.h File Reference

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

#include <functional>
#include <mutex>
#include <iostream>
#include <sstream>
#include <cassert>
#include <thread>
#include <chrono>
Include dependency graph for Helpers.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  MTL
namespace  MTL::CerrSinkRedir

Macros

#define MTL__STR_HELPER__(x)
#define MTL__STR__(x)
#define MTL__LOCATION_HELPER__   __FILE__ ":" MTL__STR__(__LINE__)
#define MTL__LOCATION__   (MTL__LOCATION_HELPER__)
#define CERR(__X__)
#define COUT(__X__)
#define WCOUT(__X__)
#define MTL_Assert   assert
#define MTL_StaticAssert   static_assert
#define MTL_SleepMs(_ms_)
#define MTL_Unused(x)

Typedefs

using MTL::CerrSinkRedir::tOutputSink = std::function<void(const std::string &)>

Functions

tOutputSink & MTL::CerrSinkRedir::CerrSink ()
std::mutex & MTL::CerrSinkRedir::CerrSinkMutex ()
void MTL::CerrSinkRedir::WriteCerr (const std::string &rMessage)
CerrSinkRedir::tOutputSink MTL::SetCerrSink (CerrSinkRedir::tOutputSink rSink)
void MTL::ResetCerrSink ()

Detailed Description

Collection of utility macros for error messages.

Definition in file Helpers.h.

Macro Definition Documentation

◆ CERR

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

Definition at line 81 of file Helpers.h.

◆ COUT

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

Definition at line 83 of file Helpers.h.

◆ MTL__LOCATION__

#define MTL__LOCATION__   (MTL__LOCATION_HELPER__)

Definition at line 24 of file Helpers.h.

◆ MTL__LOCATION_HELPER__

#define MTL__LOCATION_HELPER__   __FILE__ ":" MTL__STR__(__LINE__)

Definition at line 23 of file Helpers.h.

◆ MTL__STR__

#define MTL__STR__ ( x)
Value:
#define MTL__STR_HELPER__(x)
Definition Helpers.h:21

Definition at line 22 of file Helpers.h.

◆ MTL__STR_HELPER__

#define MTL__STR_HELPER__ ( x)
Value:
#x

Definition at line 21 of file Helpers.h.

◆ MTL_Assert

#define MTL_Assert   assert

Definition at line 102 of file Helpers.h.

◆ MTL_SleepMs

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

Definition at line 104 of file Helpers.h.

◆ MTL_StaticAssert

#define MTL_StaticAssert   static_assert

Definition at line 103 of file Helpers.h.

◆ MTL_Unused

#define MTL_Unused ( x)
Value:
(void)x;

Definition at line 105 of file Helpers.h.

◆ WCOUT

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

Definition at line 84 of file Helpers.h.