63 return ( !
parent ?
"ToolSvc" : ( pNamed ? pNamed->name() :
"" ) );
138 template <
typename... Args, std::size_t... Is>
139 ToolHandle( std::tuple<Args...>&& args, std::index_sequence<Is...> )
152 template <
typename CT = T,
typename NCT = std::remove_const_t<T>>
153 requires( std::is_const_v<CT> && !std::is_same_v<CT, NCT> )
183#if defined( TOOLHANDLE_DEPR_WARN )
185# pragma message( "Untracked ToolHandle: Migrate explicit DataHandle constructor to declareTool Algorithm Property" )
187 __attribute__( ( deprecated ) )
198 template <std::derived_from<IProperty> OWNER>
199 ToolHandle( OWNER* owner, std::string propName, std::string toolType, std::string doc =
"" ) :
ToolHandle( 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>();
209 template <
typename... Args>
261 algTool =
dynamic_cast<T*
>( iface );
280 return os << static_cast<const GaudiHandleInfo&>( handle );
307template <
typename IFace>
322 assert( tool !=
nullptr );
323 return const_cast<IAlgTool*
>( tool )
324 ->queryInterface( IFace::interfaceID(), &( self->m_ptr ) )
327 self->m_bind = [](
const void* ptr,
const EventContext& ) {
332 return const_cast<IAlgTool*
>( tool )
336 self->m_bind = [](
const void* ptr,
const EventContext& ctx ) {
346 throw GaudiException{
"request bind on toolhandle which was not (successfully) 'retrieved'", __PRETTY_FUNCTION__,
366 template <
typename CT = T,
typename NCT = std::remove_const_t<T>>
367 requires( std::is_const_v<CT> && !std::is_same_v<CT, NCT> )
373 template <std::derived_from<IProperty> OWNER>
374 inline PublicToolHandle( OWNER* owner, std::string propName, std::string toolType, std::string doc =
"" )
379 if ( !toolType.empty() and toolType.find(
'/' ) == std::string::npos ) { toolType +=
'/' + toolType; }
380 owner->declareTool( *
this, std::move( toolType ) ).ignore();
381 auto p = owner->OWNER::PropertyHolderImpl::declareProperty( std::move( propName ), *
this, std::move( doc ) );
382 p->template setOwnerType<OWNER>();
429 bool push_back(
const std::string& toolTypeAndName )
override {
440 template <std::derived_from<IProperty> OWNER>
442 std::string doc =
"" )
444 owner->addToolsArray( *
this );
446 auto p = owner->OWNER::PropertyHolderImpl::declareProperty( std::move( name ), *
this, std::move( doc ) );
447 p->template setOwnerType<OWNER>();
451 return os << static_cast<const GaudiHandleInfo&>( handle );
467 template <std::derived_from<IProperty> OWNER>
469 std::string doc =
"" )
471 owner->addToolsArray( *
this );
473 auto p = owner->OWNER::PropertyHolderImpl::declareProperty( std::move( name ), *
this, std::move( doc ) );
474 p->template setOwnerType<OWNER>();
This class represents an entry point to all the event specific data.
Base class from which all concrete algorithm classes should be derived.
Define general base for Gaudi exception.
bool setTypesAndNames(const std::vector< std::string > &myTypesAndNamesList)
Set the array of handles from list of "type/name" strings in <myTypesAndNamesList>.
const std::vector< std::string > typesAndNames() const
Return a vector with "type/name" strings of all handles in the array.
GaudiHandleArray(const std::vector< std::string > &myTypesAndNamesList, std::string myComponentType, std::string myParentName)
GaudiHandleBase(std::string myTypeAndName, std::string myComponentType, std::string myParentName)
Create a handle ('smart pointer') to a gaudi component.
const std::string & typeAndName() const
The full type and name: "type/name".
void setTypeAndName(std::string myTypeAndName)
The component "type/name" string.
StatusCode release() const
Release the component.
T * get()
Return the wrapped pointer, not calling retrieve() if null.
StatusCode retrieve() const
Retrieve the component.
GaudiHandle(std::string myTypeAndName, std::string myComponentType, std::string myParentName)
void setParentName(std::string parent)
The name of the parent.
const std::string & parentName() const
The name of the parent.
void setComponentType(std::string componentType)
The component type.
Definition of the basic interface.
static const InterfaceID & interfaceID()
Return an instance of InterfaceID identifying the interface.
IInterface compliant class extending IInterface with the name() method.
Handle to be used in lieu of naked pointers to services.
Base class for all services.
This class is used for returning status codes from appropriate routines.
StatusCode andThen(F &&f, ARGS &&... args) const
Chain code blocks making the execution conditional a success result.
constexpr static const auto SUCCESS
constexpr static const auto FAILURE
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
std::remove_const_t< T > * nonConst(T *p)
Cast a pointer to a non const type.
static const InterfaceID & interfaceID()