The Gaudi Framework
master (57817a18)
Toggle main menu visibility
Loading...
Searching...
No Matches
ISvcLocator.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
#pragma once
12
13
#include <
GaudiKernel/IInterface.h
>
14
#include <
GaudiKernel/ISvcManager.h
>
15
#include <
GaudiKernel/SmartIF.h
>
16
#include <
GaudiKernel/TypeNameString.h
>
17
#include <list>
18
#include <string>
19
20
class
IService
;
21
namespace
Gaudi::Monitoring
{
22
struct
Hub
;
23
}
24
namespace
Gaudi
{
25
namespace
Interfaces
{
26
struct
IOptionsSvc
;
27
}
28
}
// namespace Gaudi
29
30
#define GAUDI_HAS_IOPTIONS_SVC
31
42
class
GAUDI_API
ISvcLocator
:
virtual
public
IInterface
{
43
public
:
45
DeclareInterfaceID
(
ISvcLocator
, 3, 0 );
46
48
virtual
const
std::list<IService*>&
getServices
()
const
= 0;
49
51
virtual
bool
existsService
( std::string_view name )
const
= 0;
52
54
virtual
SmartIF<IService>
&
service
(
const
Gaudi::Utils::TypeNameString
& typeName,
const
bool
createIf =
true
) = 0;
55
57
template
<
typename
T>
58
inline
SmartIF<T>
service
(
const
Gaudi::Utils::TypeNameString
& typeName,
const
bool
createIf =
true
) {
59
return
SmartIF<T>
{
service
( typeName, createIf ) };
60
}
61
62
// try to access a different interface of the _current_ serviceLocator...
63
template
<
typename
IFace>
64
SmartIF<IFace>
as
() {
65
return
SmartIF<IFace>
{
this
};
66
}
67
69
Gaudi::Interfaces::IOptionsSvc
& getOptsSvc();
70
71
Gaudi::Monitoring::Hub
& monitoringHub();
72
};
IInterface.h
ISvcManager.h
GAUDI_API
#define GAUDI_API
Definition
Kernel.h:49
SmartIF.h
TypeNameString.h
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition
TypeNameString.h:19
IInterface
Definition of the basic interface.
Definition
IInterface.h:225
IService
General service interface definition.
Definition
IService.h:26
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition
ISvcLocator.h:42
ISvcLocator::DeclareInterfaceID
DeclareInterfaceID(ISvcLocator, 3, 0)
InterfaceID.
ISvcLocator::service
SmartIF< T > service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)
Returns a smart pointer to the requested interface of a service.
Definition
ISvcLocator.h:58
ISvcLocator::getServices
virtual const std::list< IService * > & getServices() const =0
Return the list of Services.
ISvcLocator::existsService
virtual bool existsService(std::string_view name) const =0
Check the existence of a service given a service name.
ISvcLocator::service
virtual SmartIF< IService > & service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.
ISvcLocator::as
SmartIF< IFace > as()
Definition
ISvcLocator.h:64
SmartIF
Small smart pointer class with automatic reference counting for IInterface.
Definition
SmartIF.h:28
Gaudi::Interfaces
Definition
IFileSvc.h:20
Gaudi::Monitoring
Definition
JSONSink.cpp:19
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition
__init__.py:1
Gaudi::Interfaces::IOptionsSvc
Interface for a component that manages application configuration options.
Definition
IOptionsSvc.h:46
Gaudi::Monitoring::Hub
Central entity in a Gaudi application that manages monitoring objects (i.e.
Definition
MonitoringHub.h:47
GaudiKernel
include
GaudiKernel
ISvcLocator.h
Generated on
for The Gaudi Framework by
1.17.0