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

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 50 of file AtlasSemantics.py.

50  def __init__(self, cpp_type):
51  super().__init__(cpp_type)
52  # Deduce actual handle type
53  self._type = next(GaudiConfig2.semantics.extract_template_args(cpp_type))
54  self._isCond = 'CondHandle' in cpp_type
55 
56  if cpp_type.startswith("SG::Read"):
57  self._mode = "R"
58  elif cpp_type.startswith("SG::Write"):
59  self._mode = "W"
60  else:
61  raise TypeError(f"C++ type {cpp_type} not supported")
62 

Member Function Documentation

◆ store()

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

Definition at line 63 of file AtlasSemantics.py.

63  def store(self, value):
64  if isinstance(value, DataHandle):
65  v = value.Path
66  elif isinstance(value, str):
67  v = value
68  else:
69  raise TypeError(f"cannot assign {value!r} ({type(value)}) to {self.name}"
70  ", expected string or DataHandle")
71  return DataHandle(v, self._mode, self._type, self._isCond)
72 
73 

Member Data Documentation

◆ __handled_types__

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

Definition at line 48 of file AtlasSemantics.py.

◆ _isCond

python.AtlasSemantics.VarHandleKeySemantics._isCond
private

Definition at line 54 of file AtlasSemantics.py.

◆ _mode

python.AtlasSemantics.VarHandleKeySemantics._mode
private

Definition at line 57 of file AtlasSemantics.py.

◆ _type

python.AtlasSemantics.VarHandleKeySemantics._type
private

Definition at line 53 of file AtlasSemantics.py.


The documentation for this class was generated from the following file:
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:69
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:42
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18