MIRA
Macros | Functions
Inspect.h File Reference

Provides the MIRA_INSPECT macro. More...

#include <iostream>
#include <string>
#include <vector>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
Include dependency graph for Inspect.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MIRA_INSPECT(...)   _MIRA_INSPECT(__VA_ARGS__, #__VA_ARGS__)
 Helper macro that prints the value of one or more variables on the console. More...
 
#define _MIRA_INSPECT_COMMON
 
#define _MIRA_INSPECT_END
 

Functions

template<typename A >
void _MIRA_INSPECT (const A &a, const char *names)
 
template<typename A , typename B >
void _MIRA_INSPECT (const A &a, const B &b, const char *names)
 
template<typename A , typename B , typename C >
void _MIRA_INSPECT (const A &a, const B &b, const C &c, const char *names)
 
template<typename A , typename B , typename C , typename D >
void _MIRA_INSPECT (const A &a, const B &b, const C &c, const D &d, const char *names)
 
template<typename A , typename B , typename C , typename D , typename E >
void _MIRA_INSPECT (const A &a, const B &b, const C &c, const D &d, const E &e, const char *names)
 
template<typename A , typename B , typename C , typename D , typename E , typename F >
void _MIRA_INSPECT (const A &a, const B &b, const C &c, const D &d, const E &e, const F &f, const char *names)
 
template<typename A , typename B , typename C , typename D , typename E , typename F , typename G >
void _MIRA_INSPECT (const A &a, const B &b, const C &c, const D &d, const E &e, const F &f, const G &g, const char *names)
 

Detailed Description

Provides the MIRA_INSPECT macro.

Author
Erik Einhorn
Date
2010/09/28

Macro Definition Documentation

◆ MIRA_INSPECT

#define MIRA_INSPECT (   ...)    _MIRA_INSPECT(__VA_ARGS__, #__VA_ARGS__)

Helper macro that prints the value of one or more variables on the console.

To inspect a value of a variable you often have to write:

int a, b, c;
cout << "a=" << a ", b=" << b << ", c=" << c << endl;

With this macro it's sufficient to write:

The output on the console will then be:

a = ...
b = ...
c = ...
Note
This macro will be disabled automatically in release builds.

◆ _MIRA_INSPECT_COMMON

#define _MIRA_INSPECT_COMMON
Value:
std::string s(names); \
std::vector<std::string> v; \
boost::algorithm::split(v, s, boost::algorithm::is_from_range(',',','));

◆ _MIRA_INSPECT_END

#define _MIRA_INSPECT_END

Function Documentation

◆ _MIRA_INSPECT() [1/7]

void _MIRA_INSPECT ( const A &  a,
const char *  names 
)

◆ _MIRA_INSPECT() [2/7]

void _MIRA_INSPECT ( const A &  a,
const B &  b,
const char *  names 
)

◆ _MIRA_INSPECT() [3/7]

void _MIRA_INSPECT ( const A &  a,
const B &  b,
const C &  c,
const char *  names 
)

◆ _MIRA_INSPECT() [4/7]

void _MIRA_INSPECT ( const A &  a,
const B &  b,
const C &  c,
const D &  d,
const char *  names 
)

◆ _MIRA_INSPECT() [5/7]

void _MIRA_INSPECT ( const A &  a,
const B &  b,
const C &  c,
const D &  d,
const E &  e,
const char *  names 
)

◆ _MIRA_INSPECT() [6/7]

void _MIRA_INSPECT ( const A &  a,
const B &  b,
const C &  c,
const D &  d,
const E &  e,
const F &  f,
const char *  names 
)

◆ _MIRA_INSPECT() [7/7]

void _MIRA_INSPECT ( const A &  a,
const B &  b,
const C &  c,
const D &  d,
const E &  e,
const F &  f,
const G &  g,
const char *  names 
)