The Gaudi Framework  master (adcf1ca6)
Loading...
Searching...
No Matches
GaudiConfig2.semantics.DataHandleSemantics Class Reference
Inheritance diagram for GaudiConfig2.semantics.DataHandleSemantics:
Collaboration diagram for GaudiConfig2.semantics.DataHandleSemantics:

Public Member Functions

 __init__ (self, cpp_type)
 
 store (self, value)
 
- Public Member Functions inherited from GaudiConfig2.semantics.PropertySemantics
 __init__ (self, cpp_type)
 
 name (self)
 
 name (self, value)
 
 cpp_type (self)
 
 cpp_type (self, value)
 
 load (self, value)
 
 is_set (self, value)
 
 opt_value (self, value)
 
 merge (self, a, b)
 

Protected Attributes

 _type = next(extract_template_args(cpp_type))
 
bool _isCond = False
 
str _mode = "R"
 
- Protected Attributes inherited from GaudiConfig2.semantics.PropertySemantics
 _name = None
 
 _cpp_type = value
 

Static Private Attributes

tuple __handled_types__ = (re.compile(r"DataObject(Read|Write)Handle<.*>$"),)
 

Additional Inherited Members

- Public Attributes inherited from GaudiConfig2.semantics.PropertySemantics
 cpp_type = cpp_type
 

Detailed Description

Semantics for data handles.

Definition at line 352 of file semantics.py.

Constructor & Destructor Documentation

◆ __init__()

GaudiConfig2.semantics.DataHandleSemantics.__init__ ( self,
cpp_type )

Definition at line 359 of file semantics.py.

359 def __init__(self, cpp_type):
360 super().__init__(cpp_type)
361 self._type = next(extract_template_args(cpp_type))
362 self._isCond = False # no specific conditions handle in Gaudi yet
363
364 if cpp_type.startswith("DataObjectReadHandle"):
365 self._mode = "R"
366 elif cpp_type.startswith("DataObjectWriteHandle"):
367 self._mode = "W"
368 else:
369 raise TypeError(f"C++ type {cpp_type} not supported")
370

Member Function Documentation

◆ store()

GaudiConfig2.semantics.DataHandleSemantics.store ( self,
value )
Validation/transformation of the data to be stored.

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 371 of file semantics.py.

371 def store(self, value):
372 if isinstance(value, DataHandle):
373 v = value.Path
374 elif isinstance(value, str):
375 v = value
376 else:
377 raise TypeError(
378 f"cannot assign {value!r} ({type(value)}) to {self.name}"
379 ", expected string or DataHandle"
380 )
381 return DataHandle(v, self._mode, self._type, self._isCond)
382
383

Member Data Documentation

◆ __handled_types__

tuple GaudiConfig2.semantics.DataHandleSemantics.__handled_types__ = (re.compile(r"DataObject(Read|Write)Handle<.*>$"),)
staticprivate

Definition at line 357 of file semantics.py.

◆ _isCond

GaudiConfig2.semantics.DataHandleSemantics._isCond = False
protected

Definition at line 362 of file semantics.py.

◆ _mode

GaudiConfig2.semantics.DataHandleSemantics._mode = "R"
protected

Definition at line 365 of file semantics.py.

◆ _type

GaudiConfig2.semantics.DataHandleSemantics._type = next(extract_template_args(cpp_type))
protected

Definition at line 361 of file semantics.py.


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