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 if ( ( self->m_ptr = tool->template cast<IFace>() ) ) {
324 self->m_bind = [](
const void* ptr,
const EventContext& ) {
328 self->m_bind = [](
const void* ptr,
const EventContext& ctx ) {
340 throw GaudiException{
"request bind on toolhandle which was not (successfully) 'retrieved'", __PRETTY_FUNCTION__,
360 template <
typename CT = T,
typename NCT = std::remove_const_t<T>>
361 requires( std::is_const_v<CT> && !std::is_same_v<CT, NCT> )
367 template <std::derived_from<IProperty> OWNER>
368 inline PublicToolHandle( OWNER* owner, std::string propName, std::string toolType, std::string doc =
"" )
373 if ( !toolType.empty() and toolType.find(
'/' ) == std::string::npos ) { toolType +=
'/' + toolType; }
374 owner->declareTool( *
this, std::move( toolType ) ).ignore();
375 auto p = owner->OWNER::PropertyHolderImpl::declareProperty( std::move( propName ), *
this, std::move( doc ) );
376 p->template setOwnerType<OWNER>();
423 bool push_back(
const std::string& toolTypeAndName )
override {
434 template <std::derived_from<IProperty> OWNER>
436 std::string doc =
"" )
438 owner->addToolsArray( *
this );
440 auto p = owner->OWNER::PropertyHolderImpl::declareProperty( std::move( name ), *
this, std::move( doc ) );
441 p->template setOwnerType<OWNER>();
445 return os << static_cast<const GaudiHandleInfo&>( handle );
461 template <std::derived_from<IProperty> OWNER>
463 std::string doc =
"" )
465 owner->addToolsArray( *
this );
467 auto p = owner->OWNER::PropertyHolderImpl::declareProperty( std::move( name ), *
this, std::move( doc ) );
468 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.