Skip to content

Commit

Permalink
Merge pull request #7244 from wmtan/RemoveUnusedFunction
Browse files Browse the repository at this point in the history
Remove unused unneeded function
  • Loading branch information
davidlt committed Jan 16, 2015
2 parents 6fe14ee + b95a82a commit 616fff8
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions FWCore/Utilities/interface/FunctionWithDict.h
Expand Up @@ -50,43 +50,4 @@ class FunctionWithDict {

} // namespace edm

#include "FWCore/Utilities/interface/ObjectWithDict.h"
#include "FWCore/Utilities/interface/TypeWithDict.h"

namespace edm {

/// Call a static function of class theType, with a return
/// value of type T, by name with no arguments.
template<typename T>
inline
void
invokeByName(T& retval, TypeWithDict const& theType, std::string const& name)
{
if (!bool(theType)) {
fprintf(stderr, "FunctionWithDict: invokeByName<%s>: "
"Passed type is invalid!\n", typeid(T).name());
abort();
}
FunctionWithDict func = theType.functionMemberByName(name);
if (!bool(func)) {
fprintf(stderr, "FunctionWithDict: invokeByName<%s>: "
"Could not find function named '%s' in type '%s'\n",
typeid(T).name(), name.c_str(), theType.name().c_str());
abort();
}
if (func.functionParameterSize(true) != 0) {
fprintf(stderr, "FunctionWithDict: invokeByName<%s>: "
"function '%s' in type '%s' should have zero "
"parameters, but has %lu parameters instead!\n",
typeid(T).name(), name.c_str(), theType.name().c_str(),
func.functionParameterSize(true));
abort();
return;
}
ObjectWithDict retobj(typeid(T), &retval);
func.invoke(&retobj);
}

} // namespace edm

#endif // FWCore_Utilities_FunctionWithDict_h

0 comments on commit 616fff8

Please sign in to comment.