The Gaudi Framework  master (37c0b60a)
GaudiConfig2.semantics.SetSemantics Class Reference
Inheritance diagram for GaudiConfig2.semantics.SetSemantics:
Collaboration diagram for GaudiConfig2.semantics.SetSemantics:

Public Member Functions

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

Public Attributes

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

Private Attributes

 _name
 

Static Private Attributes

 __handled_types__
 

Detailed Description

Merge semantics for (unordered) sets.

Definition at line 443 of file semantics.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 448 of file semantics.py.

448  def __init__(self, cpp_type, valueSem=None):
449  super(SetSemantics, self).__init__(cpp_type)
450  self.value_semantics = valueSem or getSemanticsFor(
451  list(extract_template_args(cpp_type))[0]
452  )
453 

Member Function Documentation

◆ default()

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

Definition at line 474 of file semantics.py.

474  def default(self, value):
475  new_value = _SetHelper(self.value_semantics)
476  new_value.default = value
477  return new_value
478 

◆ merge()

def 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 487 of file semantics.py.

487  def merge(self, bb, aa):
488  aa |= bb
489  return aa
490 
491 

◆ name() [1/2]

def GaudiConfig2.semantics.SetSemantics.name (   self)

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 455 of file semantics.py.

455  def name(self):
456  return self._name
457 

◆ name() [2/2]

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

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 459 of file semantics.py.

459  def name(self, value):
460  self._name = value
461  self.value_semantics.name = "{} element".format(self._name)
462 

◆ opt_value()

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

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 479 of file semantics.py.

479  def opt_value(self, value):
480  """
481  Option string version of value.
482  """
483  if not isinstance(value, _SetHelper):
484  value = self.default(value)
485  return value.opt_value()
486 

◆ store()

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

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 463 of file semantics.py.

463  def store(self, value):
464  # We support assignment from list for backwards compatibility
465  if not isinstance(value, (set, _SetHelper, list, _ListHelper)):
466  raise TypeError(
467  "set expected, got {!r} in assignment to {}".format(value, self.name)
468  )
469 
470  new_value = _SetHelper(self.value_semantics)
471  new_value |= value
472  return new_value
473 

Member Data Documentation

◆ __handled_types__

GaudiConfig2.semantics.SetSemantics.__handled_types__
staticprivate

Definition at line 446 of file semantics.py.

◆ _name

GaudiConfig2.semantics.SetSemantics._name
private

Definition at line 460 of file semantics.py.

◆ value_semantics

GaudiConfig2.semantics.SetSemantics.value_semantics

Definition at line 450 of file semantics.py.


The documentation for this class was generated from the following file:
GaudiConfig2.semantics.getSemanticsFor
def getSemanticsFor(cpp_type)
Definition: semantics.py:636
GaudiConfig2.semantics.extract_template_args
def extract_template_args(cpp_type)
Definition: semantics.py:268
gaudirun.default
default
Definition: gaudirun.py:188
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
merge
int merge(const char *target, const char *source, bool fixup=false, bool dbg=true)
Definition: merge.C:430
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77