11 #ifndef GAUDIKERNEL_TOOLHANDLE_H 12 #define GAUDIKERNEL_TOOLHANDLE_H 24 #include <type_traits> 37 using DisableTool = Gaudi::tagged_bool<class DisableTool_tag>;
38 using EnableTool = Gaudi::tagged_bool<class EnableTool_tag>;
63 auto* pNamed = (
parent ? dynamic_cast<const INamedInterface*>(
parent ) : nullptr );
64 return ( !
parent ?
"ToolSvc" : ( pNamed ? pNamed->name() :
"" ) );
151 template <
typename CT = T,
typename NCT = std::remove_const_t<T>,
152 typename = std::enable_if_t<std::is_const_v<CT> && !std::is_same_v<CT, NCT>>>
182 #if defined( TOOLHANDLE_DEPR_WARN ) 184 # pragma message( "Untracked ToolHandle: Migrate explicit DataHandle constructor to declareTool Algorithm Property" ) 186 __attribute__( ( deprecated ) )
197 template <
class OWNER,
typename = std::enable_if_t<std::is_base_of_v<IProperty, OWNER>>>
203 if ( !toolType.
empty() and toolType.
find(
'/' ) == std::string::npos ) { toolType +=
'/' + toolType; }
204 owner->declareTool( *
this,
std::move( toolType ) ).ignore();
205 auto p = owner->OWNER::PropertyHolderImpl::declareProperty(
std::move( propName ), *
this,
std::move( doc ) );
206 p->template setOwnerType<OWNER>();
258 algTool = dynamic_cast<T*>( iface );
259 if ( algTool ==
nullptr ) {
312 template <
typename CT = T,
typename NCT = std::remove_const_t<T>>
314 std::enable_if_t<std::is_const_v<CT> && !std::is_same_v<CT, NCT>>* =
nullptr )
319 template <
class OWNER,
typename = std::enable_if_t<std::is_base_of_v<IProperty, OWNER>>>
325 if ( !toolType.
empty() and toolType.
find(
'/' ) == std::string::npos ) { toolType +=
'/' + toolType; }
326 owner->declareTool( *
this,
std::move( toolType ) ).ignore();
327 auto p = owner->OWNER::PropertyHolderImpl::declareProperty(
std::move( propName ), *
this,
std::move( doc ) );
328 p->template setOwnerType<OWNER>();
386 template <
class OWNER,
typename = std::enable_if_t<std::is_base_of_v<IProperty, OWNER>>>
390 owner->addToolsArray( *
this );
393 p->template setOwnerType<OWNER>();
409 template <
class OWNER,
typename = std::enable_if_t<std::is_base_of_v<IProperty, OWNER>>>
413 owner->addToolsArray( *
this );
416 p->template setOwnerType<OWNER>();
422 return operator<<( os, static_cast<const GaudiHandleInfo&>( handle ) );
427 return operator<<( os, static_cast<const GaudiHandleInfo&>( handle ) );
430 #endif // ! GAUDIKERNEL_TOOLHANDLE_H
Handle to be used in lieu of naked pointers to gaudis.
StatusCode release() const
Release the component.
Define general base for Gaudi exception.
void setTypeAndName(std::string myTypeAndName)
The component "type/name" string.
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
std::string typeAndName() const
The full type and name: "type/name".
const std::vector< std::string > typesAndNames() const
Return a vector with "type/name" strings of all handles in the array.
void setComponentType(const std::string &componentType)
The component type.
constexpr static const auto SUCCESS
StatusCode retrieve() const
Retrieve the component.
void setParentName(const std::string &parent)
The name of the parent.
StatusCode initialize(const std::string &serviceName, const std::string &theParentName)
std::remove_const_t< T > * nonConst(T *p)
Cast a pointer to a non const type.
bool setTypesAndNames(const std::vector< std::string > &myTypesAndNamesList)
Set the array of handles from list of "type/name" strings in <myTypesAndNamesList>.
This class is used for returning status codes from appropriate routines.
const std::string & parentName() const
The name of the parent.
Definition of the basic interface.
T * get()
Return the wrapped pointer, not calling retrieve() if null.
Alias for backward compatibility.
Base class from which all concrete algorithm classes should be derived.
constexpr static const auto FAILURE
Base class to handles to be used in lieu of naked pointers to various Gaudi components.
Base class for all services.
static const InterfaceID & interfaceID()
Return an instance of InterfaceID identifying the interface.
Header file for std:chrono::duration-based Counters.
T is the concrete handle type, e.g.