Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  master (b6adf5d0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
GaudiConfig2.semantics.PropertySemantics Class Reference
Inheritance diagram for GaudiConfig2.semantics.PropertySemantics:
Collaboration diagram for GaudiConfig2.semantics.PropertySemantics:

Public Member Functions

def __init__ (self, cpp_type)
 
def name (self)
 
def name (self, value)
 
def cpp_type (self)
 
def cpp_type (self, value)
 
def load (self, value)
 
def store (self, value)
 
def is_set (self, value)
 
def opt_value (self, value)
 
def merge (self, a, b)
 

Public Attributes

 cpp_type
 

Private Attributes

 _name
 
 _cpp_type
 

Static Private Attributes

 __handled_types__
 

Detailed Description

Basic property semantics implementation, with no validation/transformation.

Not to be used directly for any actual property, use only specializations.

Definition at line 26 of file semantics.py.

Constructor & Destructor Documentation

◆ __init__()

def GaudiConfig2.semantics.PropertySemantics.__init__ (   self,
  cpp_type 
)

Reimplemented in GaudiConfig2.semantics.MappingSemantics, GaudiConfig2.semantics.OrderedSetSemantics, GaudiConfig2.semantics.GaudiHandleArraySemantics, GaudiConfig2.semantics.ComponentHandleSemantics, and GaudiConfig2.semantics.ComponentSemantics.

Definition at line 35 of file semantics.py.

35  def __init__(self, cpp_type):
36  self._name = None
37  self.cpp_type = cpp_type
38 

Member Function Documentation

◆ cpp_type() [1/2]

def GaudiConfig2.semantics.PropertySemantics.cpp_type (   self)

Definition at line 48 of file semantics.py.

48  def cpp_type(self):
49  return self._cpp_type
50 

◆ cpp_type() [2/2]

def GaudiConfig2.semantics.PropertySemantics.cpp_type (   self,
  value 
)

Definition at line 52 of file semantics.py.

52  def cpp_type(self, value):
53  if not any(
54  h.match(value) if hasattr(h, "match") else h == value
55  for h in self.__handled_types__
56  ):
57  raise TypeError("C++ type {!r} not supported".format(value))
58  self._cpp_type = value
59 

◆ is_set()

def GaudiConfig2.semantics.PropertySemantics.is_set (   self,
  value 
)
Allow overriding the definition of "is set" if we need helper types.

Reimplemented in GaudiConfig2.semantics.DefaultSemantics.

Definition at line 72 of file semantics.py.

72  def is_set(self, value):
73  """
74  Allow overriding the definition of "is set" if we need helper types.
75  """
76  return True
77 

◆ load()

def GaudiConfig2.semantics.PropertySemantics.load (   self,
  value 
)
Transformation for data when reading the property.

Definition at line 60 of file semantics.py.

60  def load(self, value):
61  """
62  Transformation for data when reading the property.
63  """
64  return value
65 

◆ merge()

def GaudiConfig2.semantics.PropertySemantics.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 in GaudiConfig2.semantics.OrderedSetSemantics, GaudiConfig2.semantics.SetSemantics, GaudiConfig2.semantics.GaudiHandleArraySemantics, and GaudiConfig2.semantics.ComponentHandleSemantics.

Definition at line 86 of file semantics.py.

86  def merge(self, a, b):
87  """
88  "Merge" two values.
89 
90  Used when merging two Configurable instances, by default just ensure
91  the two values do not conflict, but it can be overridden in
92  derived semantics to, for example, append to the two lists.
93  """
94  if self.store(a) != self.store(b):
95  raise ValueError("cannot merge values %r and %r" % (a, b))
96  return a
97 
98 

◆ name() [1/2]

def GaudiConfig2.semantics.PropertySemantics.name (   self)

Reimplemented in GaudiConfig2.semantics.MappingSemantics, GaudiConfig2.semantics.SetSemantics, and GaudiConfig2.semantics.SequenceSemantics.

Definition at line 40 of file semantics.py.

40  def name(self):
41  return self._name
42 

◆ name() [2/2]

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

Reimplemented in GaudiConfig2.semantics.MappingSemantics, GaudiConfig2.semantics.SetSemantics, and GaudiConfig2.semantics.SequenceSemantics.

Definition at line 44 of file semantics.py.

44  def name(self, value):
45  self._name = value
46 

◆ opt_value()

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

Reimplemented in GaudiConfig2.semantics.MappingSemantics, GaudiConfig2.semantics.SetSemantics, and GaudiConfig2.semantics.SequenceSemantics.

Definition at line 78 of file semantics.py.

78  def opt_value(self, value):
79  """
80  Option string version of value.
81  """
82  if hasattr(value, "__opt_value__"):
83  return value.__opt_value__()
84  return value
85 

◆ store()

def GaudiConfig2.semantics.PropertySemantics.store (   self,
  value 
)

Member Data Documentation

◆ __handled_types__

GaudiConfig2.semantics.PropertySemantics.__handled_types__
staticprivate

Definition at line 33 of file semantics.py.

◆ _cpp_type

GaudiConfig2.semantics.PropertySemantics._cpp_type
private

Definition at line 58 of file semantics.py.

◆ _name

GaudiConfig2.semantics.PropertySemantics._name
private

Definition at line 36 of file semantics.py.

◆ cpp_type

GaudiConfig2.semantics.PropertySemantics.cpp_type

Definition at line 37 of file semantics.py.


The documentation for this class was generated from the following file:
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