ATLAS Offline Software
Loading...
Searching...
No Matches
python.Configurables._PyCompHandle Class Reference
Inheritance diagram for python.Configurables._PyCompHandle:
Collaboration diagram for python.Configurables._PyCompHandle:

Public Types

typedef HLT::TypeInformation::for_each_type_c< typenameEDMLIST::map, my_functor, my_result<>, my_arg< HLT::TypeInformation::get_cont, CONTAINER > >::type result

Public Member Functions

 __init__ (self, parent, attr_name)
 __getattribute__ (self, n)
 __setattr__ (self, n, v)

Protected Member Functions

 _init_once (self, obj)

Detailed Description

a class to mimic the gaudi C++ {Tool,Svc}Handle classes: automatic call
to `initialize` when __getattr__ is called on the instance.

Definition at line 209 of file Configurables.py.

Member Typedef Documentation

◆ result

Definition at line 90 of file EDM_MasterSearch.h.

Constructor & Destructor Documentation

◆ __init__()

python.Configurables._PyCompHandle.__init__ ( self,
parent,
attr_name )

Definition at line 213 of file Configurables.py.

213 def __init__(self, parent, attr_name):
214 msg = parent.msg.verbose
215 try:
216 parentName=parent.name()
217 except TypeError:
218 parentName=parent.name
219 msg('installing py-comp-handle for [%s.%s]...',
220 parentName, attr_name)
221 self.__dict__.update({
222 '_parent': parent,
223 '_name': attr_name,
224 '_attr': getattr(parent, attr_name),
225 '_init_called': False,
226 })
227 msg('installing py-comp-handle for [%s.%s]... [done]',
228 parentName, attr_name)
229 return
230
MsgStream & msg
Definition testRead.cxx:32

Member Function Documentation

◆ __getattribute__()

python.Configurables._PyCompHandle.__getattribute__ ( self,
n )

Definition at line 241 of file Configurables.py.

241 def __getattribute__(self, n):
242 if n.startswith('_'):
243 return super().__getattribute__(n)
244 obj = self.__dict__['_attr']
245 self._init_once(obj)
246 return getattr(obj, n)
247

◆ __setattr__()

python.Configurables._PyCompHandle.__setattr__ ( self,
n,
v )

Definition at line 248 of file Configurables.py.

248 def __setattr__(self, n, v):
249 if n.startswith('_'):
250 return super().__setattr__(n,v)
251 obj = self.__dict__['_attr']
252 self._init_once(obj)
253 return setattr(obj, n, v)
254
255

◆ _init_once()

python.Configurables._PyCompHandle._init_once ( self,
obj )
protected

Definition at line 231 of file Configurables.py.

231 def _init_once(self, obj):
232 if self.__dict__['_init_called']:
233 return
234 parent = self.__dict__['_parent']
235 # FIXME: should we raise something in case initialize failed ?
236 obj.initialize()
237 self.__dict__['_init_called'] = True
238 # replace the handle with the proxied object
239 setattr(parent, self.__dict__['_name'], obj)
240

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