The Gaudi Framework  master (37c0b60a)
ServiceManager.cpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 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 
12 // Include files
13 #include "ServiceManager.h"
16 #include <GaudiKernel/IService.h>
17 #include <GaudiKernel/Incident.h>
18 #include <GaudiKernel/MsgStream.h>
20 #include <GaudiKernel/Service.h>
21 #include <GaudiKernel/SmartIF.h>
22 #include <GaudiKernel/System.h>
24 #include <GaudiKernel/reverse.h>
25 
26 #include <algorithm>
27 #include <cassert>
28 #include <functional>
29 #include <iostream>
30 
31 #define ON_DEBUG if ( msgLevel( MSG::DEBUG ) )
32 #define ON_VERBOSE if ( msgLevel( MSG::VERBOSE ) )
33 
34 #define DEBMSG ON_DEBUG debug()
35 #define VERMSG ON_VERBOSE verbose()
36 
38 static SmartIF<IService> no_service;
39 
41 namespace {
42  template <typename C>
43  std::vector<IService*> activeSvc( const C& lst ) {
45  v.reserve( lst.size() );
46  for ( auto& i : lst ) {
47  if ( i.active ) v.push_back( i.service.get() );
48  }
49  return v;
50  }
51 } // namespace
52 
53 // constructor
55  : base_class( application, IService::interfaceID() ), m_appSvc( application ) {
56  // Set the service locator to myself
57  m_svcLocator = this;
58  addRef(); // increase ref count, so we live forever...
59 }
60 
61 // destructor
63  //-- inform the orphan services that I am gone....
64  for ( auto& svc : m_listsvc ) svc.service->setServiceManager( nullptr );
65 }
66 
67 //------------------------------------------------------------------------------
68 // Instantiate a service
70 //------------------------------------------------------------------------------
71 {
72  // Check if the service is already existing
73  if ( existsService( typeName.name() ) ) {
74  // return an error because a service with that name already exists
75  return no_service;
76  }
77 
78  const std::string& name = typeName.name();
79  std::string type = typeName.type();
80  if ( !typeName.haveType() ) { // the type is not explicit
81  // see we have some specific type mapping for the name
82  auto it = m_maptype.find( typeName.name() );
83  if ( it != m_maptype.end() ) {
84  type = it->second; // use the declared type
85  }
86  }
87 
89  auto ip = type.find( "__" );
90  if ( ip != std::string::npos ) type.erase( ip, type.length() );
91 
92  IService* service = Service::Factory::create( type, name, this ).release();
93  if ( !service ) {
94  fatal() << "No Service factory for " << type << " available." << endmsg;
95  return no_service;
96  }
97  // Check the compatibility of the version of the interface obtained
98  if ( !isValidInterface( service ) ) {
99  fatal() << "Incompatible interface IService version for " << type << endmsg;
100  return no_service;
101  }
102 
103  if ( name == "JobOptionsSvc" ) {
104  if ( !dynamic_cast<Gaudi::Interfaces::IOptionsSvc*>( service ) ) {
105  fatal() << typeName << " does not implement Gaudi::Interfaces::IOptionsSvc" << endmsg;
106  return no_service;
107  }
108  }
109 
110  auto lck = std::scoped_lock{ m_gLock };
112  service->setServiceManager( this );
113  return m_listsvc.back().service; // DANGER: returns a reference to a SmartIF in m_listsvc, and hence does no longer
114  // allow relocations of those...
115 }
116 
117 //------------------------------------------------------------------------------
118 // add a service to the managed list
120 //------------------------------------------------------------------------------
121 {
122  auto it = find( svc );
123  auto lck = std::scoped_lock{ m_gLock };
124  if ( it != m_listsvc.end() ) {
125  it->priority = prio; // if the service is already known, it is equivalent to a setPriority
126  it->active = true; // and make it active
127  } else {
128  m_listsvc.emplace_back( svc, prio, true );
129  }
130  return StatusCode::SUCCESS;
131 }
132 
133 //------------------------------------------------------------------------------
134 // add the service with the give type and name to the active list
136 //------------------------------------------------------------------------------
137 {
138  auto it = find( typeName.name() ); // try to find the service by name
139  if ( it == m_listsvc.end() ) { // not found
140  // If the service does not exist, we create it
141  SmartIF<IService>& svc =
142  createService( typeName ); // WARNING: svc is now a reference to something that lives in m_listsvc
143  if ( !svc ) return StatusCode::FAILURE;
144  it = find( svc.get() ); // now it is in the list because createService added it
145  it->priority = prio;
147  if ( targetFSMState() >= Gaudi::StateMachine::INITIALIZED ) { // WARNING: this can trigger a recursion!!!
148  sc = svc->sysInitialize();
149  if ( sc.isSuccess() && targetFSMState() >= Gaudi::StateMachine::RUNNING ) { sc = svc->sysStart(); }
150  }
151  if ( sc.isFailure() ) { // if initialization failed, remove it from the list
152  error() << "Unable to initialize service \"" << typeName.name() << "\"" << endmsg;
153  auto lck = std::scoped_lock{ m_gLock };
154  m_listsvc.erase( it );
155  // Note: removing it from the list + the SmartIF going out of scope should trigger the delete
156  // delete svc.get();
157  return sc;
158  }
159  // initialization successful, we can work with the service
160  // Move the just initialized service to the back of the list
161  // (we care more about order of initialization than of creation)
162  auto lck = std::scoped_lock{ m_gLock };
163  m_listsvc.push_back( *it );
164  m_listsvc.erase( it );
165  it = std::prev( std::end( m_listsvc ) ); // last entry (the iterator was invalidated by erase)
166  } else {
167  // if the service is already known, it is equivalent to a setPriority
168  it->priority = prio;
169  }
170  // 'it' is defined because either we found the service or we created it
171  // Now we can activate the service
172  it->active = true; // and make it active
173  return StatusCode::SUCCESS;
174 }
175 
176 //------------------------------------------------------------------------------
177 // Returns a smart pointer to a service.
179  const std::string& name = typeName.name();
180 
181  // Acquire the RAII lock to avoid simultaneous attempts from different threads to initialize a service
182 
183  auto* imut = [&] {
184  // get the global lock, then extract/create the service specific mutex
185  // then release global lock
186 
187  auto lk = std::scoped_lock{ this->m_gLock };
188  auto mit = m_lockMap.find( name );
189  if ( mit == m_lockMap.end() ) {
191  .first;
192  }
193  return &mit->second;
194  }();
195 
196  {
197  // now we have the service specific lock on the above mutex
198  auto lk2 = std::scoped_lock{ *imut };
199 
200  auto it = find( name );
201 
202  if ( it != m_listsvc.end() ) {
203  if ( m_loopCheck && ( createIf && it->service->FSMState() == Gaudi::StateMachine::CONFIGURED ) ) {
204  error() << "Initialization loop detected when creating service \"" << name << "\"" << endmsg;
205  return no_service;
206  }
207  return it->service;
208  }
209 
210  // Service not found. The user may be interested in one of the interfaces
211  // of the application manager itself
212  if ( name == "ApplicationMgr" || name == "APPMGR" || name == "" ) { return m_appSvc; }
213 
214  // last resort: we try to create the service
215  if ( createIf && addService( typeName ).isSuccess() ) { return find( name )->service; }
216 
217  return no_service;
218  }
219 }
220 
221 //------------------------------------------------------------------------------
223 //------------------------------------------------------------------------------
224 {
227  []( ListSvc::const_reference i ) { return i.service.get(); } );
228  return m_listOfPtrs;
229 }
230 
231 //------------------------------------------------------------------------------
232 bool ServiceManager::existsService( std::string_view name ) const
233 //------------------------------------------------------------------------------
234 {
235  return find( name ) != m_listsvc.end();
236 }
237 
238 //------------------------------------------------------------------------------
240 //------------------------------------------------------------------------------
241 {
242  auto it = find( svc );
243  if ( it == m_listsvc.end() ) return StatusCode::FAILURE;
244  m_listsvc.erase( it );
245  return StatusCode::SUCCESS;
246 }
247 
248 //------------------------------------------------------------------------------
250 //------------------------------------------------------------------------------
251 {
252  auto it = find( name );
253  if ( it == m_listsvc.end() ) return StatusCode::FAILURE;
254  m_listsvc.erase( it );
255  return StatusCode::SUCCESS;
256 }
257 
258 //------------------------------------------------------------------------------
260 //------------------------------------------------------------------------------
261 {
262  m_maptype.insert_or_assign( std::move( svcname ), std::move( svctype ) );
263  return StatusCode::SUCCESS;
264 }
265 
266 //------------------------------------------------------------------------------
268 //------------------------------------------------------------------------------
269 {
270  // ensure that the list is ordered by priority
271  m_listsvc.sort();
272  // we work on a copy to avoid to operate twice on the services created on demand
273  // which are already in the correct state.
274 
276  // call initialize() for all services
277  for ( auto& it : activeSvc( m_listsvc ) ) {
278  const std::string& name = it->name();
279  switch ( it->FSMState() ) {
281  DEBMSG << "Service " << name << " already initialized" << endmsg;
282  break;
284  DEBMSG << "Initializing service " << name << endmsg;
285  sc = it->sysInitialize();
286  if ( !sc.isSuccess() ) {
287  error() << "Unable to initialize Service: " << name << endmsg;
288  return sc;
289  }
290  break;
291  default:
292  error() << "Service " << name << " not in the correct state to be initialized (" << it->FSMState() << ")"
293  << endmsg;
294  return StatusCode::FAILURE;
295  }
296  }
297  return StatusCode::SUCCESS;
298 }
299 
300 //------------------------------------------------------------------------------
302 //------------------------------------------------------------------------------
303 {
304  // ensure that the list is ordered by priority
305  m_listsvc.sort();
306  // we work on a copy to avoid to operate twice on the services created on demand
307  // (which are already in the correct state.
308  // only act on active services
310  // call initialize() for all services
311  for ( auto& it : activeSvc( m_listsvc ) ) {
312  const std::string& name = it->name();
313  switch ( it->FSMState() ) {
315  DEBMSG << "Service " << name << " already started" << endmsg;
316  break;
318  DEBMSG << "Starting service " << name << endmsg;
319  sc = it->sysStart();
320  if ( !sc.isSuccess() ) {
321  error() << "Unable to start Service: " << name << endmsg;
322  return sc;
323  }
324  break;
325  default:
326  error() << "Service " << name << " not in the correct state to be started (" << it->FSMState() << ")" << endmsg;
327  return StatusCode::FAILURE;
328  }
329  }
330  return StatusCode::SUCCESS;
331 }
332 
333 //------------------------------------------------------------------------------
335 //------------------------------------------------------------------------------
336 {
337  // ensure that the list is ordered by priority
338  m_listsvc.sort();
339  // we work on a copy to avoid to operate twice on the services created on demand
340  // which are already in the correct state.
341  // only act on active services
342 
344  // call stop() for all services
345  for ( const auto& svc : reverse( activeSvc( m_listsvc ) ) ) {
346  const std::string& name = svc->name();
347  switch ( svc->FSMState() ) {
349  DEBMSG << "Service " << name << " already stopped" << endmsg;
350  break;
352  DEBMSG << "Stopping service " << name << endmsg;
353  sc = svc->sysStop();
354  if ( !sc.isSuccess() ) {
355  error() << "Unable to stop Service: " << name << endmsg;
356  return sc;
357  }
358  break;
359  default:
360  DEBMSG << "Service " << name << " not in the correct state to be stopped (" << svc->FSMState() << ")" << endmsg;
361  return StatusCode::FAILURE;
362  }
363  }
364  return StatusCode::SUCCESS;
365 }
366 
367 //------------------------------------------------------------------------------
369 //------------------------------------------------------------------------------
370 {
371  // ensure that the list is ordered by priority
372  m_listsvc.sort();
373  // we work on a copy to avoid to operate twice on the services created on demand
374  // which are already in the correct state.
375  // only act on active services
377  // Re-Initialize all services
378  for ( auto& svc : activeSvc( m_listsvc ) ) {
379  sc = svc->sysReinitialize();
380  if ( !sc.isSuccess() ) {
381  error() << "Unable to re-initialize Service: " << svc->name() << endmsg;
382  return StatusCode::FAILURE;
383  }
384  }
385  return StatusCode::SUCCESS;
386 }
387 
388 //------------------------------------------------------------------------------
390 //------------------------------------------------------------------------------
391 {
392  // ensure that the list is ordered by priority
393  m_listsvc.sort();
394  // we work on a copy to avoid to operate twice on the services created on demand
395  // which are already in the correct state.
396  // only act on active services
398  // Re-Start all services
399  for ( auto& svc : activeSvc( m_listsvc ) ) {
400  sc = svc->sysRestart();
401  if ( !sc.isSuccess() ) {
402  error() << "Unable to re-start Service: " << svc->name() << endmsg;
403  return StatusCode::FAILURE;
404  }
405  }
406  return StatusCode::SUCCESS;
407 }
408 
409 //------------------------------------------------------------------------------
411 //------------------------------------------------------------------------------
412 {
413  // make sure that HistogramDataSvc and THistSvc get finalized after the
414  // ToolSvc, and the FileMgr after that
415  int pri_tool = getPriority( "ToolSvc" );
416  if ( pri_tool != 0 ) {
417  setPriority( "THistSvc", pri_tool - 10 ).ignore();
418  setPriority( "ChronoStatSvc", pri_tool - 20 ).ignore();
419  setPriority( "AuditorSvc", pri_tool - 30 ).ignore();
420  setPriority( "NTupleSvc", pri_tool - 10 ).ignore();
421  setPriority( "HistogramDataSvc", pri_tool - 10 ).ignore();
422  // Preserve the relative ordering between HistogramDataSvc and HistogramPersistencySvc
423  setPriority( "HistogramPersistencySvc", pri_tool - 20 ).ignore();
424  setPriority( "HistorySvc", pri_tool - 30 ).ignore();
425  setPriority( "FileMgr", pri_tool - 40 ).ignore();
426  }
427 
428  // get list of PostFinalize clients
430  auto p_inc = service<IIncidentSvc>( "IncidentSvc", false );
431  if ( p_inc ) {
432  p_inc->getListeners( postFinList, IncidentType::SvcPostFinalize );
433  p_inc.reset();
434  }
435 
436  // ensure that the list is ordered by priority
437  m_listsvc.sort();
438  // dump();
439 
441  {
442  // we work on a copy to avoid to operate twice on the services created on demand
443  // which are already in the correct state.
444  // only act on active services
445  // call finalize() for all services in reverse order
446  for ( const auto& svc : reverse( activeSvc( m_listsvc ) ) ) {
447  const std::string& name = svc->name();
448  // ignore the current state for the moment
449  // if( Gaudi::StateMachine::INITIALIZED == svc->state() )
450  DEBMSG << "Finalizing service " << name << endmsg;
451  if ( !svc->sysFinalize().isSuccess() ) {
452  warning() << "Finalization of service " << name << " failed" << endmsg;
453  sc = StatusCode::FAILURE;
454  }
455  }
456  }
457 
458  // call SvcPostFinalize on all clients
459  if ( !postFinList.empty() ) {
460  DEBMSG << "Will call SvcPostFinalize for " << postFinList.size() << " clients" << endmsg;
461  Incident inc( "ServiceManager", IncidentType::SvcPostFinalize );
462  for ( auto& itr : postFinList ) itr->handle( inc );
463  }
464 
465  // loop over all Active Services, removing them one by one.
466  // They should be deleted because the reference counting goes to 0.
467  DEBMSG << "Looping over all active services..." << endmsg;
468  auto it = m_listsvc.begin();
469  while ( it != m_listsvc.end() ) {
470  DEBMSG << "---- " << it->service->name() << " (refCount = " << it->service->refCount() << ")" << endmsg;
471  if ( it->service->refCount() < 1 ) {
472  warning() << "Too low reference count for " << it->service->name() << " (should not go below 1 at this point)"
473  << endmsg;
474  it->service->addRef();
475  }
476  if ( it->active ) {
477  it = m_listsvc.erase( it );
478  } else {
479  ++it;
480  }
481  }
482  return sc;
483 }
484 
485 //------------------------------------------------------------------------------
486 int ServiceManager::getPriority( std::string_view name ) const {
487  //------------------------------------------------------------------------------
488  auto it = find( name );
489  return ( it != m_listsvc.end() ) ? it->priority : 0;
490 }
491 
492 //------------------------------------------------------------------------------
493 StatusCode ServiceManager::setPriority( std::string_view name, int prio ) {
494  //------------------------------------------------------------------------------
495  auto it = find( name );
496  if ( it == m_listsvc.end() ) return StatusCode::FAILURE;
497  it->priority = prio;
498  return StatusCode::SUCCESS;
499 }
500 
501 //------------------------------------------------------------------------------
502 // Get the value of the initialization loop check flag.
503 //------------------------------------------------------------------------------
505 //------------------------------------------------------------------------------
506 // Set the value of the initialization loop check flag.
507 //------------------------------------------------------------------------------
509 
510 //------------------------------------------------------------------------------
511 // Dump out contents of service list
512 //------------------------------------------------------------------------------
513 void ServiceManager::dump() const {
514 
515  auto& log = info();
516  log << "\n"
517  << "===================== listing all services ===================\n"
518  << " prior ref name active\n";
519 
520  for ( const auto& svc : m_listsvc ) {
521 
522  log.width( 6 );
523  log.flags( std::ios_base::right );
524  log << svc.priority << " ";
525  log.width( 5 );
526  log << svc.service->refCount() << " ";
527  log.width( 30 );
528  log.flags( std::ios_base::left );
529  log << svc.service->name() << " ";
530  log.width( 2 );
531  log << svc.active << std::endl;
532  }
533 
534  log << "=================================================================\n";
535  log << endmsg;
536 }
537 
539  resetMessaging();
540  for ( auto& svcItem : m_listsvc ) {
541  const auto svc = dynamic_cast<Service*>( svcItem.service.get() );
542  if ( svc ) svc->resetMessaging();
543  }
544 }
545 
ComponentManager::targetFSMState
Gaudi::StateMachine::State targetFSMState() const override
When we are in the middle of a transition, get the state where the transition is leading us.
Definition: ComponentManager.h:73
IService
Definition: IService.h:28
ServiceManager::loopCheckEnabled
bool loopCheckEnabled() const override
Get the value of the initialization loop check flag.
Definition: ServiceManager.cpp:504
IService.h
std::string
STL class.
Gaudi.Configuration.log
log
Definition: Configuration.py:28
std::list< IService * >
std::move
T move(T... args)
CommonMessaging< implements< IComponentManager > >::resetMessaging
MSG::Level resetMessaging()
Reinitialize internal states.
Definition: CommonMessaging.h:179
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:314
ServiceManager::start
StatusCode start() override
Start (from INITIALIZED to RUNNING).
Definition: ServiceManager.cpp:301
System.h
reverse
::details::reverse_wrapper< T > reverse(T &&iterable)
Definition: reverse.h:59
ServiceManager::outputLevelUpdate
void outputLevelUpdate() override
Function to call to update the outputLevel of the components (after a change in MessageSvc).
Definition: ServiceManager.cpp:538
reverse.h
std::vector
STL class.
std::map::find
T find(T... args)
ServiceManager::~ServiceManager
~ServiceManager() override
virtual destructor
Definition: ServiceManager.cpp:62
std::vector::size
T size(T... args)
std::back_inserter
T back_inserter(T... args)
ServiceManager::dump
void dump() const
Definition: ServiceManager.cpp:513
ServiceManager
Definition: ServiceManager.h:46
std::map::emplace
T emplace(T... args)
ServiceManager.h
std::list::back
T back(T... args)
ObjectFactory.h
ServiceManager::ServiceItem::service
SmartIF< IService > service
Definition: ServiceManager.h:50
ServiceManager::reinitialize
StatusCode reinitialize() override
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
Definition: ServiceManager.cpp:368
std::list::sort
T sort(T... args)
Service
Definition: Service.h:46
std::list::clear
T clear(T... args)
IIncidentSvc.h
std::list::push_back
T push_back(T... args)
SmartIF.h
ServiceManager::m_appSvc
SmartIF< IService > m_appSvc
Pointer to the application IService interface.
Definition: ServiceManager.h:179
std::piecewise_construct_t
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:20
ServiceManager::addService
StatusCode addService(IService *svc, int prio=DEFAULT_SVC_PRIORITY) override
implementation of ISvcManager::addService
Definition: ServiceManager.cpp:119
Gaudi::StateMachine::CONFIGURED
@ CONFIGURED
Definition: StateMachine.h:24
StatusCode
Definition: StatusCode.h:65
ServiceManager::initialize
StatusCode initialize() override
Initialization (from CONFIGURED to INITIALIZED).
Definition: ServiceManager.cpp:267
DEBMSG
#define DEBMSG
Definition: ServiceManager.cpp:34
CommonMessaging
Definition: CommonMessaging.h:66
Gaudi::StateMachine::OFFLINE
@ OFFLINE
Definition: StateMachine.h:23
ServiceManager::removeService
StatusCode removeService(IService *svc) override
implementation of ISvcManager::removeService
Definition: ServiceManager.cpp:239
ServiceManager::service
SmartIF< IService > & service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true) override
Returns a smart pointer to a service.
Definition: ServiceManager.cpp:178
ServiceManager::m_listsvc
ListSvc m_listsvc
List of service maintained by ServiceManager This contains SmartIF<T> for all services – and because ...
Definition: ServiceManager.h:161
ServiceManager::declareSvcType
StatusCode declareSvcType(std::string svcname, std::string svctype) override
implementation of ISvcManager::declareSvcType
Definition: ServiceManager.cpp:259
ServiceManager::finalize
StatusCode finalize() override
Finalize (from INITIALIZED to CONFIGURED).
Definition: ServiceManager.cpp:410
std::list::erase
T erase(T... args)
ServiceManager::createService
SmartIF< IService > & createService(const Gaudi::Utils::TypeNameString &nametype) override
implementation of ISvcManager::createService NOTE: as this returns a &, we must guarantee that once c...
Definition: ServiceManager.cpp:69
ServiceManager::m_loopCheck
bool m_loopCheck
Check for service initialization loops.
Definition: ServiceManager.h:176
ServiceManager::ServiceManager
ServiceManager(IInterface *application)
default creator
Definition: ServiceManager.cpp:54
SmartIF< IService >
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
std::forward_as_tuple
T forward_as_tuple(T... args)
ServiceManager::m_lockMap
std::map< std::string, std::recursive_mutex > m_lockMap
Definition: ServiceManager.h:188
std::transform
T transform(T... args)
Gaudi::StateMachine::RUNNING
@ RUNNING
Definition: StateMachine.h:26
ServiceManager::find
ListSvc::iterator find(std::string_view name)
Definition: ServiceManager.h:143
TypeNameString.h
StatusCode::ignore
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Definition: StatusCode.h:139
Service.h
ServiceManager::m_listOfPtrs
std::list< IService * > m_listOfPtrs
List of pointers to the know services used to implement getServices()
Definition: ServiceManager.h:182
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:129
ServiceManager::setLoopCheckEnabled
void setLoopCheckEnabled(bool en) override
Set the value of the initialization loop check flag.
Definition: ServiceManager.cpp:508
gaudirun.type
type
Definition: gaudirun.py:160
std::list::emplace_back
T emplace_back(T... args)
ComponentManager::m_svcLocator
SmartIF< ISvcLocator > m_svcLocator
Service locator (needed to access the MessageSvc)
Definition: ComponentManager.h:86
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
std::endl
T endl(T... args)
ServiceManager::getPriority
int getPriority(std::string_view name) const override
manage priorities of services
Definition: ServiceManager.cpp:486
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:86
GaudiDict::typeName
std::string typeName(const std::type_info &typ)
Definition: Dictionary.cpp:31
std::begin
T begin(T... args)
IIncidentListener.h
ServiceManager::existsService
bool existsService(std::string_view name) const override
implementation of ISvcLocation::existsService
Definition: ServiceManager.cpp:232
Gaudi::StateMachine::INITIALIZED
@ INITIALIZED
Definition: StateMachine.h:25
IInterface
Definition: IInterface.h:239
GaudiPartProp.tests.lst
lst
Definition: tests.py:37
isValidInterface
bool isValidInterface(IFace *i)
Templated function that throws an exception if the version if the interface implemented by the object...
Definition: IInterface.h:336
std::vector::empty
T empty(T... args)
Properties.v
v
Definition: Properties.py:122
ServiceManager::restart
StatusCode restart() override
Initialization (from RUNNING to RUNNING, via INITIALIZED).
Definition: ServiceManager.cpp:389
ServiceManager::m_gLock
std::recursive_mutex m_gLock
Mutex to synchronize shared service initialization between threads.
Definition: ServiceManager.h:187
std::map::end
T end(T... args)
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
ServiceManager::getServices
const std::list< IService * > & getServices() const override
Return the list of Services.
Definition: ServiceManager.cpp:222
std::prev
T prev(T... args)
Incident.h
ServiceManager::name
const std::string & name() const override
Return the name of the manager (implementation of INamedInterface)
Definition: ServiceManager.h:120
ServiceManager::stop
StatusCode stop() override
Stop (from RUNNING to INITIALIZED).
Definition: ServiceManager.cpp:334
Incident
Definition: Incident.h:27
gaudirun.application
application
Definition: gaudirun.py:323
DECLARE_OBJECT_FACTORY
#define DECLARE_OBJECT_FACTORY(x)
Definition: ObjectFactory.h:25
Gaudi::Interfaces::IOptionsSvc
Interface for a component that manages application configuration options.
Definition: IOptionsSvc.h:46
ServiceManager::m_maptype
MapType m_maptype
Map of service name and service type.
Definition: ServiceManager.h:175
MsgStream.h
ServiceManager::setPriority
StatusCode setPriority(std::string_view name, int pri) override
Definition: ServiceManager.cpp:493