The Gaudi Framework  v36r1 (3e2fb5a8)
GaudiConfig2._configurables.Property Class Reference
Inheritance diagram for GaudiConfig2._configurables.Property:
Collaboration diagram for GaudiConfig2._configurables.Property:

Public Member Functions

def __init__ (self, cpp_type, default, doc='undocumented', semantics=None)
 
def cpp_type (self)
 
def name (self)
 
def __get__ (self, instance, owner)
 
def __set__ (self, instance, value)
 
def __delete__ (self, instance)
 
def __set_name__ (self, owner, name)
 
def __is_set__ (self, instance, owner)
 
def __opt_value__ (self, instance, owner)
 
def __merge__ (self, instance, owner, value)
 

Public Attributes

 semantics
 
 default
 

Private Attributes

 __doc__
 

Detailed Description

Descriptor class to implement validation of Configurable properties.

Definition at line 34 of file _configurables.py.

Constructor & Destructor Documentation

◆ __init__()

def GaudiConfig2._configurables.Property.__init__ (   self,
  cpp_type,
  default,
  doc = 'undocumented',
  semantics = None 
)

Definition at line 39 of file _configurables.py.

39  def __init__(self, cpp_type, default, doc='undocumented', semantics=None):
40  from .semantics import getSemanticsFor
41  self.semantics = getSemanticsFor(semantics or cpp_type)
42  self.default = default
43  self.__doc__ = doc
44 

Member Function Documentation

◆ __delete__()

def GaudiConfig2._configurables.Property.__delete__ (   self,
  instance 
)

Definition at line 64 of file _configurables.py.

64  def __delete__(self, instance):
65  del instance._properties[self.name]
66 

◆ __get__()

def GaudiConfig2._configurables.Property.__get__ (   self,
  instance,
  owner 
)

Definition at line 53 of file _configurables.py.

53  def __get__(self, instance, owner):
54  if (self.name not in instance._properties
55  and hasattr(self.semantics, 'default')):
56  instance._properties[self.name] = self.semantics.default(
57  self.default)
58  return self.semantics.load(
59  instance._properties.get(self.name, self.default))
60 

◆ __is_set__()

def GaudiConfig2._configurables.Property.__is_set__ (   self,
  instance,
  owner 
)

Definition at line 70 of file _configurables.py.

70  def __is_set__(self, instance, owner):
71  try:
72  value = instance._properties[self.name]
73  return self.semantics.is_set(value)
74  except KeyError:
75  return False
76 

◆ __merge__()

def GaudiConfig2._configurables.Property.__merge__ (   self,
  instance,
  owner,
  value 
)
Return "merge" (according to the semantic) of the value
in this property and the incoming value.

Definition at line 81 of file _configurables.py.

81  def __merge__(self, instance, owner, value):
82  '''
83  Return "merge" (according to the semantic) of the value
84  in this property and the incoming value.
85  '''
86  if not self.__is_set__(instance, owner):
87  return value
88  return self.semantics.merge(self.__get__(instance, owner), value)
89 
90 

◆ __opt_value__()

def GaudiConfig2._configurables.Property.__opt_value__ (   self,
  instance,
  owner 
)

Definition at line 77 of file _configurables.py.

77  def __opt_value__(self, instance, owner):
78  return self.semantics.opt_value(
79  instance._properties.get(self.name, self.default))
80 

◆ __set__()

def GaudiConfig2._configurables.Property.__set__ (   self,
  instance,
  value 
)

Definition at line 61 of file _configurables.py.

61  def __set__(self, instance, value):
62  instance._properties[self.name] = self.semantics.store(value)
63 

◆ __set_name__()

def GaudiConfig2._configurables.Property.__set_name__ (   self,
  owner,
  name 
)

Definition at line 67 of file _configurables.py.

67  def __set_name__(self, owner, name):
68  self.semantics.name = name
69 

◆ cpp_type()

def GaudiConfig2._configurables.Property.cpp_type (   self)

Definition at line 46 of file _configurables.py.

46  def cpp_type(self):
47  return self.semantics.cpp_type
48 

◆ name()

def GaudiConfig2._configurables.Property.name (   self)

Definition at line 50 of file _configurables.py.

50  def name(self):
51  return self.semantics.name
52 

Member Data Documentation

◆ __doc__

GaudiConfig2._configurables.Property.__doc__
private

Definition at line 43 of file _configurables.py.

◆ default

GaudiConfig2._configurables.Property.default

Definition at line 42 of file _configurables.py.

◆ semantics

GaudiConfig2._configurables.Property.semantics

Definition at line 41 of file _configurables.py.


The documentation for this class was generated from the following file:
GaudiConfig2.semantics.getSemanticsFor
def getSemanticsFor(cpp_type, name=None)
Definition: semantics.py:450
gaudirun.default
default
Definition: gaudirun.py:181
TimingHistograms.name
name
Definition: TimingHistograms.py:23
merge
int merge(const char *target, const char *source, bool fixup=false, bool dbg=true)
Definition: merge.C:430