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

Public Member Functions

 __init__ (self, cpp_type)
 store (self, value)

Protected Attributes

 _type = next(GaudiConfig2.semantics.extract_template_args(cpp_type))
str _isCond = 'CondHandle' in cpp_type
str _mode = "R"

Static Private Attributes

tuple __handled_types__ = (re.compile(r"SG::.*HandleKey<.*>$"),)

Detailed Description

Semantics for all data handle keys (Read, Write, Decor, Cond).

Definition at line 8 of file AtlasSemantics.py.

Constructor & Destructor Documentation

◆ __init__()

python.AtlasSemantics.VarHandleKeySemantics.__init__ ( self,
cpp_type )

Definition at line 14 of file AtlasSemantics.py.

14 def __init__(self, cpp_type):
15 super().__init__(cpp_type)
16 # Deduce actual handle type
17 self._type = next(GaudiConfig2.semantics.extract_template_args(cpp_type))
18 self._isCond = 'CondHandle' in cpp_type
19
20 if cpp_type.startswith("SG::Read"):
21 self._mode = "R"
22 elif cpp_type.startswith("SG::Write"):
23 self._mode = "W"
24 else:
25 raise TypeError(f"C++ type {cpp_type} not supported")
26

Member Function Documentation

◆ store()

python.AtlasSemantics.VarHandleKeySemantics.store ( self,
value )

Definition at line 27 of file AtlasSemantics.py.

27 def store(self, value):
28 if isinstance(value, DataHandle):
29 v = value.Path
30 elif isinstance(value, str):
31 v = value
32 else:
33 raise TypeError(f"cannot assign {value!r} ({type(value)}) to {self.name}"
34 ", expected string or DataHandle")
35 return DataHandle(v, self._mode, self._type, self._isCond)
36
37
an iterator over instances of a given type in StoreGateSvc.
Definition DataHandle.h:43

Member Data Documentation

◆ __handled_types__

tuple python.AtlasSemantics.VarHandleKeySemantics.__handled_types__ = (re.compile(r"SG::.*HandleKey<.*>$"),)
staticprivate

Definition at line 12 of file AtlasSemantics.py.

◆ _isCond

python.AtlasSemantics.VarHandleKeySemantics._isCond = 'CondHandle' in cpp_type
protected

Definition at line 18 of file AtlasSemantics.py.

◆ _mode

python.AtlasSemantics.VarHandleKeySemantics._mode = "R"
protected

Definition at line 21 of file AtlasSemantics.py.

◆ _type

python.AtlasSemantics.VarHandleKeySemantics._type = next(GaudiConfig2.semantics.extract_template_args(cpp_type))
protected

Definition at line 17 of file AtlasSemantics.py.


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