|
Gaudi Framework, version v23r2p1 |
| Home | Generated: Fri Jun 29 2012 |

Public Member Functions | |
| def | __init__ |
| def | __repr__ |
| def | __str__ |
| def | __getitem__ |
| def | __delitem__ |
| def | __iadd__ |
| def | append |
| def | isPublic |
| def | toStringProperty |
| def | __getstate__ |
| def | __setstate__ |
Public Attributes | |
| typesAndNames | |
Static Public Attributes | |
| handleType = None | |
Static Private Attributes | |
| tuple | __slots__ = ( 'typesAndNames' ) |
A list of GaudiHandles. Only handles of one type are allowed, as specified by self.__class__.handleType
Definition at line 100 of file GaudiHandles.py.
| def GaudiHandles::GaudiHandleArray::__init__ | ( | self, | |
typesAndNames = None |
|||
| ) |
Reimplemented in GaudiHandles::ServiceHandleArray, GaudiHandles::PublicToolHandleArray, and GaudiHandles::PrivateToolHandleArray.
Definition at line 106 of file GaudiHandles.py.
00107 : 00108 if typesAndNames is None: typesAndNames = [] 00109 list.__init__(self) 00110 # check the type 00111 if type(typesAndNames) != list: 00112 raise TypeError("Argument to %s must be a list. Got a %s instead" % \ 00113 ( self.__class__.__name__, type(typesAndNames).__name__) ) 00114 # add entries to list 00115 for tn in typesAndNames: self.append( tn )
| def GaudiHandles::GaudiHandleArray::__delitem__ | ( | self, | |
| key | |||
| ) |
Definition at line 141 of file GaudiHandles.py.
| def GaudiHandles::GaudiHandleArray::__getitem__ | ( | self, | |
| index | |||
| ) |
Definition at line 130 of file GaudiHandles.py.
00131 : 00132 if type(index) == str: 00133 # seach by instance name 00134 for h in self: 00135 if h.getName() == index: 00136 return h 00137 raise IndexError( "%s does not have a %s with instance name %s" % \ 00138 (self.__class__.__name__, self.handleType.componentType, index) ) 00139 else: 00140 return list.__getitem__(self,index)
| def GaudiHandles::GaudiHandleArray::__getstate__ | ( | self ) |
Definition at line 202 of file GaudiHandles.py.
| def GaudiHandles::GaudiHandleArray::__iadd__ | ( | self, | |
| array | |||
| ) |
Definition at line 144 of file GaudiHandles.py.
| def GaudiHandles::GaudiHandleArray::__repr__ | ( | self ) |
Return class name with list of type/name strings as argument
Definition at line 116 of file GaudiHandles.py.
| def GaudiHandles::GaudiHandleArray::__setstate__ | ( | self, | |
| dict | |||
| ) |
Definition at line 205 of file GaudiHandles.py.
| def GaudiHandles::GaudiHandleArray::__str__ | ( | self ) |
Print entries, one per line
Definition at line 125 of file GaudiHandles.py.
| def GaudiHandles::GaudiHandleArray::append | ( | self, | |
| value | |||
| ) |
Only allow appending compatible types. It accepts a string, a handle or a configurable.
Definition at line 154 of file GaudiHandles.py.
00155 : 00156 """Only allow appending compatible types. It accepts a string, a handle or a configurable.""" 00157 if type(value) == str: 00158 # convert string to handle 00159 value = self.__class__.handleType(value) 00160 elif type(value) == self.__class__.handleType: 00161 pass # leave handle as-is 00162 elif isinstance( value, GaudiHandle ): 00163 # do not allow different type of handles 00164 raise TypeError( "Can not add a %s to a %s" % (value.__class__.__name__, self.__class__.__name__) ) 00165 elif value.getGaudiType() != self.__class__.handleType.componentType: 00166 # assume it is a configurable: allow only correct types 00167 raise TypeError( "Can not append %s (%s) to a %s" % \ 00168 (value.__class__.__name__, value.getGaudiType(), self.__class__.__name__) ) 00169 elif hasattr(value,'isPublic'): 00170 # check public vs private if applicable for this configurable 00171 pop = value.isPublic() and 'Public' or 'Private' 00172 if value.isPublic() != self.__class__.handleType.isPublic: 00173 raise TypeError( "Can not append %s (%s %s) to a %s" % \ 00174 (value.__class__.__name__, pop, value.getGaudiType(), self.__class__.__name__) ) 00175 00176 # check that an instance name appears only once in the list 00177 try: 00178 oldValue = self.__getitem__( value.getName() ) 00179 except IndexError: 00180 # not yet there, so add it 00181 list.append( self, value ) 00182 else: 00183 print "%s WARNING %r with instance name %r already in list. Not adding %r" % \ 00184 (self.__class__.__name__, oldValue, oldValue.getName(), value) 00185
| def GaudiHandles::GaudiHandleArray::isPublic | ( | self ) |
Definition at line 186 of file GaudiHandles.py.
| def GaudiHandles::GaudiHandleArray::toStringProperty | ( | self ) |
Definition at line 192 of file GaudiHandles.py.
tuple GaudiHandles::GaudiHandleArray::__slots__ = ( 'typesAndNames' ) [static, private] |
Reimplemented in GaudiHandles::ServiceHandleArray, GaudiHandles::PublicToolHandleArray, and GaudiHandles::PrivateToolHandleArray.
Definition at line 103 of file GaudiHandles.py.
GaudiHandles::GaudiHandleArray::handleType = None [static] |
Reimplemented in GaudiHandles::ServiceHandleArray, GaudiHandles::PublicToolHandleArray, and GaudiHandles::PrivateToolHandleArray.
Definition at line 104 of file GaudiHandles.py.
Definition at line 205 of file GaudiHandles.py.