1
#ifndef _RHEOLEF_PRETTY_NAME_H
2
#define _RHEOLEF_PRETTY_NAME_H
4
/// This file is part of Rheolef.
6
/// Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
8
/// Rheolef is free software; you can redistribute it and/or modify
9
/// it under the terms of the GNU General Public License as published by
10
/// the Free Software Foundation; either version 2 of the License, or
11
/// (at your option) any later version.
13
/// Rheolef is distributed in the hope that it will be useful,
14
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
15
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
/// GNU General Public License for more details.
18
/// You should have received a copy of the GNU General Public License
19
/// along with Rheolef; if not, write to the Free Software
20
/// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
/// =========================================================================
24
#include "rheolef/compiler.h"
30
NAME: @code{typeid_name_macro}, @code{pretty_name_macro} - type demangler and pretty printer
32
These preprocessor macro-definitions are usefull when dealing with complex types
33
as generated by imbricted template technics: they print in clear a complex type at run-time.
34
@code{typeid_name_macro} obtains a human readable type in a @code{std::tring} form
35
by calling the system @code{typeid} function and then a demangler.
36
When this type is very long, @code{pretty_name_macro} prints also it in a multi-line
37
form with a pretty indentation.
40
typedef map <size_t, double, less<size_t>, heap_allocator<pair<size_t,double> > > map_type;
41
cout << typeid_name_macro (map_type);
44
LJK-IMAG, 38041 Grenoble cedex 9, France
45
| Pierre.Saramito@imag.fr
46
DATE: 15 december 2010
50
extern std::string typeid_name (const char* name, bool do_indent);
52
#define typeid_name_macro(T) typeid_name(typeid(T).name(), false)
53
#define pretty_name_macro(T) typeid_name(typeid(T).name(), true)
56
} // namespace rheolef
57
#endif // _RHEOLEF_PRETTY_NAME_H