The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
GaudiConfig2.semantics._ListHelper Class Reference
Inheritance diagram for GaudiConfig2.semantics._ListHelper:
Collaboration diagram for GaudiConfig2.semantics._ListHelper:

Public Member Functions

 __init__ (self, semantics)
 data (self)
 __len__ (self)
 __getitem__ (self, key)
 __setitem__ (self, key, value)
 __delitem__ (self, key)
 __eq__ (self, other)
 insert (self, key, value)
 append (self, value)
 extend (self, iterable)
 opt_value (self)
 __repr__ (self)

Public Attributes

 value_semantics = semantics
 default = None
bool is_dirty = False
 data

Protected Attributes

list _data = []

Detailed Description

Definition at line 462 of file semantics.py.

Constructor & Destructor Documentation

◆ __init__()

GaudiConfig2.semantics._ListHelper.__init__ ( self,
semantics )

Definition at line 463 of file semantics.py.

463 def __init__(self, semantics):
464 self.value_semantics = semantics
465 self.default = None
466 self._data = []
467 self.is_dirty = False
468

Member Function Documentation

◆ __delitem__()

GaudiConfig2.semantics._ListHelper.__delitem__ ( self,
key )

Definition at line 483 of file semantics.py.

483 def __delitem__(self, key):
484 if not self.is_dirty:
485 raise RuntimeError("cannot remove elements from the default value")
486 self.data.__delitem__(key)
487

◆ __eq__()

GaudiConfig2.semantics._ListHelper.__eq__ ( self,
other )

Definition at line 488 of file semantics.py.

488 def __eq__(self, other):
489 return self.data == other
490

◆ __getitem__()

GaudiConfig2.semantics._ListHelper.__getitem__ ( self,
key )

Definition at line 476 of file semantics.py.

476 def __getitem__(self, key):
477 return self.value_semantics.load(self.data.__getitem__(key))
478

◆ __len__()

GaudiConfig2.semantics._ListHelper.__len__ ( self)

Definition at line 473 of file semantics.py.

473 def __len__(self):
474 return len(self.data)
475

◆ __repr__()

GaudiConfig2.semantics._ListHelper.__repr__ ( self)

Definition at line 506 of file semantics.py.

506 def __repr__(self):
507 return repr(self.data)
508
509

◆ __setitem__()

GaudiConfig2.semantics._ListHelper.__setitem__ ( self,
key,
value )

Definition at line 479 of file semantics.py.

479 def __setitem__(self, key, value):
480 self.is_dirty = True
481 self.data.__setitem__(key, self.value_semantics.store(value))
482

◆ append()

GaudiConfig2.semantics._ListHelper.append ( self,
value )

Definition at line 495 of file semantics.py.

495 def append(self, value):
496 self.is_dirty = True
497 self.data.append(self.value_semantics.store(value))
498

◆ data()

GaudiConfig2.semantics._ListHelper.data ( self)

Definition at line 470 of file semantics.py.

470 def data(self):
471 return self._data if self.is_dirty else self.default
472

◆ extend()

GaudiConfig2.semantics._ListHelper.extend ( self,
iterable )

Definition at line 499 of file semantics.py.

499 def extend(self, iterable):
500 self.is_dirty = True
501 self.data.extend(self.value_semantics.store(value) for value in iterable)
502

◆ insert()

GaudiConfig2.semantics._ListHelper.insert ( self,
key,
value )

Definition at line 491 of file semantics.py.

491 def insert(self, key, value):
492 self.is_dirty = True
493 self.data.insert(key, self.value_semantics.store(value))
494

◆ opt_value()

GaudiConfig2.semantics._ListHelper.opt_value ( self)

Definition at line 503 of file semantics.py.

503 def opt_value(self):
504 return [self.value_semantics.opt_value(item) for item in self.data]
505

Member Data Documentation

◆ _data

list GaudiConfig2.semantics._ListHelper._data = []
protected

Definition at line 466 of file semantics.py.

◆ data

GaudiConfig2.semantics._ListHelper.data

Definition at line 474 of file semantics.py.

◆ default

GaudiConfig2.semantics._ListHelper.default = None

Definition at line 465 of file semantics.py.

◆ is_dirty

bool GaudiConfig2.semantics._ListHelper.is_dirty = False

Definition at line 467 of file semantics.py.

◆ value_semantics

GaudiConfig2.semantics._ListHelper.value_semantics = semantics

Definition at line 464 of file semantics.py.


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