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

Public Member Functions

def store (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 is_set (self, value)
 
def opt_value (self, value)
 
def merge (self, a, b)
 

Static Public Attributes

 INT_RANGES
 

Static Private Attributes

 __handled_types__
 

Additional Inherited Members

- Public Attributes inherited from GaudiConfig2.semantics.PropertySemantics
 cpp_type
 

Detailed Description

Definition at line 156 of file semantics.py.

Member Function Documentation

◆ store()

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

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 177 of file semantics.py.

177  def store(self, value):
178  from numbers import Number
179 
180  if not isinstance(value, Number):
181  raise TypeError(
182  "number expected, got {!r} in assignment to {}".format(value, self.name)
183  )
184  v = int(value)
185  if v != value:
186  _log.warning("converted %s to %d in assignment to %s", value, v, self.name)
187  min_value, max_value = self.INT_RANGES[self.cpp_type]
188  if v < min_value or v > max_value:
189  raise ValueError(
190  "value {} outside limits for {!r} {}".format(
191  v, self.cpp_type, self.INT_RANGES[self.cpp_type]
192  )
193  )
194  return v
195 
196 

Member Data Documentation

◆ __handled_types__

GaudiConfig2.semantics.IntSemantics.__handled_types__
staticprivate

Definition at line 175 of file semantics.py.

◆ INT_RANGES

GaudiConfig2.semantics.IntSemantics.INT_RANGES
static

Definition at line 158 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