Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
Utilities
General
interface
ClassName.h
Go to the documentation of this file.
1
#ifndef UTILITIES_GENERAL_CLASSNAME_H
2
#define UTILITIES_GENERAL_CLASSNAME_H
3
//
4
#include <typeinfo>
5
#include <string>
6
#include <cstdlib>
7
8
inline
std::string
firstNonNumeric
(
const
char
* sc) {
9
std::string
s
(sc);
10
size_t
pos = s.find_first_not_of(
"0123456789"
);
11
s.erase(0,pos);
12
return
s
;
13
}
14
15
class
Demangle
{
16
public
:
17
Demangle
(
const
char
* sc);
18
19
const
char
*
operator()
()
const
{
return
demangle
;}
20
21
~Demangle
() {
if
(
demangle
) free((
void
*)
demangle
); }
22
23
private
:
24
25
char
*
demangle
;
26
};
27
28
29
template
<
class
T>
30
inline
std::string
className
(
const
T
&
t
) {
31
return
std::string
(
Demangle
(
typeid
(t).
name
())());
32
}
33
34
template
<
class
T>
35
class
ClassName
{
36
public
:
37
static
const
std::string
&
name
() {
38
static
const
std::string
ln(
Demangle
(
typeid
(
T
).
name
())());
39
return
ln;
40
}
41
};
42
43
#endif // UTILITIES_GENERAL_CLASSNAME_H
firstNonNumeric
std::string firstNonNumeric(const char *sc)
Definition:
ClassName.h:8
Demangle::operator()
const char * operator()() const
Definition:
ClassName.h:19
ClassName
Definition:
ClassName.h:35
mergeVDriftHistosByStation.name
string name
Definition:
mergeVDriftHistosByStation.py:77
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
edmStreamStallGrapher.t
tuple t
Definition:
edmStreamStallGrapher.py:108
ClassName::name
static const std::string & name()
Definition:
ClassName.h:37
Demangle::~Demangle
~Demangle()
Definition:
ClassName.h:21
Demangle::Demangle
Demangle(const char *sc)
Definition:
ClassName.cc:5
Demangle::demangle
char * demangle
Definition:
ClassName.h:25
alignCSCRings.s
list s
Definition:
alignCSCRings.py:91
Demangle
Definition:
ClassName.h:15
T
long double T
Definition:
Basic3DVectorLD.h:57
className
std::string className(const T &t)
Definition:
ClassName.h:30
Generated for CMSSW Reference Manual by
1.8.5