The Gaudi Framework  v41r0 (bdbe7744)
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)
 opt_value (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)
 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 399 of file semantics.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 406 of file semantics.py.

406 def __init__(self, cpp_type):
407 super().__init__(cpp_type)
408 self._type = next(extract_template_args(cpp_type))
409 self._isCond = False # no specific conditions handle in Gaudi yet
410
411 if cpp_type.startswith("DataObjectReadHandle"):
412 self._mode = "R"
413 elif cpp_type.startswith("DataObjectWriteHandle"):
414 self._mode = "W"
415 else:
416 raise TypeError(f"C++ type {cpp_type} not supported")
417

Member Function Documentation

◆ opt_value()

GaudiConfig2.semantics.DataHandleSemantics.opt_value ( self,
value )
Option string version of value.

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 430 of file semantics.py.

430 def opt_value(self, value):
431 return value.Path
432
433

◆ store()

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

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 418 of file semantics.py.

418 def store(self, value):
419 if isinstance(value, DataHandle):
420 v = value.Path
421 elif isinstance(value, str):
422 v = value
423 else:
424 raise TypeError(
425 f"cannot assign {value!r} ({type(value)}) to {self.name}"
426 ", expected string or DataHandle"
427 )
428 return DataHandle(v, self._mode, self._type, self._isCond)
429

Member Data Documentation

◆ __handled_types__

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

Definition at line 404 of file semantics.py.

◆ _isCond

GaudiConfig2.semantics.DataHandleSemantics._isCond = False
protected

Definition at line 409 of file semantics.py.

◆ _mode

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

Definition at line 412 of file semantics.py.

◆ _type

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

Definition at line 408 of file semantics.py.


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