Go to the documentation of this file.
11 #ifndef GAUDIKERNEL_TOOLHANDLE_H
12 #define GAUDIKERNEL_TOOLHANDLE_H
24 #include <type_traits>
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
const std::string & parentName() const
The name of the parent.
virtual bool push_back(const std::string &myHandleTypeAndName)=0
Add a handle with given type and name.
Alias for backward compatibility.
StatusCode initialize(const std::string &serviceName, const std::string &theParentName)
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
void setParentName(std::string parent)
The name of the parent.
T * get()
Return the wrapped pointer, not calling retrieve() if null.
std::remove_const_t< T > * nonConst(T *p)
Cast a pointer to a non const type.
static const InterfaceID & interfaceID()
Return an instance of InterfaceID identifying the interface.
Base class from which all concrete algorithm classes should be derived.
std::string typeAndName() const
The full type and name: "type/name".
Header file for std:chrono::duration-based Counters.
bool setTypesAndNames(const std::vector< std::string > &myTypesAndNamesList)
Set the array of handles from list of "type/name" strings in <myTypesAndNamesList>.
constexpr static const auto SUCCESS
void setComponentType(std::string componentType)
The component type.
const std::vector< std::string > typesAndNames() const
Return a vector with "type/name" strings of all handles in the array.
constexpr static const auto FAILURE
T is the concrete handle type, e.g.
StatusCode retrieve() const
Retrieve the component.
StatusCode release() const
Release the component.
void setTypeAndName(std::string myTypeAndName)
The component "type/name" string.