11 #ifndef ASGTOOLS_SETPROPERTY_H
12 #define ASGTOOLS_SETPROPERTY_H
19 template<
typename W>
static StatusCode setProperty(IAsgTool*
tool,
const std::string& property,
W&&
value) {
20 AsgTool* asgtool =
dynamic_cast<AsgTool*
>(
tool);
21 if(!asgtool)
return StatusCode::FAILURE;
22 return asgtool->setProperty(property,
value);
24 template<
typename W>
static StatusCode setProperty(IAsgTool&
tool,
const std::string& property,
W&&
value) {
25 return asg::setProperty( &
tool , property,
value );
28 template<
typename T,
typename W>
static StatusCode setProperty(std::unique_ptr<T>&
tool,
const std::string& property,
W&&
value) {
29 return asg::setProperty(
tool.get() , property,
value );
34 template<
typename W>
static StatusCode setProperty(IAsgTool*
tool,
const std::string& property, ToolHandle<W>&&
value) {
35 if(!
tool)
return StatusCode::FAILURE;
36 std::string subToolName(
value.name());
37 size_t start_pos = subToolName.find(
tool->name()+
".");
38 if(start_pos!=std::string::npos) { subToolName.replace( start_pos,
tool->name().length()+1,
"" ); }
39 return asg::setProperty(
tool, property,
value.type()+
"/"+subToolName);