Go to the documentation of this file.
11 #ifndef GAUDIKERNEL_TOOLHANDLE_H
12 #define GAUDIKERNEL_TOOLHANDLE_H
25 #include <type_traits>
65 return ( !
parent ?
"ToolSvc" : ( pNamed ? pNamed->name() :
"" ) );
156 template <
typename CT = T,
typename NCT = std::remove_const_t<T>,
157 typename = std::enable_if_t<std::is_const_v<CT> && !std::is_same_v<CT, NCT>>>
187 #if defined( TOOLHANDLE_DEPR_WARN )
189 # pragma message( "Untracked ToolHandle: Migrate explicit DataHandle constructor to declareTool Algorithm Property" )
191 __attribute__( ( deprecated ) )
202 template <
class OWNER,
typename = std::enable_if_t<std::is_base_of_v<IProperty, OWNER>>>
207 if ( !toolType.
empty() and toolType.
find(
'/' ) == std::string::npos ) { toolType +=
'/' + toolType; }
208 owner->declareTool( *
this,
std::move( toolType ) ).ignore();
209 auto p = owner->OWNER::PropertyHolderImpl::declareProperty(
std::move( propName ), *
this,
std::move( doc ) );
210 p->template setOwnerType<OWNER>();
213 template <
typename... Args>
265 algTool =
dynamic_cast<T*
>( iface );
284 return os << static_cast<const GaudiHandleInfo&>( handle );
311 template <
typename IFace>
314 void* m_ptr =
nullptr;
327 ->queryInterface( IFace::interfaceID(), &(
self->m_ptr ) )
330 self->m_bind = [](
const void* ptr,
const EventContext& ) {
363 template <
typename CT = T,
typename NCT = std::remove_const_t<T>>
365 std::enable_if_t<std::is_const_v<CT> && !std::is_same_v<CT, NCT>>* =
nullptr )
370 template <
class OWNER,
typename = std::enable_if_t<std::is_base_of_v<IProperty, OWNER>>>
376 if ( !toolType.
empty() and toolType.
find(
'/' ) == std::string::npos ) { toolType +=
'/' + toolType; }
377 owner->declareTool( *
this,
std::move( toolType ) ).ignore();
378 auto p = owner->OWNER::PropertyHolderImpl::declareProperty(
std::move( propName ), *
this,
std::move( doc ) );
379 p->template setOwnerType<OWNER>();
437 template <
class OWNER,
typename = std::enable_if_t<std::is_base_of_v<IProperty, OWNER>>>
441 owner->addToolsArray( *
this );
444 p->template setOwnerType<OWNER>();
448 return os << static_cast<const GaudiHandleInfo&>( handle );
464 template <
class OWNER,
typename = std::enable_if_t<std::is_base_of_v<IProperty, OWNER>>>
468 owner->addToolsArray( *
this );
471 p->template setOwnerType<OWNER>();
475 #endif // ! GAUDIKERNEL_TOOLHANDLE_H
const std::string & parentName() const
The name of the parent.
StatusCode andThen(F &&f, ARGS &&... args) const
Chain code blocks making the execution conditional a success result.
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.