The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
GaudiKernel.PropertyProxy.DataHandleVectorPropertyProxy Class Reference
Inheritance diagram for GaudiKernel.PropertyProxy.DataHandleVectorPropertyProxy:
Collaboration diagram for GaudiKernel.PropertyProxy.DataHandleVectorPropertyProxy:

Public Member Functions

 __init__ (self, descr, docString, default)
 convertValueToBeSet (self, obj, value)
Public Member Functions inherited from GaudiKernel.PropertyProxy.DataHandlePropertyProxy
 __init__ (self, descr, docString, default)
 __get__ (self, obj, type=None)
 __set__ (self, obj, value)
Public Member Functions inherited from GaudiKernel.PropertyProxy.PropertyProxy
 __init__ (self, descr, docString=None, default=None)
 setDefault (self, value)
 getDefault (self)
 fullPropertyName (self, obj)
 __get__ (self, obj, type=None)
 __set__ (self, obj, value)
 __delete__ (self, obj)

Additional Inherited Members

Public Attributes inherited from GaudiKernel.PropertyProxy.PropertyProxy
dict history = {}
 descr = descr
bool deprecated = False
Properties inherited from GaudiKernel.PropertyProxy.PropertyProxy
 default = property(getDefault, setDefault)

Detailed Description

Definition at line 457 of file PropertyProxy.py.

Constructor & Destructor Documentation

◆ __init__()

GaudiKernel.PropertyProxy.DataHandleVectorPropertyProxy.__init__ ( self,
descr,
docString,
default )

Definition at line 458 of file PropertyProxy.py.

458 def __init__(self, descr, docString, default):
459 DataHandlePropertyProxy.__init__(self, descr, docString, default)
460

Member Function Documentation

◆ convertValueToBeSet()

GaudiKernel.PropertyProxy.DataHandleVectorPropertyProxy.convertValueToBeSet ( self,
obj,
value )

Reimplemented from GaudiKernel.PropertyProxy.DataHandlePropertyProxy.

Definition at line 461 of file PropertyProxy.py.

461 def convertValueToBeSet(self, obj, value):
462 if value is None:
463 value = []
464
465 default = obj.__class__.getDefaultProperty(self.descr.__name__)
466 mode = default.mode()
467 _type = default.type()
468 if isinstance(value, DataHandleVector):
469 return DataHandleVector(value.paths(), mode, _type)
470 if isinstance(value, (list, tuple)):
471 paths = []
472 for path in value:
473 if isinstance(path, DataHandle):
474 path = str(path)
475 if not isinstance(path, str):
476 raise ValueError(
477 f"received an instance of {type(path)}, but str or DataHandle expected"
478 )
479 paths.append(path)
480 return DataHandleVector(paths, mode, _type)
481 raise ValueError(
482 "received an instance of {}, but {} expected".format(
483 type(value), "list, tuple or DataHandleVector"
484 )
485 )
486
487
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition MsgStream.cpp:93

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