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

Public Member Functions

 __init__ (self, cpp_type, valueSem=None)
 
 name (self)
 
 name (self, value)
 
 store (self, value)
 
 default (self, value)
 
 opt_value (self, value)
 
 merge (self, bb, aa)
 
- 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)
 

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::)?unordered_set<.*>$"),)
 

Additional Inherited Members

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

Detailed Description

Merge semantics for (unordered) sets.

Definition at line 559 of file semantics.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 564 of file semantics.py.

564 def __init__(self, cpp_type, valueSem=None):
565 super(SetSemantics, self).__init__(cpp_type)
566 self.value_semantics = valueSem or getSemanticsFor(
567 list(extract_template_args(cpp_type))[0]
568 )
569

Member Function Documentation

◆ default()

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

Definition at line 590 of file semantics.py.

590 def default(self, value):
591 new_value = _SetHelper(self.value_semantics)
592 new_value.default = value
593 return new_value
594

◆ merge()

GaudiConfig2.semantics.SetSemantics.merge ( self,
a,
b )
"Merge" two values.

Used when merging two Configurable instances, by default just ensure
the two values do not conflict, but it can be overridden in
derived semantics to, for example, append to the two lists.

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 603 of file semantics.py.

603 def merge(self, bb, aa):
604 aa |= bb
605 return aa
606
607
int merge(const char *target, const char *source, bool fixup=false, bool dbg=true)
Definition merge.C:417

◆ name() [1/2]

GaudiConfig2.semantics.SetSemantics.name ( self)

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 571 of file semantics.py.

571 def name(self):
572 return self._name
573

◆ name() [2/2]

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

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 575 of file semantics.py.

575 def name(self, value):
576 self._name = value
577 self.value_semantics.name = "{} element".format(self._name)
578
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition MsgStream.cpp:93

◆ opt_value()

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

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 595 of file semantics.py.

595 def opt_value(self, value):
596 """
597 Option string version of value.
598 """
599 if not isinstance(value, _SetHelper):
600 value = self.default(value)
601 return value.opt_value()
602

◆ store()

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

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 579 of file semantics.py.

579 def store(self, value):
580 # We support assignment from list for backwards compatibility
581 if not isinstance(value, (set, _SetHelper, list, _ListHelper)):
582 raise TypeError(
583 "set expected, got {!r} in assignment to {}".format(value, self.name)
584 )
585
586 new_value = _SetHelper(self.value_semantics)
587 new_value |= value
588 return new_value
589

Member Data Documentation

◆ __handled_types__

tuple GaudiConfig2.semantics.SetSemantics.__handled_types__ = (re.compile(r"(std::)?unordered_set<.*>$"),)
staticprivate

Definition at line 562 of file semantics.py.

◆ value_semantics

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

Definition at line 566 of file semantics.py.


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