ATLAS Offline Software
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
python.AtlasSemantics.VarHandleKeySemantics Class Reference
Inheritance diagram for python.AtlasSemantics.VarHandleKeySemantics:
Collaboration diagram for python.AtlasSemantics.VarHandleKeySemantics:

Public Member Functions

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

Private Attributes

 _type
 
 _isCond
 
 _mode
 

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 26 of file AtlasSemantics.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 32 of file AtlasSemantics.py.

32  def __init__(self, cpp_type):
33  super().__init__(cpp_type)
34  # Deduce actual handle type
35  self._type = next(GaudiConfig2.semantics.extract_template_args(cpp_type))
36  self._isCond = 'CondHandle' in cpp_type
37 
38  if cpp_type.startswith("SG::Read"):
39  self._mode = "R"
40  elif cpp_type.startswith("SG::Write"):
41  self._mode = "W"
42  else:
43  raise TypeError(f"C++ type {cpp_type} not supported")
44 

Member Function Documentation

◆ store()

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

Definition at line 45 of file AtlasSemantics.py.

45  def store(self, value):
46  if isinstance(value, DataHandle):
47  v = value.Path
48  elif isinstance(value, str):
49  v = value
50  else:
51  raise TypeError(f"cannot assign {value!r} ({type(value)}) to {self.name}"
52  ", expected string or DataHandle")
53  return DataHandle(v, self._mode, self._type, self._isCond)
54 
55 

Member Data Documentation

◆ __handled_types__

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

Definition at line 30 of file AtlasSemantics.py.

◆ _isCond

python.AtlasSemantics.VarHandleKeySemantics._isCond
private

Definition at line 36 of file AtlasSemantics.py.

◆ _mode

python.AtlasSemantics.VarHandleKeySemantics._mode
private

Definition at line 39 of file AtlasSemantics.py.

◆ _type

python.AtlasSemantics.VarHandleKeySemantics._type
private

Definition at line 35 of file AtlasSemantics.py.


The documentation for this class was generated from the following file:
SGTest::store
TestStore store
Definition: TestStore.cxx:23
fillPileUpNoiseLumi.next
next
Definition: fillPileUpNoiseLumi.py:52
DataHandle
an iterator over instances of a given type in StoreGateSvc. It d-casts and caches locally the pointed...
Definition: DataHandle.h:43
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18