The Gaudi Framework  master (adcf1ca6)
Loading...
Searching...
No Matches
GaudiConfig2.semantics.IntSemantics Class Reference
Inheritance diagram for GaudiConfig2.semantics.IntSemantics:
Collaboration diagram for GaudiConfig2.semantics.IntSemantics:

Public Member Functions

 store (self, value)
 
- Public Member Functions inherited from GaudiConfig2.semantics.PropertySemantics
 __init__ (self, cpp_type)
 
 name (self)
 
 name (self, value)
 
 cpp_type (self)
 
 cpp_type (self, value)
 
 load (self, value)
 
 is_set (self, value)
 
 opt_value (self, value)
 
 merge (self, a, b)
 

Static Public Attributes

dict INT_RANGES
 

Static Private Attributes

 __handled_types__ = tuple(INT_RANGES)
 

Additional Inherited Members

- Public Attributes inherited from GaudiConfig2.semantics.PropertySemantics
 cpp_type = cpp_type
 
- Protected Attributes inherited from GaudiConfig2.semantics.PropertySemantics
 _name = None
 
 _cpp_type = value
 

Detailed Description

Definition at line 162 of file semantics.py.

Member Function Documentation

◆ store()

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

Reimplemented from GaudiConfig2.semantics.PropertySemantics.

Definition at line 183 of file semantics.py.

183 def store(self, value):
184 from numbers import Number
185
186 if not isinstance(value, Number):
187 raise TypeError(
188 "number expected, got {!r} in assignment to {}".format(value, self.name)
189 )
190 v = int(value)
191 if v != value:
192 _log.warning("converted %s to %d in assignment to %s", value, v, self.name)
193 min_value, max_value = self.INT_RANGES[self.cpp_type]
194 if v < min_value or v > max_value:
195 raise ValueError(
196 "value {} outside limits for {!r} {}".format(
197 v, self.cpp_type, self.INT_RANGES[self.cpp_type]
198 )
199 )
200 return v
201
202
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition MsgStream.cpp:93

Member Data Documentation

◆ __handled_types__

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

Definition at line 181 of file semantics.py.

◆ INT_RANGES

dict 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 164 of file semantics.py.


The documentation for this class was generated from the following file: