45 """Semantics for an item (DataHandle) in a VarHandleKeyArray converting to string"""
51 if isinstance(value, DataHandle):
53 elif isinstance(value, str):
56 raise TypeError(f
"cannot assign {value!r} ({type(value)}) to {self.name}"
57 ", expected string or DataHandle")
65 handle_type = next(GaudiConfig2.semantics.extract_template_args(cpp_type))
66 self.
_type = next(GaudiConfig2.semantics.extract_template_args(handle_type))
67 self.
_isCond =
'CondHandle' in handle_type
69 if handle_type.startswith(
"SG::ReadHandle"):
71 elif handle_type.startswith(
"SG::WriteHandle"):
74 raise TypeError(f
"C++ type {cpp_type} not supported")
83from AthenaServices.ItemListSemantics
import OutputStreamItemListSemantics
85GaudiConfig2.semantics.SEMANTICS.append(VarHandleKeySemantics)
86GaudiConfig2.semantics.SEMANTICS.append(VarHandleArraySematics)
87GaudiConfig2.semantics.SEMANTICS.append(OutputStreamItemListSemantics)