1 #ifndef GAUDIKERNEL_SERVICEHANDLE_H
2 #define GAUDIKERNEL_SERVICEHANDLE_H
5 #include "GaudiKernel/GaudiHandle.h"
6 #include "GaudiKernel/IMessageSvc.h"
7 #include "GaudiKernel/ISvcLocator.h"
8 #include "GaudiKernel/Bootstrap.h"
9 #include "GaudiKernel/GaudiException.h"
10 #include "GaudiKernel/MsgStream.h"
11 #include "GaudiKernel/ServiceLocatorHelper.h"
19 class ServiceHandleProperty;
42 ServiceHandle(
const std::string& serviceName,
const std::string& theParentName )
43 :
GaudiHandle<T>(serviceName,
"Service", theParentName)
120 const std::string& myComponentType,
const std::string& myParentName ):
132 virtual bool push_back(
const std::string& serviceTypeAndName ) {
145 inline std::ostream& operator<<( std::ostream& os, const ServiceHandle<T>& handle ) {
146 return operator<<(os, static_cast<const GaudiHandleInfo&>(handle) );
150 inline std::ostream& operator<<( std::ostream& os, const ServiceHandleArray<T>& handle ) {
151 return operator<<(os, static_cast<const GaudiHandleInfo&>(handle) );
154 #endif // ! GAUDIKERNEL_SERVICEHANDLE_H
Handle to be used in lieu of naked pointers to services.
an helper to share the implementation of service() among the various kernel base classes $Id: ...
Handle to be used in lieu of naked pointers to gaudis.
Define general base for Gaudi exception.
virtual ~ServiceHandleArray()
const std::string messageName() const
name used for printing messages
SmartIF< IMessageSvc > & messageSvc() const
const std::string & parentName() const
The name of the parent.
SmartIF< IMessageSvc > m_pMessageSvc
SmartIF< ISvcLocator > & serviceLocator() const
Do the real release of the Service.
SmartIF< ISvcLocator > m_pSvcLocator
GAUDI_API ISvcLocator * svcLocator()
This class is used for returning status codes from appropriate routines.
StatusCode retrieve() const
Retrieve the component.
Array of Handles to be used in lieu of vector of naked pointers to tools.
StatusCode retrieve() const
Retrieve the Service.
bool isValid() const
Allow for check if smart pointer is valid.
virtual bool push_back(const std::string &serviceTypeAndName)
Add a handle to the array with "type/name" given in .
std::string typeAndName() const
The full type and name: "type/name".
ServiceHandle(const std::string &serviceName, const std::string &theParentName)
Create a handle ('smart pointer') to a service.
ServiceHandleArray(const std::vector< std::string > &myTypesAndNamesList, const std::string &myComponentType, const std::string &myParentName)
Generic constructor.
T is the concrete handle type, e.g.