The Gaudi Framework  v40r0 (475e45c1)
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 526 of file semantics.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 531 of file semantics.py.

531  def __init__(self, cpp_type, valueSem=None):
532  super(SetSemantics, self).__init__(cpp_type)
533  self.value_semantics = valueSem or getSemanticsFor(
534  list(extract_template_args(cpp_type))[0]
535  )
536 

Member Function Documentation

◆ default()

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

Definition at line 557 of file semantics.py.

557  def default(self, value):
558  new_value = _SetHelper(self.value_semantics)
559  new_value.default = value
560  return new_value
561 

◆ 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 570 of file semantics.py.

570  def merge(self, bb, aa):
571  aa |= bb
572  return aa
573 
574 

◆ name() [1/2]

def GaudiConfig2.semantics.SetSemantics.name (   self)

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 538 of file semantics.py.

538  def name(self):
539  return self._name
540 

◆ name() [2/2]

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

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 542 of file semantics.py.

542  def name(self, value):
543  self._name = value
544  self.value_semantics.name = "{} element".format(self._name)
545 

◆ opt_value()

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

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 562 of file semantics.py.

562  def opt_value(self, value):
563  """
564  Option string version of value.
565  """
566  if not isinstance(value, _SetHelper):
567  value = self.default(value)
568  return value.opt_value()
569 

◆ store()

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

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 546 of file semantics.py.

546  def store(self, value):
547  # We support assignment from list for backwards compatibility
548  if not isinstance(value, (set, _SetHelper, list, _ListHelper)):
549  raise TypeError(
550  "set expected, got {!r} in assignment to {}".format(value, self.name)
551  )
552 
553  new_value = _SetHelper(self.value_semantics)
554  new_value |= value
555  return new_value
556 

Member Data Documentation

◆ __handled_types__

GaudiConfig2.semantics.SetSemantics.__handled_types__
staticprivate

Definition at line 529 of file semantics.py.

◆ _name

GaudiConfig2.semantics.SetSemantics._name
private

Definition at line 543 of file semantics.py.

◆ value_semantics

GaudiConfig2.semantics.SetSemantics.value_semantics

Definition at line 533 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:719
GaudiConfig2.semantics.extract_template_args
def extract_template_args(cpp_type)
Definition: semantics.py:351
gaudirun.default
default
Definition: gaudirun.py:188
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:99
merge
int merge(const char *target, const char *source, bool fixup=false, bool dbg=true)
Definition: merge.C:420
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77