Gaudi Framework, version v23r2

Home   Generated: Thu Jun 28 2012
Public Member Functions

Gaudi::BootSvcLocator Class Reference

A dual-stage boostrap mechanism is used to ensure an orderly startup of the ApplicationMgr. More...

Inheritance diagram for Gaudi::BootSvcLocator:
Inheritance graph
[legend]
Collaboration diagram for Gaudi::BootSvcLocator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BootSvcLocator ()
virtual ~BootSvcLocator ()
virtual StatusCode getService (const Gaudi::Utils::TypeNameString &typeName, const InterfaceID &iid, IInterface *&pinterface)
 Get a specific interface pointer given a service name and interface id.
virtual StatusCode getService (const Gaudi::Utils::TypeNameString &typeName, IService *&svc, const bool createIf=true)
 Get a reference to the service given a service name.
virtual const std::list
< IService * > & 
getServices () const
 Get a reference to a service and create it if it does not exists.
virtual bool existsService (const std::string &name) const
 Check the existence of a service given a service name.
virtual SmartIF< IService > & service (const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)
 Returns a smart pointer to a service.

Detailed Description

A dual-stage boostrap mechanism is used to ensure an orderly startup of the ApplicationMgr.

If this function is called before the singleton ApplicationMgr instance exists, a BootstrapAppMgr singleton instance is created. This responds to any subsequent requests for services by returning StatusCode::FAILURE, unless the ApplicationMgr singleton instance has been created in the interim. In this case, the BootstrapAppMgr forwards the request to the ApplicationMgr instance. The motiviation for this is to handle static object instances where the constructor attempts to locate services and would otherwise instantiate the ApplicationMgr instance in an unorderly manner. This logic requires that the ApplicationMgr instance is created explicitly.

Definition at line 37 of file Bootstrap.cpp.


Constructor & Destructor Documentation

BootSvcLocator::BootSvcLocator (  )

Definition at line 237 of file Bootstrap.cpp.

                               {
}
BootSvcLocator::~BootSvcLocator (  ) [virtual]

Definition at line 239 of file Bootstrap.cpp.

                                {
}

Member Function Documentation

bool Gaudi::BootSvcLocator::existsService ( const std::string name ) const [virtual]

Check the existence of a service given a service name.

Implements ISvcLocator.

Definition at line 275 of file Bootstrap.cpp.

                                                                     {
  bool result = false;
  if ( s_appmgrInstance.isValid() ) {
    result = s_svclocInstance->existsService(name);
  }
  return result;
}
StatusCode Gaudi::BootSvcLocator::getService ( const Gaudi::Utils::TypeNameString &  typeName,
const InterfaceID iid,
IInterface *&  pinterface 
) [virtual]

Get a specific interface pointer given a service name and interface id.

Parameters:
nameService name
iidInterface ID
pinterfaceReturned pointer to the requested interface

Reimplemented from ISvcLocator.

Definition at line 243 of file Bootstrap.cpp.

                                                                 {
  StatusCode sc = StatusCode::FAILURE;
  if ( s_appmgrInstance.isValid() ) {
    sc = s_svclocInstance->getService(typeName, iid, pinterface );
  } else {
    pinterface = s_bootInterface.get();
  }
  return sc;
}
StatusCode Gaudi::BootSvcLocator::getService ( const Gaudi::Utils::TypeNameString &  typeName,
IService *&  svc,
const bool  createIf = true 
) [virtual]

Get a reference to the service given a service name.

Parameters:
nameService name
svcReturned service pointer

Reimplemented from ISvcLocator.

Definition at line 254 of file Bootstrap.cpp.

                                                             {
  StatusCode sc = StatusCode::FAILURE;
  if ( s_appmgrInstance.isValid() ) {
    sc = s_svclocInstance->getService(typeName, svc, createIf );
  } else {
    svc = s_bootService.get();
  }
  return sc;
}
const std::list< IService * > & Gaudi::BootSvcLocator::getServices (  ) const [virtual]

Get a reference to a service and create it if it does not exists.

Parameters:
nameService name
svcReturned service pointer
createIfflag to control the creation Return the list of Services

Implements ISvcLocator.

Definition at line 267 of file Bootstrap.cpp.

                                                                  {
  StatusCode sc = StatusCode::FAILURE;
  if ( s_appmgrInstance.isValid() ) {
    return s_svclocInstance->getServices( );
  } else {
    return s_bootServices;
  }
}
SmartIF< IService > & Gaudi::BootSvcLocator::service ( const Gaudi::Utils::TypeNameString &  typeName,
const bool  createIf = true 
) [virtual]

Returns a smart pointer to a service.

Implements ISvcLocator.

Definition at line 284 of file Bootstrap.cpp.

                                                                                                             {
  if ( s_appmgrInstance.isValid() ) {
    return s_svclocInstance->service(typeName, createIf);
  } else {
    return s_bootService;
  }
}

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Thu Jun 28 2012 23:27:48 for Gaudi Framework, version v23r2 by Doxygen version 1.7.2 written by Dimitri van Heesch, © 1997-2004