Skip to content
Snippets Groups Projects
Commit 9bc6c9b3 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

ConfigurableService: copy private tools of services

Closes #208

See merge request !1277
parents 0c4c1f8c f20fb955
No related branches found
No related tags found
1 merge request!1277ConfigurableService: copy private tools of services
Pipeline #3331081 passed
/***********************************************************************************\
* (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
* (c) Copyright 1998-2021 CERN for the benefit of the LHCb and ATLAS collaborations *
* *
* This software is distributed under the terms of the Apache version 2 licence, *
* copied verbatim in the file "LICENSE". *
......@@ -22,6 +22,7 @@ namespace GaudiTesting {
private:
PublicToolHandle<IMyTool> m_tool{this, "MyTool", "MyTool"};
ToolHandle<IMyTool> m_privTool{this, "MyPrivateTool", ""};
};
DECLARE_COMPONENT( SvcWithTool )
......
#####################################################################################
# (c) Copyright 1998-2020 CERN for the benefit of the LHCb and ATLAS collaborations #
# (c) Copyright 1998-2021 CERN for the benefit of the LHCb and ATLAS collaborations #
# #
# This software is distributed under the terms of the Apache version 2 licence, #
# copied verbatim in the file "LICENSE". #
......@@ -1161,7 +1161,11 @@ class ConfigurableService(Configurable):
return self # services are always shared
def copyChild(self, child):
return child # full sharing
# Copy private tools but all else is shared
if isinstance(child, ConfigurableAlgTool) and not child.isPublic():
return copy.deepcopy(child)
else:
return child
def getHandle(self):
return iService(self._name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment