CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/SLHCUpgradeSimulations/L1TrackTrigger/interface/classNameFinder.h

Go to the documentation of this file.
00001 #ifndef classNameFinder_h
00002 #define classNameFinder_h
00003 
00004 #include <string>
00005 #include <typeinfo>
00006 
00007 template<class T>
00008 std::string classNameFinder(std::string fName) {
00009   int status2=0;
00010   char *dm2=abi::__cxa_demangle(typeid(T).name(),0,0,&status2);
00011   std::string s2="failed demangle";
00012   if ( status2==0)
00013     s2=std::string(dm2);
00014   return (fName+std::string("< ")+s2+std::string(" >"));
00015 }
00016 
00017 template<class T>
00018 std::string templateNameFinder() {
00019   int status2=0;
00020   char *dm2=abi::__cxa_demangle(typeid(T).name(),0,0,&status2);
00021   std::string s2="failed demangle";
00022   if ( status2==0)
00023     s2=std::string(dm2);
00024   return s2;
00025 }
00026 
00027 #endif