Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
AthenaKernel/AthenaKernel/ClassName.icc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /**
6  * @file AthenaKernel/ClassName.icc
7  * @author scott snyder
8  * @date Jul 2005
9  * @brief An interface for getting the name of a class as a string.
10  * Implementation file.
11  */
12 
13 
14 /**
15  * @brief Return the name of class @c T as a string.
16  */
17 template <class T>
18 std::string ClassName<T>::name()
19 {
20  return Athena::typeinfoName (typeid (T));
21 }
22 
23 // /**
24 // * @brief Specialization of @c ClassName for @c std::vector.
25 // *
26 // * This overrides the default implementation of @c ClassName
27 // * to hide @c std::vector's second template parameter.
28 // */
29 // #include <vector>
30 // template <class T>
31 // std::string ClassName<std::vector<T> >::name()
32 // {
33 // std::string out = "std::vector<";
34 // out += ClassName<T>::name();
35 // if (out[out.size()-1] == '>')
36 // out += ' ';
37 // out += '>';
38 // return out;
39 // }
40 
41 // /**
42 // * @brief Specialization of @c ClassName for @c std::list.
43 // *
44 // * This overrides the default implementation of @c ClassName
45 // * to hide @c std::list's second template parameter.
46 // */
47 // #include <list>
48 // template <class T>
49 // std::string ClassName<std::list<T> >::name()
50 // {
51 // std::string out = "std::list<";
52 // out += ClassName<T>::name();
53 // if (out[out.size()-1] == '>')
54 // out += ' ';
55 // out += '>';
56 // return out;
57 // }
58 
59 // /**
60 // * @brief Specialization of @c ClassName for @c std::map.
61 // *
62 // * This overrides the default implementation of @c ClassName
63 // * to hide @c std::map's 4th template parameter (and optionally the 3rd too)
64 // */
65 // #include <map>
66 // template <class K, class V, class C>
67 // std::string ClassName<std::map<K, V, C> >::name()
68 // {
69 // std::string out = "std::map<";
70 // out += ClassName<K>::name()+ "," + ClassName<V>::name();
71 // std::string comp = ClassName<C>::name();
72 // if (comp.size() > 10 && comp.substr(0, 10) != "std::less<") {
73 // out += ","+ClassName<C>::name();
74 // }
75 // if (out[out.size()-1] == '>')
76 // out += ' ';
77 // out += '>';
78 // return out;
79 // }
80 
81