ATLAS Offline Software
Loading...
Searching...
No Matches
ExpressionParsing::details Namespace Reference

Functions

std::pair< RootUtils::ClingCallWrapperUncheckedReturnValue<>, TVirtualCollectionProxy * > getMethodCallAccessor (const std::string &method_name, const std::type_info &info, bool verbose)

Function Documentation

◆ getMethodCallAccessor()

std::pair< RootUtils::ClingCallWrapperUncheckedReturnValue<>, TVirtualCollectionProxy * > ExpressionParsing::details::getMethodCallAccessor ( const std::string & method_name,
const std::type_info & info,
bool verbose )

Definition at line 65 of file SGxAODProxyLoader.cxx.

65 {
66 if (verbose) {
67 std::cout << "DEBUG SGxAODProxyLoader search for " << method_name << " in type " << info.name() << std::endl;
68 }
69 TClass *containerClass = TClass::GetClass(info);
70 if (!containerClass) {
71 if (verbose) {
72 std::cout << "DEBUG SGxAODProxyLoader search for " << method_name << " in normalisze type " << SG::normalizedTypeinfoName(info) << std::endl;
73 }
74 containerClass = TClass::GetClass(SG::normalizedTypeinfoName(info).c_str());
75 if (!containerClass) {
76 std::stringstream msg;
77 msg << "No dictionary for " << info.name() << std::endl;
78 throw std::runtime_error(msg.str());
79 }
80 }
81 TClass *elementClass=nullptr;
82 TVirtualCollectionProxy *collection_proxy=nullptr;
83 if( strcmp(containerClass->GetName(),"SG::AuxElementStandaloneData")==0 ) {
84 elementClass=containerClass;
85 }
86 else {
87 collection_proxy = containerClass->GetCollectionProxy();
88 elementClass = (collection_proxy ? collection_proxy->GetValueClass() : nullptr);
89 if (!elementClass) {
90 std::stringstream msg;
91 msg << "No collection proxy or element class for " << info.name() << std::endl;
92 throw std::runtime_error(msg.str());
93 }
94 }
95 RootUtils::ClingCallWrapperUncheckedReturnValue<> method_wrapper(RootUtils::getClingCallWrapper<>(elementClass,method_name,true));
96 if (verbose) {
97 std::cout << "DEBUG SGxAODProxyLoader got method " << " . " << method_name << " : "
98 << method_wrapper.getReturnTypeNormalizedName()
99 << "wrapper="<< typeid(method_wrapper).name()
100 << std::endl;
101 }
102 return std::make_pair(method_wrapper, collection_proxy);
103 }
bool verbose
Definition hcg.cxx:73
ClingCallWrapperUncheckedReturnValue< T_MethodArgs... > getClingCallWrapper(TClass *the_class, const std::string &method_name, bool is_const)
helper method to wrap a method of a certain name with defined arguments, but arbitrary return type im...
std::string normalizedTypeinfoName(const std::type_info &info)
Convert a type_info to a normalized string representation (matching the names used in the root dictio...
MsgStream & msg
Definition testRead.cxx:32