11 #ifndef GAUDIALG_GAUDICOMMONIMP_H 12 #define GAUDIALG_GAUDICOMMONIMP_H 1 33 template <
class PBASE>
38 Assert( service,
"get():: IDataProvider* points to NULL!" );
41 return getter( *
this, service, this->
fullTESLocation( location, useRootInTES ) );
46 template <
class PBASE>
51 Assert( service,
"get():: IDataProvider* points to NULL!" );
54 return getter( *
this, service, this->
fullTESLocation( location, useRootInTES ),
false );
59 template <
class PBASE>
63 Assert( service,
"exist():: IDataProvider* points to NULL!" );
66 return checker( service, this->
fullTESLocation( location, useRootInTES ) );
73 template <
class PBASE>
74 template <
class TYPE,
class TYPE2>
78 Assert( service,
"getOrCreate():: svc points to NULL!" );
86 template <
class PBASE>
92 Assert( this->toolSvc(),
"tool():: IToolSvc* points to NULL!" );
106 PBASE::registerTool( Tool );
107 m_managedTools.push_back( Tool );
114 template <
class PBASE>
115 template <
class TOOL>
118 Assert( PBASE::toolSvc(),
"IToolSvc* points to NULL!" );
120 TOOL* Tool =
nullptr;
125 if ( !Tool ) { Exception(
std::string{
"tool():: Could not retrieve Tool '"}.
append(
type ).append(
"'" ) ); }
127 PBASE::registerTool( Tool );
128 m_managedTools.push_back( Tool );
135 template <
class PBASE>
136 template <
class SERVICE>
138 Assert( this->svcLoc(),
"ISvcLocator* points to NULL!" );
150 auto baseSvc = this->svcLoc()->service(
name, create );
154 if ( !baseSvc || !
s ) {
158 addToServiceList( baseSvc );
166 template <
class PBASE>
168 if ( !m_updMgrSvc ) { m_updMgrSvc = svc<IUpdateManagerSvc>(
"UpdateManagerSvc",
true ); }
174 template <
class PBASE>
176 if ( !ok ) Exception(
msg, sc );
193 #define ALG_ERROR( message, code ) \ 194 ( Error( message + std::string( " [ at line " ) + std::to_string( __LINE__ ) + std::string( " in file '" ) + \ 195 std::string( __FILE__ ) + "']", \ 201 #endif // GAUDIALG_GAUDICOMMONIMP_H IUpdateManagerSvc * updMgrSvc() const
Short-cut to locate the Update Manager Service.
Small smart pointer class with automatic reference counting for IInterface.
constexpr const struct GaudiCommon_details::svc_eq_t svc_eq
void Assert(const bool ok, std::string_view message="", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
Assertion - throw exception if the given condition is not fulfilled.
Helper structure for implementation of "get"-functions for GaudiCommon<BASE>
Data provider interface definition.
constexpr const struct GaudiCommon_details::svc_lt_t svc_lt
Helper structure for implementation of "exists"-functions for GaudiCommon<BASE>
This class is used for returning status codes from appropriate routines.
Definition of the basic interface.
Gaudi::Utils::GetData< TYPE >::return_type getIfExists(IDataProviderSvc *svc, std::string_view location, const bool useRootInTES=true) const
Quicker version of the get function which bypasses the check on the retrieved data.
Helper structure for implementation of "getOrCreate"-functions for GaudiCommon<BASE>
std::string fullTESLocation(std::string_view location, std::string_view rit)
Interface class to the Update Manager service.
Gaudi::Utils::GetData< TYPE >::return_type get(IDataProviderSvc *svc, std::string_view location, const bool useRootInTES=true) const
Templated access to the data in Gaudi Transient Store.
constexpr static const auto FAILURE
const Gaudi::Algorithm & parent
bool exist(IDataProviderSvc *svc, std::string_view location, const bool useRootInTES=true) const
Check the existence of a data object or container in the Gaudi Transient Event Store.
TOOL * tool(std::string_view type, std::string_view name, const IInterface *parent=0, bool create=true) const
Useful method for the easy location of tools.
Gaudi::Utils::GetData< TYPE >::return_type getOrCreate(IDataProviderSvc *svc, std::string_view location, const bool useRootInTES=true) const
Get the existing data object from Gaudi Event Transient store.
SmartIF< SERVICE > svc(std::string_view name, const bool create=true) const
A useful method for the easy location of services.