All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
galleryUtils.ServiceRegistryClass Class Reference

Public Member Functions

def __init__
 
def config
 
def has
 
def register
 
def registeredServiceNames
 
def registry
 
def get
 
def __call__
 
def create
 
def __init__
 
def config
 
def has
 
def register
 
def registeredServiceNames
 
def registry
 
def get
 
def __call__
 
def create
 

Public Attributes

 fullConfig
 
 services
 

Detailed Description

Definition at line 454 of file icarusalg/icarusalg/gallery/helpers/python/galleryUtils.py.

Constructor & Destructor Documentation

def galleryUtils.ServiceRegistryClass.__init__ (   self,
  config 
)
def galleryUtils.ServiceRegistryClass.__init__ (   self,
  config 
)

Definition at line 371 of file sbndcode/sbndcode/gallery/python/galleryUtils.py.

372  def __init__(self, config):
373  self.fullConfig = config if isinstance(config, ConfigurationClass) else ConfigurationClass(config)
self.services = {}

Member Function Documentation

def galleryUtils.ServiceRegistryClass.__call__ (   self,
  serviceName 
)

Definition at line 389 of file sbndcode/sbndcode/gallery/python/galleryUtils.py.

390  def __call__(self, serviceName): return self.get(serviceName)
def galleryUtils.ServiceRegistryClass.__call__ (   self,
  serviceName 
)

Definition at line 473 of file icarusalg/icarusalg/gallery/helpers/python/galleryUtils.py.

474  def __call__(self, serviceName): return self.get(serviceName)
def galleryUtils.ServiceRegistryClass.config (   self,
  serviceName 
)

Definition at line 376 of file sbndcode/sbndcode/gallery/python/galleryUtils.py.

377  def config(self, serviceName): return self.fullConfig.service(serviceName)
def galleryUtils.ServiceRegistryClass.config (   self,
  serviceName 
)

Definition at line 460 of file icarusalg/icarusalg/gallery/helpers/python/galleryUtils.py.

461  def config(self, serviceName): return self.fullConfig.service(serviceName)
def galleryUtils.ServiceRegistryClass.create (   self,
  serviceName,
  serviceClass,
  otherServiceConstructorArgs 
)

Definition at line 391 of file sbndcode/sbndcode/gallery/python/galleryUtils.py.

392  def create(self, serviceName, serviceClass, *otherServiceConstructorArgs):
393  serviceConfig = self.config(serviceName)
394  if not serviceConfig:
395  raise RuntimeError("Couldn't find the configuration for service '%s'" % serviceName)
396  service = serviceClass(serviceConfig, *otherServiceConstructorArgs)
397  if not service:
398  raise RuntimeError("Failed to create service '%s' (type: %s)" % (serviceName, serviceClass.__class__.__name__))
return self.register(serviceName, service)
def galleryUtils.ServiceRegistryClass.create (   self,
  serviceName,
  serviceClass,
  otherServiceConstructorArgs 
)

Definition at line 475 of file icarusalg/icarusalg/gallery/helpers/python/galleryUtils.py.

476  def create(self, serviceName, serviceClass, *otherServiceConstructorArgs):
477  serviceConfig = self.config(serviceName)
478  if not serviceConfig:
479  raise RuntimeError("Couldn't find the configuration for service '%s'" % serviceName)
480  service = serviceClass(serviceConfig, *otherServiceConstructorArgs)
481  if not service:
482  raise RuntimeError("Failed to create service '%s' (type: %s)" % (serviceName, serviceClass.__class__.__name__))
return self.register(serviceName, service)
def galleryUtils.ServiceRegistryClass.get (   self,
  serviceName 
)

Definition at line 388 of file sbndcode/sbndcode/gallery/python/galleryUtils.py.

def get(self, serviceName): return self.services[serviceName]
def galleryUtils.ServiceRegistryClass.get (   self,
  serviceName 
)

Definition at line 472 of file icarusalg/icarusalg/gallery/helpers/python/galleryUtils.py.

def get(self, serviceName): return self.services[serviceName]
def galleryUtils.ServiceRegistryClass.has (   self,
  serviceName 
)

Definition at line 378 of file sbndcode/sbndcode/gallery/python/galleryUtils.py.

379  def has(self, serviceName): return serviceName in self.services
def galleryUtils.ServiceRegistryClass.has (   self,
  serviceName 
)

Definition at line 462 of file icarusalg/icarusalg/gallery/helpers/python/galleryUtils.py.

463  def has(self, serviceName): return serviceName in self.services
def galleryUtils.ServiceRegistryClass.register (   self,
  serviceName,
  service 
)

Definition at line 380 of file sbndcode/sbndcode/gallery/python/galleryUtils.py.

381  def register(self, serviceName, service):
382  self.services[serviceName] = service
383  return service
def galleryUtils.ServiceRegistryClass.register (   self,
  serviceName,
  service 
)

Definition at line 464 of file icarusalg/icarusalg/gallery/helpers/python/galleryUtils.py.

465  def register(self, serviceName, service):
466  self.services[serviceName] = service
467  return service
def galleryUtils.ServiceRegistryClass.registeredServiceNames (   self)

Definition at line 384 of file sbndcode/sbndcode/gallery/python/galleryUtils.py.

385  def registeredServiceNames(self): return self.services.keys()
def galleryUtils.ServiceRegistryClass.registeredServiceNames (   self)

Definition at line 468 of file icarusalg/icarusalg/gallery/helpers/python/galleryUtils.py.

469  def registeredServiceNames(self): return self.services.keys()
def galleryUtils.ServiceRegistryClass.registry (   self)

Definition at line 386 of file sbndcode/sbndcode/gallery/python/galleryUtils.py.

387  def registry(self): return self # behave like a manager (LArSoftUtils concept)
def galleryUtils.ServiceRegistryClass.registry (   self)

Definition at line 470 of file icarusalg/icarusalg/gallery/helpers/python/galleryUtils.py.

471  def registry(self): return self # behave like a manager (LArSoftUtils concept)

Member Data Documentation

galleryUtils.ServiceRegistryClass.fullConfig

Definition at line 456 of file icarusalg/icarusalg/gallery/helpers/python/galleryUtils.py.

galleryUtils.ServiceRegistryClass.services

Definition at line 457 of file icarusalg/icarusalg/gallery/helpers/python/galleryUtils.py.


The documentation for this class was generated from the following files: