The Gaudi Framework  v36r1 (3e2fb5a8)
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, name=None)
 
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

dictionary INT_RANGES
 

Static Private Attributes

 __handled_types__ = tuple(INT_RANGES)
 

Additional Inherited Members

- Public Attributes inherited from GaudiConfig2.semantics.PropertySemantics
 name
 
 cpp_type
 

Detailed Description

Definition at line 121 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 140 of file semantics.py.

140  def store(self, value):
141  from numbers import Number
142  if not isinstance(value, Number):
143  raise TypeError(
144  'number expected, got {!r} in assignemnt to {}'.format(
145  value, self.name))
146  v = int(value)
147  if v != value:
148  _log.warning('converted %s to %d in assignment to %s', value, v,
149  self.name)
150  min_value, max_value = self.INT_RANGES[self.cpp_type]
151  if v < min_value or v > max_value:
152  raise ValueError('value {} outside limits for {!r} {}'.format(
153  v, self.cpp_type, self.INT_RANGES[self.cpp_type]))
154  return v
155 
156 

Member Data Documentation

◆ __handled_types__

GaudiConfig2.semantics.IntSemantics.__handled_types__ = tuple(INT_RANGES)
staticprivate

Definition at line 138 of file semantics.py.

◆ INT_RANGES

dictionary GaudiConfig2.semantics.IntSemantics.INT_RANGES
static
Initial value:
= {
'signed char': (-128, 127),
'short': (-32768, 32767),
'int': (-2147483648, 2147483647),
'long': ((-9223372036854775808, 9223372036854775807) if is_64bits else
(-2147483648, 2147483647)),
'long long': (-9223372036854775808, 9223372036854775807),
'unsigned char': (0, 255),
'unsigned short': (0, 65535),
'unsigned int': (0, 4294967295),
'unsigned long': (0,
18446744073709551615 if is_64bits else 4294967295),
'unsigned long long': (0, 18446744073709551615),
}

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