| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Static Public Attributes | Static Private Attributes | List of all members
GaudiKernel.ConfigurableMeta.ConfigurableMeta Class Reference
Inheritance diagram for GaudiKernel.ConfigurableMeta.ConfigurableMeta:
[legend]
Collaboration diagram for GaudiKernel.ConfigurableMeta.ConfigurableMeta:
[legend]

## Public Member Functions
def | __new__ (self, name, bases, dct)
def | __call__ (cls, *args, **kwargs)

## Static Public Attributes
def | newclass = type.__new__(self, name, bases, dct)
| configurables
dictionary | properties = {}
| slots = dct.get('__slots__')
list | props = [x for x in slots if x[0] != '_']
| propDict = dct.get('_propertyDocDct')
| docString = propDict and propDict.get(prop)
| default = slots[prop]
| proxy
| bprops = base._properties.copy()
| properties = bprops

## Static Private Attributes
| _properties

## Detailed Description

    The setting of Gaudi component properties needs to be deferred and
       history of who set what where needs to be collected. This is done
       by using PropertyProxy descriptors rather than the default ones.

Definition at line 15 of file ConfigurableMeta.py.

## Member Function Documentation

## ◆ __call__()

def GaudiKernel.ConfigurableMeta.ConfigurableMeta.__call__ | ( |  | cls,
|  | * | args,
|  | ** | kwargs
| ) |  |

    To Gaudi, any object with the same type/name is the same object. Hence,
       this is mimicked in the configuration: instantiating a new Configurable
       of a type with the same name will return the same instance.

Definition at line 68 of file ConfigurableMeta.py.

68 def __call__(cls, *args, **kwargs):
69 """To Gaudi, any object with the same type/name is the same object. Hence,
70 this is mimicked in the configuration: instantiating a new Configurable
71 of a type with the same name will return the same instance."""
72
73 # Get the instance: `singleton' logic needs to be in __new__, not here,
74 # for compatibililty with pickling.)
75 cfg = cls.__new__(cls, *args, **kwargs)
76
77 # Initialize the object, if not done already.
78 if not hasattr(cfg, '_initok') or not cfg._initok:
79 cls.__init__(cfg, *args, **kwargs)
80
81 return cfg

## ◆ __new__()

def GaudiKernel.ConfigurableMeta.ConfigurableMeta.__new__ | ( |  | self,
|  |  | name,
|  |  | bases,
|  |  | dct
| ) |  |

Definition at line 20 of file ConfigurableMeta.py.

20 def __new__(self, name, bases, dct):
21 # enfore use of classmethod for getType() and setDefaults()
22 if 'getType' in dct and not isinstance(dct['getType'], classmethod):
23 dct['getType'] = classmethod(dct['getType'])
24
25 if 'setDefaults' in dct and not isinstance(dct['setDefaults'],
26 classmethod):
27 dct['setDefaults'] = classmethod(dct['setDefaults'])
28

## Member Data Documentation

## ◆ _properties

GaudiKernel.ConfigurableMeta.ConfigurableMeta._properties
| static private

Definition at line 64 of file ConfigurableMeta.py.

## ◆ bprops

GaudiKernel.ConfigurableMeta.ConfigurableMeta.bprops = base._properties.copy()
| static

Definition at line 58 of file ConfigurableMeta.py.

## ◆ configurables

GaudiKernel.ConfigurableMeta.ConfigurableMeta.configurables
| static

Definition at line 35 of file ConfigurableMeta.py.

## ◆ default

GaudiKernel.ConfigurableMeta.ConfigurableMeta.default = slots[prop]
| static

Definition at line 46 of file ConfigurableMeta.py.

## ◆ docString

GaudiKernel.ConfigurableMeta.ConfigurableMeta.docString = propDict and propDict.get(prop)
| static

Definition at line 44 of file ConfigurableMeta.py.

## ◆ newclass

def GaudiKernel.ConfigurableMeta.ConfigurableMeta.newclass = type.__new__(self, name, bases, dct)
| static

Definition at line 32 of file ConfigurableMeta.py.

## ◆ propDict

GaudiKernel.ConfigurableMeta.ConfigurableMeta.propDict = dct.get('_propertyDocDct')
| static

Definition at line 42 of file ConfigurableMeta.py.

## ◆ properties [1/2]

dictionary GaudiKernel.ConfigurableMeta.ConfigurableMeta.properties = {}
| static

Definition at line 38 of file ConfigurableMeta.py.

## ◆ properties [2/2]

GaudiKernel.ConfigurableMeta.ConfigurableMeta.properties = bprops
| static

Definition at line 60 of file ConfigurableMeta.py.

## ◆ props

list GaudiKernel.ConfigurableMeta.ConfigurableMeta.props = [x for x in slots if x[0] != '_']
| static

Definition at line 41 of file ConfigurableMeta.py.

## ◆ proxy

GaudiKernel.ConfigurableMeta.ConfigurableMeta.proxy
| static

Initial value:
= PropertyProxy.PropertyProxyFactory(
getattr(newclass, prop), docString, default)

Definition at line 49 of file ConfigurableMeta.py.

## ◆ slots

GaudiKernel.ConfigurableMeta.ConfigurableMeta.slots = dct.get('__slots__')
| static

Definition at line 39 of file ConfigurableMeta.py.

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

- GaudiKernel/python/GaudiKernel/ConfigurableMeta.py