| The Gaudi Framework v32r1 (f65d50dc)

Functions
Gaudi::PluginService::v2::Details Namespace Reference

## Functions
std::string | demangle (const std::string &id)
std::string | demangle (const std::type_info &id)
void | reportBadAnyCast (const std::type_info &factory_type, const std::string &id)
Logger & | logger ()
void | setLogger (Logger *logger)
std::string | getDSONameFor (void *fptr)

## Function Documentation

## ◆ demangle() [1/2]

std::string Gaudi::PluginService::v2::Details::demangle | ( | const std::string & | id | ) |

Definition at line 98 of file PluginServiceV2.cpp.

98 {
99 int status;
100 auto realname = std::unique_ptr<char, decltype( free )*>(
101 abi::__cxa_demangle( id.c_str(), nullptr, nullptr, &status ), free );
102 if ( !realname ) return id;
103 #if _GLIBCXX_USE_CXX11_ABI
104 return std::regex_replace(
105 realname.get(),
106 std::regex{"std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >( (?=>))?"},
107 "std::string" );
108 #else
109 return std::string{realname.get()};
110 #endif
111 }
std::string
STL class.
std::regex_replace
T regex_replace(T... args)
std::unique_ptr
STL class.
std::regex

## ◆ demangle() [2/2]

std::string Gaudi::PluginService::v2::Details::demangle | ( | const std::type_info & | id | ) |

Definition at line 112 of file PluginServiceV2.cpp.

112 { return demangle( id.name() ); }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
Gaudi::PluginService::v2::Details::demangle
std::string demangle(const std::type_info &id)
Definition: PluginServiceV2.cpp:112

## ◆ getDSONameFor()

std::string Gaudi::PluginService::v2::Details::getDSONameFor | ( | void * | fptr | ) |

Definition at line 306 of file PluginServiceV2.cpp.

306 {
307 #ifdef _GNU_SOURCE
308 Dl_info info;
309 if ( dladdr( fptr, &info ) == 0 ) return "";
310
311 auto pos = std::strrchr( info.dli_fname, '/' );
312 if ( pos )
313 ++pos;
314 else
315 return info.dli_fname;
316 return pos;
317 #else
318 return "";
319 #endif
320 }
std::strrchr
T strrchr(T... args)

## ◆ logger()

Logger& Gaudi::PluginService::v2::Details::logger | ( |  | ) |

Definition at line 302 of file PluginServiceV2.cpp.

302 { return *s_logger; }

## ◆ reportBadAnyCast()

void Gaudi::PluginService::v2::Details::reportBadAnyCast | ( | const std::type_info & | factory_type,
|  | const std::string & | id
| ) |  |

Definition at line 120 of file PluginServiceV2.cpp.

120 {
121 if ( logger().level() <= Logger::Debug ) {
122 std::stringstream msg;
123 const auto& info = Registry::instance().getInfo( id );
124 msg << "bad any_cast: requested factory " << id << " of type " << demangle( factory_type ) << ", got ";
125 if ( info.is_set() )
126 msg << demangle( info.factory.type() ) << " from " << info.library;
127 else
128 msg << "nothing";
129 logger().debug( msg.str() );
130 }
131 }
std::stringstream
STL class.
Gaudi::PluginService::v2::Details::demangle
std::string demangle(const std::type_info &id)
Definition: PluginServiceV2.cpp:112
GaudiMP.FdsRegistry.msg
msg
Definition: FdsRegistry.py:8
Gaudi::PluginService::v2::Details::logger
Logger & logger()
Definition: PluginServiceV2.cpp:302
gaudirun.level
level
Definition: gaudirun.py:334
Gaudi::PluginService::v2::Debug
int Debug()
Definition: PluginServiceV2.cpp:334

## ◆ setLogger()

void Gaudi::PluginService::v2::Details::setLogger | ( | Logger * | logger | ) |

Definition at line 303 of file PluginServiceV2.cpp.

303 { s_logger.reset( logger ); }
Gaudi::PluginService::v2::Details::logger
Logger & logger()
Definition: PluginServiceV2.cpp:302