The Gaudi Framework  master (adcf1ca6)
Loading...
Searching...
No Matches
GaudiConfig2.semantics.SequenceSemantics Class Reference
Inheritance diagram for GaudiConfig2.semantics.SequenceSemantics:
Collaboration diagram for GaudiConfig2.semantics.SequenceSemantics:

Public Member Functions

 __init__ (self, cpp_type, valueSem=None)
 
 name (self)
 
 name (self, value)
 
 store (self, value)
 
 default (self, value)
 
 opt_value (self, value)
 
- Public Member Functions inherited from GaudiConfig2.semantics.PropertySemantics
 __init__ (self, cpp_type)
 
 cpp_type (self)
 
 cpp_type (self, value)
 
 load (self, value)
 
 is_set (self, value)
 
 merge (self, a, b)
 

Public Attributes

 value_semantics
 
- Public Attributes inherited from GaudiConfig2.semantics.PropertySemantics
 cpp_type = cpp_type
 

Static Private Attributes

tuple __handled_types__ = (re.compile(r"(std::)?(vector|list)<.*>$"),)
 

Additional Inherited Members

- Protected Attributes inherited from GaudiConfig2.semantics.PropertySemantics
 _name = None
 
 _cpp_type = value
 

Detailed Description

Definition at line 460 of file semantics.py.

Constructor & Destructor Documentation

◆ __init__()

GaudiConfig2.semantics.SequenceSemantics.__init__ ( self,
cpp_type,
valueSem = None )

Definition at line 463 of file semantics.py.

463 def __init__(self, cpp_type, valueSem=None):
464 super(SequenceSemantics, self).__init__(cpp_type)
465 self.value_semantics = valueSem or getSemanticsFor(
466 list(extract_template_args(cpp_type))[0]
467 )
468

Member Function Documentation

◆ default()

GaudiConfig2.semantics.SequenceSemantics.default ( self,
value )

Definition at line 489 of file semantics.py.

489 def default(self, value):
490 new_value = _ListHelper(self.value_semantics)
491 new_value.default = value
492 return new_value
493

◆ name() [1/2]

GaudiConfig2.semantics.SequenceSemantics.name ( self)

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 470 of file semantics.py.

470 def name(self):
471 return self._name
472

◆ name() [2/2]

GaudiConfig2.semantics.SequenceSemantics.name ( self,
value )

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 474 of file semantics.py.

474 def name(self, value):
475 self._name = value
476 self.value_semantics.name = "{} element".format(self._name)
477
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition MsgStream.cpp:93

◆ opt_value()

GaudiConfig2.semantics.SequenceSemantics.opt_value ( self,
value )
Option string version of value.

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 494 of file semantics.py.

494 def opt_value(self, value):
495 """
496 Option string version of value.
497 """
498 if not isinstance(value, _ListHelper):
499 value = self.default(value)
500 return value.opt_value()
501
502

◆ store()

GaudiConfig2.semantics.SequenceSemantics.store ( self,
value )
Validation/transformation of the data to be stored.

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 478 of file semantics.py.

478 def store(self, value):
479 if not isinstance(value, (list, _ListHelper, tuple)):
480 raise TypeError(
481 "list or tuple expected, got {!r} in assignment to {}".format(
482 value, self.name
483 )
484 )
485 new_value = _ListHelper(self.value_semantics)
486 new_value.extend(value)
487 return new_value
488

Member Data Documentation

◆ __handled_types__

tuple GaudiConfig2.semantics.SequenceSemantics.__handled_types__ = (re.compile(r"(std::)?(vector|list)<.*>$"),)
staticprivate

Definition at line 461 of file semantics.py.

◆ value_semantics

GaudiConfig2.semantics.SequenceSemantics.value_semantics
Initial value:
= valueSem or getSemanticsFor(
list(extract_template_args(cpp_type))[0]
)

Definition at line 465 of file semantics.py.


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