Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v36r7 (7f57a304)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ServiceManager.cpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 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 
111  service->setServiceManager( this );
112  return m_listsvc.back().service; // DANGER: returns a reference to a SmartIF in m_listsvc, and hence does no longer
113  // allow relocations of those...
114 }
115 
116 //------------------------------------------------------------------------------
117 // add a service to the managed list
119 //------------------------------------------------------------------------------
120 {
121  auto it = find( svc );
122  auto lck = std::scoped_lock{ m_gLock };
123  if ( it != m_listsvc.end() ) {
124  it->priority = prio; // if the service is already known, it is equivalent to a setPriority
125  it->active = true; // and make it active
126  } else {
127  m_listsvc.emplace_back( svc, prio, true );
128  }
129  return StatusCode::SUCCESS;
130 }
131 
132 //------------------------------------------------------------------------------
133 // add the service with the give type and name to the active list
135 //------------------------------------------------------------------------------
136 {
137  auto it = find( typeName.name() ); // try to find the service by name
138  if ( it == m_listsvc.end() ) { // not found
139  // If the service does not exist, we create it
140  SmartIF<IService>& svc =
141  createService( typeName ); // WARNING: svc is now a reference to something that lives in m_listsvc
142  if ( !svc ) return StatusCode::FAILURE;
143  it = find( svc.get() ); // now it is in the list because createService added it
144  it->priority = prio;
146  if ( targetFSMState() >= Gaudi::StateMachine::INITIALIZED ) { // WARNING: this can trigger a recursion!!!
147  sc = svc->sysInitialize();
148  if ( sc.isSuccess() && targetFSMState() >= Gaudi::StateMachine::RUNNING ) { sc = svc->sysStart(); }
149  }
150  if ( sc.isFailure() ) { // if initialization failed, remove it from the list
151  error() << "Unable to initialize service \"" << typeName.name() << "\"" << endmsg;
152  auto lck = std::scoped_lock{ m_gLock };
153  m_listsvc.erase( it );
154  // Note: removing it from the list + the SmartIF going out of scope should trigger the delete
155  // delete svc.get();
156  return sc;
157  }
158  // initialization successful, we can work with the service
159  // Move the just initialized service to the back of the list
160  // (we care more about order of initialization than of creation)
161  auto lck = std::scoped_lock{ m_gLock };
162  m_listsvc.push_back( *it );
163  m_listsvc.erase( it );
164  it = std::prev( std::end( m_listsvc ) ); // last entry (the iterator was invalidated by erase)
165  } else {
166  // if the service is already known, it is equivalent to a setPriority
167  it->priority = prio;
168  }
169  // 'it' is defined because either we found the service or we created it
170  // Now we can activate the service
171  it->active = true; // and make it active
172  return StatusCode::SUCCESS;
173 }
174 
175 //------------------------------------------------------------------------------
176 // Returns a smart pointer to a service.
178  const std::string& name = typeName.name();
179 
180  // Acquire the RAII lock to avoid simultaneous attempts from different threads to initialize a service
181 
182  auto* imut = [&] {
183  // get the global lock, then extract/create the service specific mutex
184  // then release global lock
185 
186  auto lk = std::scoped_lock{ this->m_gLock };
187  auto mit = m_lockMap.find( name );
188  if ( mit == m_lockMap.end() ) {
190  .first;
191  }
192  return &mit->second;
193  }();
194 
195  {
196  // now we have the service specific lock on the above mutex
197  auto lk2 = std::scoped_lock{ *imut };
198 
199  auto it = find( name );
200 
201  if ( it != m_listsvc.end() ) {
202  if ( m_loopCheck && ( createIf && it->service->FSMState() == Gaudi::StateMachine::CONFIGURED ) ) {
203  error() << "Initialization loop detected when creating service \"" << name << "\"" << endmsg;
204  return no_service;
205  }
206  return it->service;
207  }
208 
209  // Service not found. The user may be interested in one of the interfaces
210  // of the application manager itself
211  if ( name == "ApplicationMgr" || name == "APPMGR" || name == "" ) { return m_appSvc; }
212 
213  // last resort: we try to create the service
214  if ( createIf && addService( typeName ).isSuccess() ) { return find( name )->service; }
215 
216  return no_service;
217  }
218 }
219 
220 //------------------------------------------------------------------------------
222 //------------------------------------------------------------------------------
223 {
226  []( ListSvc::const_reference i ) { return i.service.get(); } );
227  return m_listOfPtrs;
228 }
229 
230 //------------------------------------------------------------------------------
231 bool ServiceManager::existsService( std::string_view name ) const
232 //------------------------------------------------------------------------------
233 {
234  return find( name ) != m_listsvc.end();
235 }
236 
237 //------------------------------------------------------------------------------
239 //------------------------------------------------------------------------------
240 {
241  auto it = find( svc );
242  if ( it == m_listsvc.end() ) return StatusCode::FAILURE;
243  m_listsvc.erase( it );
244  return StatusCode::SUCCESS;
245 }
246 
247 //------------------------------------------------------------------------------
249 //------------------------------------------------------------------------------
250 {
251  auto it = find( name );
252  if ( it == m_listsvc.end() ) return StatusCode::FAILURE;
253  m_listsvc.erase( it );
254  return StatusCode::SUCCESS;
255 }
256 
257 //------------------------------------------------------------------------------
259 //------------------------------------------------------------------------------
260 {
261  m_maptype.insert_or_assign( std::move( svcname ), std::move( svctype ) );
262  return StatusCode::SUCCESS;
263 }
264 
265 //------------------------------------------------------------------------------
267 //------------------------------------------------------------------------------
268 {
269  // ensure that the list is ordered by priority
270  m_listsvc.sort();
271  // we work on a copy to avoid to operate twice on the services created on demand
272  // which are already in the correct state.
273 
275  // call initialize() for all services
276  for ( auto& it : activeSvc( m_listsvc ) ) {
277  const std::string& name = it->name();
278  switch ( it->FSMState() ) {
280  DEBMSG << "Service " << name << " already initialized" << endmsg;
281  break;
283  DEBMSG << "Initializing service " << name << endmsg;
284  sc = it->sysInitialize();
285  if ( !sc.isSuccess() ) {
286  error() << "Unable to initialize Service: " << name << endmsg;
287  return sc;
288  }
289  break;
290  default:
291  error() << "Service " << name << " not in the correct state to be initialized (" << it->FSMState() << ")"
292  << endmsg;
293  return StatusCode::FAILURE;
294  }
295  }
296  return StatusCode::SUCCESS;
297 }
298 
299 //------------------------------------------------------------------------------
301 //------------------------------------------------------------------------------
302 {
303  // ensure that the list is ordered by priority
304  m_listsvc.sort();
305  // we work on a copy to avoid to operate twice on the services created on demand
306  // (which are already in the correct state.
307  // only act on active services
309  // call initialize() for all services
310  for ( auto& it : activeSvc( m_listsvc ) ) {
311  const std::string& name = it->name();
312  switch ( it->FSMState() ) {
314  DEBMSG << "Service " << name << " already started" << endmsg;
315  break;
317  DEBMSG << "Starting service " << name << endmsg;
318  sc = it->sysStart();
319  if ( !sc.isSuccess() ) {
320  error() << "Unable to start Service: " << name << endmsg;
321  return sc;
322  }
323  break;
324  default:
325  error() << "Service " << name << " not in the correct state to be started (" << it->FSMState() << ")" << endmsg;
326  return StatusCode::FAILURE;
327  }
328  }
329  return StatusCode::SUCCESS;
330 }
331 
332 //------------------------------------------------------------------------------
334 //------------------------------------------------------------------------------
335 {
336  // ensure that the list is ordered by priority
337  m_listsvc.sort();
338  // we work on a copy to avoid to operate twice on the services created on demand
339  // which are already in the correct state.
340  // only act on active services
341 
343  // call stop() for all services
344  for ( const auto& svc : reverse( activeSvc( m_listsvc ) ) ) {
345  const std::string& name = svc->name();
346  switch ( svc->FSMState() ) {
348  DEBMSG << "Service " << name << " already stopped" << endmsg;
349  break;
351  DEBMSG << "Stopping service " << name << endmsg;
352  sc = svc->sysStop();
353  if ( !sc.isSuccess() ) {
354  error() << "Unable to stop Service: " << name << endmsg;
355  return sc;
356  }
357  break;
358  default:
359  DEBMSG << "Service " << name << " not in the correct state to be stopped (" << svc->FSMState() << ")" << endmsg;
360  return StatusCode::FAILURE;
361  }
362  }
363  return StatusCode::SUCCESS;
364 }
365 
366 //------------------------------------------------------------------------------
368 //------------------------------------------------------------------------------
369 {
370  // ensure that the list is ordered by priority
371  m_listsvc.sort();
372  // we work on a copy to avoid to operate twice on the services created on demand
373  // which are already in the correct state.
374  // only act on active services
376  // Re-Initialize all services
377  for ( auto& svc : activeSvc( m_listsvc ) ) {
378  sc = svc->sysReinitialize();
379  if ( !sc.isSuccess() ) {
380  error() << "Unable to re-initialize Service: " << svc->name() << endmsg;
381  return StatusCode::FAILURE;
382  }
383  }
384  return StatusCode::SUCCESS;
385 }
386 
387 //------------------------------------------------------------------------------
389 //------------------------------------------------------------------------------
390 {
391  // ensure that the list is ordered by priority
392  m_listsvc.sort();
393  // we work on a copy to avoid to operate twice on the services created on demand
394  // which are already in the correct state.
395  // only act on active services
397  // Re-Start all services
398  for ( auto& svc : activeSvc( m_listsvc ) ) {
399  sc = svc->sysRestart();
400  if ( !sc.isSuccess() ) {
401  error() << "Unable to re-start Service: " << svc->name() << endmsg;
402  return StatusCode::FAILURE;
403  }
404  }
405  return StatusCode::SUCCESS;
406 }
407 
408 //------------------------------------------------------------------------------
410 //------------------------------------------------------------------------------
411 {
412  // make sure that HistogramDataSvc and THistSvc get finalized after the
413  // ToolSvc, and the FileMgr after that
414  int pri_tool = getPriority( "ToolSvc" );
415  if ( pri_tool != 0 ) {
416  setPriority( "THistSvc", pri_tool - 10 ).ignore();
417  setPriority( "ChronoStatSvc", pri_tool - 20 ).ignore();
418  setPriority( "AuditorSvc", pri_tool - 30 ).ignore();
419  setPriority( "NTupleSvc", pri_tool - 10 ).ignore();
420  setPriority( "HistogramDataSvc", pri_tool - 10 ).ignore();
421  // Preserve the relative ordering between HistogramDataSvc and HistogramPersistencySvc
422  setPriority( "HistogramPersistencySvc", pri_tool - 20 ).ignore();
423  setPriority( "HistorySvc", pri_tool - 30 ).ignore();
424  setPriority( "FileMgr", pri_tool - 40 ).ignore();
425  }
426 
427  // get list of PostFinalize clients
429  auto p_inc = service<IIncidentSvc>( "IncidentSvc", false );
430  if ( p_inc ) {
431  p_inc->getListeners( postFinList, IncidentType::SvcPostFinalize );
432  p_inc.reset();
433  }
434 
435  // ensure that the list is ordered by priority
436  m_listsvc.sort();
437  // dump();
438 
440  {
441  // we work on a copy to avoid to operate twice on the services created on demand
442  // which are already in the correct state.
443  // only act on active services
444  // call finalize() for all services in reverse order
445  for ( const auto& svc : reverse( activeSvc( m_listsvc ) ) ) {
446  const std::string& name = svc->name();
447  // ignore the current state for the moment
448  // if( Gaudi::StateMachine::INITIALIZED == svc->state() )
449  DEBMSG << "Finalizing service " << name << endmsg;
450  if ( !svc->sysFinalize().isSuccess() ) {
451  warning() << "Finalization of service " << name << " failed" << endmsg;
452  sc = StatusCode::FAILURE;
453  }
454  }
455  }
456 
457  // call SvcPostFinalize on all clients
458  if ( !postFinList.empty() ) {
459  DEBMSG << "Will call SvcPostFinalize for " << postFinList.size() << " clients" << endmsg;
460  Incident inc( "ServiceManager", IncidentType::SvcPostFinalize );
461  for ( auto& itr : postFinList ) itr->handle( inc );
462  }
463 
464  // loop over all Active Services, removing them one by one.
465  // They should be deleted because the reference counting goes to 0.
466  DEBMSG << "Looping over all active services..." << endmsg;
467  auto it = m_listsvc.begin();
468  while ( it != m_listsvc.end() ) {
469  DEBMSG << "---- " << it->service->name() << " (refCount = " << it->service->refCount() << ")" << endmsg;
470  if ( it->service->refCount() < 1 ) {
471  warning() << "Too low reference count for " << it->service->name() << " (should not go below 1 at this point)"
472  << endmsg;
473  it->service->addRef();
474  }
475  if ( it->active ) {
476  it = m_listsvc.erase( it );
477  } else {
478  ++it;
479  }
480  }
481  return sc;
482 }
483 
484 //------------------------------------------------------------------------------
485 int ServiceManager::getPriority( std::string_view name ) const {
486  //------------------------------------------------------------------------------
487  auto it = find( name );
488  return ( it != m_listsvc.end() ) ? it->priority : 0;
489 }
490 
491 //------------------------------------------------------------------------------
492 StatusCode ServiceManager::setPriority( std::string_view name, int prio ) {
493  //------------------------------------------------------------------------------
494  auto it = find( name );
495  if ( it == m_listsvc.end() ) return StatusCode::FAILURE;
496  it->priority = prio;
497  return StatusCode::SUCCESS;
498 }
499 
500 //------------------------------------------------------------------------------
501 // Get the value of the initialization loop check flag.
502 //------------------------------------------------------------------------------
504 //------------------------------------------------------------------------------
505 // Set the value of the initialization loop check flag.
506 //------------------------------------------------------------------------------
508 
509 //------------------------------------------------------------------------------
510 // Dump out contents of service list
511 //------------------------------------------------------------------------------
512 void ServiceManager::dump() const {
513 
514  auto& log = info();
515  log << "\n"
516  << "===================== listing all services ===================\n"
517  << " prior ref name active\n";
518 
519  for ( const auto& svc : m_listsvc ) {
520 
521  log.width( 6 );
522  log.flags( std::ios_base::right );
523  log << svc.priority << " ";
524  log.width( 5 );
525  log << svc.service->refCount() << " ";
526  log.width( 30 );
527  log.flags( std::ios_base::left );
528  log << svc.service->name() << " ";
529  log.width( 2 );
530  log << svc.active << std::endl;
531  }
532 
533  log << "=================================================================\n";
534  log << endmsg;
535 }
536 
538  resetMessaging();
539  for ( auto& svcItem : m_listsvc ) {
540  const auto svc = dynamic_cast<Service*>( svcItem.service.get() );
541  if ( svc ) svc->resetMessaging();
542  }
543 }
544 
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:503
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:300
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:537
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:512
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:367
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:118
Gaudi::StateMachine::CONFIGURED
@ CONFIGURED
Definition: StateMachine.h:24
TimingHistograms.name
name
Definition: TimingHistograms.py:25
StatusCode
Definition: StatusCode.h:65
ServiceManager::initialize
StatusCode initialize() override
Initialization (from CONFIGURED to INITIALIZED).
Definition: ServiceManager.cpp:266
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:238
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:177
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:258
ServiceManager::finalize
StatusCode finalize() override
Finalize (from INITIALIZED to CONFIGURED).
Definition: ServiceManager.cpp:409
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:203
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
HistoDumpEx.v
v
Definition: HistoDumpEx.py:27
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:507
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
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:485
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:231
Gaudi::StateMachine::INITIALIZED
@ INITIALIZED
Definition: StateMachine.h:25
IInterface
Definition: IInterface.h:237
isValidInterface
bool isValidInterface(IFace *i)
Templated function that throws an exception if the version if the interface implemented by the object...
Definition: IInterface.h:334
std::vector::empty
T empty(T... args)
ServiceManager::restart
StatusCode restart() override
Initialization (from RUNNING to RUNNING, via INITIALIZED).
Definition: ServiceManager.cpp:388
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:221
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:333
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:492