9 #ifndef ASG_TOOLS_ASG_TOOL_CONFIG_H
10 #define ASG_TOOLS_ASG_TOOL_CONFIG_H
83 std::shared_ptr<void>& cleanup,
84 bool allowNestedName =
false)
const;
121 #ifdef XAOD_STANDALONE
124 makeTool (ToolHandle<T>& toolHandle,
125 std::shared_ptr<void>& cleanup,
126 bool allowNestedName)
const
128 using namespace msgComponentConfig;
130 std::string
prefix = toolHandle.parentName() +
".";
132 std::unique_ptr<T>
tool;
136 std::shared_ptr<T> mycleanup (
tool.release());
137 toolHandle = mycleanup.get();
141 return StatusCode::SUCCESS;
147 using namespace msgComponentConfig;
149 INamedInterface *parentNamed = toolHandle.parent();
150 if (parentNamed ==
nullptr)
152 ANA_MSG_ERROR (
"need to pass private ToolHandle into makePrivateTool");
153 return StatusCode::FAILURE;
155 AsgComponent *parentComponent =
dynamic_cast<AsgComponent*
>(parentNamed);
156 if (parentComponent ==
nullptr)
158 ANA_MSG_ERROR (
"parent \"" << parentNamed->name() <<
"\" for makePrivateTool() does not inherit from AsgComponent");
159 return StatusCode::FAILURE;
162 std::shared_ptr<void> cleanup;
163 if (
makeTool (toolHandle, cleanup).isFailure())
164 return StatusCode::FAILURE;
165 parentComponent->addCleanup (cleanup);
166 return StatusCode::SUCCESS;
172 makeTool (ToolHandle<T>& toolHandle,
173 std::shared_ptr<void>& ,
174 bool allowNestedName)
const
176 using namespace msgComponentConfig;
178 std::string
prefix = toolHandle.parentName() +
".";
181 toolHandle.setTypeAndName (
type() +
"/" +
name());
185 return StatusCode::SUCCESS;
191 using namespace msgComponentConfig;
195 std::shared_ptr<void> cleanup;
196 return makeTool (toolHandle, cleanup);