The Gaudi Framework  master (1a7a3838)
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 411 of file semantics.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 418 of file semantics.py.

418 def __init__(self, cpp_type):
419 super().__init__(cpp_type)
420 self._type = next(extract_template_args(cpp_type))
421 self._isCond = False # no specific conditions handle in Gaudi yet
422
423 if cpp_type.startswith("DataObjectReadHandle"):
424 self._mode = "R"
425 elif cpp_type.startswith("DataObjectWriteHandle"):
426 self._mode = "W"
427 else:
428 raise TypeError(f"C++ type {cpp_type} not supported")
429

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 442 of file semantics.py.

442 def opt_value(self, value):
443 return value.Path
444
445

◆ store()

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

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 430 of file semantics.py.

430 def store(self, value):
431 if isinstance(value, DataHandle):
432 v = value.Path
433 elif isinstance(value, str):
434 v = value
435 else:
436 raise TypeError(
437 f"cannot assign {value!r} ({type(value)}) to {self.name}"
438 ", expected string or DataHandle"
439 )
440 return DataHandle(v, self._mode, self._type, self._isCond)
441

Member Data Documentation

◆ __handled_types__

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

Definition at line 416 of file semantics.py.

◆ _isCond

GaudiConfig2.semantics.DataHandleSemantics._isCond = False
protected

Definition at line 421 of file semantics.py.

◆ _mode

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

Definition at line 424 of file semantics.py.

◆ _type

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

Definition at line 420 of file semantics.py.


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