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

Public Member Functions

def default (self, value)
 
def store (self, value)
 
def is_set (self, value)
 
- Public Member Functions inherited from GaudiConfig2.semantics.PropertySemantics
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 opt_value (self, value)
 
def merge (self, a, b)
 

Private Attributes

 _default
 
 _is_set
 

Static Private Attributes

 __handled_types__
 

Additional Inherited Members

- Public Attributes inherited from GaudiConfig2.semantics.PropertySemantics
 cpp_type
 

Detailed Description

Special semantics that makes a deep copy of the default value on first access
and considers a property set if its value is different from the default.

This semantics is meant to be used whenever there is no specific semantic
(with proper change detection) implemented for a type.

Definition at line 94 of file semantics.py.

Member Function Documentation

◆ default()

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

Definition at line 105 of file semantics.py.

105  def default(self, value):
106  # remember the default value we got and return a copy
107  self._default = value
108  self._is_set = False
109  return copy.deepcopy(value)
110 

◆ is_set()

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

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 116 of file semantics.py.

116  def is_set(self, value):
117  try:
118  # we assume the property was set if it was changed
119  return self._is_set or self._default != value
120  except AttributeError:
121  # either self._is_set or self._default is not defined,
122  # so the value was not explicitly set nor modified
123  # from the default
124  return False
125 
126 

◆ store()

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

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 111 of file semantics.py.

111  def store(self, value):
112  # flag that the value was explicitly set
113  self._is_set = True
114  return super(DefaultSemantics, self).store(value)
115 

Member Data Documentation

◆ __handled_types__

GaudiConfig2.semantics.DefaultSemantics.__handled_types__
staticprivate

Definition at line 103 of file semantics.py.

◆ _default

GaudiConfig2.semantics.DefaultSemantics._default
private

Definition at line 107 of file semantics.py.

◆ _is_set

GaudiConfig2.semantics.DefaultSemantics._is_set
private

Definition at line 108 of file semantics.py.


The documentation for this class was generated from the following file:
gaudirun.default
default
Definition: gaudirun.py:188