The Gaudi Framework  v33r2 (a6f0ec87)
GaudiPython.Bindings.iDataSvc Class Reference
Inheritance diagram for GaudiPython.Bindings.iDataSvc:
Collaboration diagram for GaudiPython.Bindings.iDataSvc:

Public Member Functions

def __init__ (self, name, idp)
 
def registerObject (self, path, obj)
 
def unregisterObject (self, path)
 
def retrieveObject (self, path)
 
def findObject (self, path)
 
def getObject (self, path, *args)
 
def __getitem__ (self, path)
 
def __setitem__ (self, path, obj)
 
def __delitem__ (self, path)
 
def leaves (self, node=None)
 
def dump (self, node=None)
 
def getList (self, node=None, lst=[], rootFID=None)
 
def getHistoNames (self, node=None, lst=[])
 
def setRoot (self, name, obj)
 
def clearStore (self)
 
- Public Member Functions inherited from GaudiPython.Bindings.iService
def retrieveInterface (self)
 
def initialize (self)
 
def start (self)
 
def stop (self)
 
def finalize (self)
 
def reinitialize (self)
 
def restart (self)
 
def isValid (self)
 
- Public Member Functions inherited from GaudiPython.Bindings.iProperty
def getInterface (self)
 
def __call_interface_method__ (self, ifname, method, *args)
 
def __setattr__ (self, name, value)
 
def __getattr__ (self, name)
 
def properties (self)
 
def name (self)
 

Detailed Description

Definition at line 543 of file Bindings.py.

Constructor & Destructor Documentation

◆ __init__()

def GaudiPython.Bindings.iDataSvc.__init__ (   self,
  name,
  idp 
)

Reimplemented from GaudiPython.Bindings.iService.

Reimplemented in GaudiPython.Bindings.iNTupleSvc, and GaudiPython.Bindings.iHistogramSvc.

Definition at line 544 of file Bindings.py.

544  def __init__(self, name, idp):
545  iService.__init__(self, name, idp)
546  self.__dict__['_idp'] = InterfaceCast(gbl.IDataProviderSvc)(idp)
547  self.__dict__['_idm'] = InterfaceCast(gbl.IDataManagerSvc)(idp)
548 

Member Function Documentation

◆ __delitem__()

def GaudiPython.Bindings.iDataSvc.__delitem__ (   self,
  path 
)

Definition at line 627 of file Bindings.py.

627  def __delitem__(self, path):
628  if not self._idp:
629  raise IndexError(
630  'C++ service %s does not exist' % self.__dict__['_name'])
631  return self.unregisterObject(path)
632 

◆ __getitem__()

def GaudiPython.Bindings.iDataSvc.__getitem__ (   self,
  path 
)

Reimplemented in GaudiPython.Bindings.iNTupleSvc, and GaudiPython.Bindings.iHistogramSvc.

Definition at line 615 of file Bindings.py.

615  def __getitem__(self, path):
616  if not self._idp:
617  raise IndexError(
618  'C++ service %s does not exist' % self.__dict__['_name'])
619  return Helper.dataobject(self._idp, path)
620 

◆ __setitem__()

def GaudiPython.Bindings.iDataSvc.__setitem__ (   self,
  path,
  obj 
)

Definition at line 621 of file Bindings.py.

621  def __setitem__(self, path, obj):
622  if not self._idp:
623  raise IndexError(
624  'C++ service %s does not exist' % self.__dict__['_name'])
625  return self.registerObject(path, obj)
626 

◆ clearStore()

def GaudiPython.Bindings.iDataSvc.clearStore (   self)

Definition at line 700 of file Bindings.py.

700  def clearStore(self):
701  if not self._idm:
702  raise IndexError(
703  'C++ service %s does not exist' % self.__dict__['_name'])
704  return self._idm.clearStore()
705 
706 
707 # ----iHistogramSvc class------------------------------------------------------

◆ dump()

def GaudiPython.Bindings.iDataSvc.dump (   self,
  node = None 
)

Definition at line 644 of file Bindings.py.

644  def dump(self, node=None):
645  if not node:
646  root = self.retrieveObject('')
647  if root:
648  node = root.registry()
649  else:
650  return
651  print(node.identifier())
652  if node.object():
653  for l in self.leaves(node):
654  self.dump(l)
655 

◆ findObject()

def GaudiPython.Bindings.iDataSvc.findObject (   self,
  path 
)
Get the existing object in TransientStore for the given location

- loading of object from persistency is NOT triggered
- 'data-on-demand' action is NOT triggered

>>> svc  =  ...                     ## get the service
>>> path =  ...                     ## get the path in Transient Store
>>> data = svc.findObject ( path )  ## use the method

Definition at line 568 of file Bindings.py.

568  def findObject(self, path):
569  """
570 
571  Get the existing object in TransientStore for the given location
572 
573  - loading of object from persistency is NOT triggered
574  - 'data-on-demand' action is NOT triggered
575 
576  >>> svc = ... ## get the service
577  >>> path = ... ## get the path in Transient Store
578  >>> data = svc.findObject ( path ) ## use the method
579 
580  """
581  if not self._idp:
582  raise IndexError(
583  'C++ service %s does not exist' % self.__dict__['_name'])
584  return Helper.findobject(self._idp, path)
585 

◆ getHistoNames()

def GaudiPython.Bindings.iDataSvc.getHistoNames (   self,
  node = None,
  lst = [] 
)

Definition at line 675 of file Bindings.py.

675  def getHistoNames(self, node=None, lst=[]):
676  if not node:
677  root = self.retrieveObject('')
678  if root:
679  node = root.registry()
680  # rootFID = node.address().par()
681  lst = []
682  else:
683  return
684  Helper.dataobject(self._idp, node.identifier())
685  if node.object():
686  lst.append(node.identifier())
687  for l in self.leaves(node):
688  if l.name(): # and l.address().par() == rootFID :
689  self.getHistoNames(l, lst)
690  else:
691  continue
692  return lst
693 

◆ getList()

def GaudiPython.Bindings.iDataSvc.getList (   self,
  node = None,
  lst = [],
  rootFID = None 
)

Definition at line 656 of file Bindings.py.

656  def getList(self, node=None, lst=[], rootFID=None):
657  if not node:
658  root = self.retrieveObject('')
659  if root:
660  node = root.registry()
661  rootFID = node.address().par()
662  lst = []
663  else:
664  return
665  Helper.dataobject(self._idp, node.identifier())
666  if node.object():
667  lst.append(node.identifier())
668  for l in self.leaves(node):
669  if l.address() and l.address().par() == rootFID:
670  self.getList(l, lst, rootFID)
671  else:
672  continue
673  return lst
674 

◆ getObject()

def GaudiPython.Bindings.iDataSvc.getObject (   self,
  path,
args 
)
Get object from Transient Store  for the given location

arguments :
- path                           : Location of object in Transient Store
- retrieve          (bool) True  : retrieve versus find
- disable on-demand (bool) False : temporary disable 'on-demand' actions

>>> svc  = ...   ## get the service
>>> path = ...   ## get the path

>>> data = svc.getObject ( path , False )  ## find object in Transient Store

## find object in Transient Store
#  load form tape or use 'on-demand' action  for missing objects :
>>> data = svc.getObject ( path , True  )

## find object in Transient Store
#  load from tape or for missing objects, disable 'on-demand'-actions
>>> data = svc.getObject ( path , True  , True )

Definition at line 587 of file Bindings.py.

587  def getObject(self, path, *args):
588  """
589  Get object from Transient Store for the given location
590 
591  arguments :
592  - path : Location of object in Transient Store
593  - retrieve (bool) True : retrieve versus find
594  - disable on-demand (bool) False : temporary disable 'on-demand' actions
595 
596  >>> svc = ... ## get the service
597  >>> path = ... ## get the path
598 
599  >>> data = svc.getObject ( path , False ) ## find object in Transient Store
600 
601  ## find object in Transient Store
602  # load form tape or use 'on-demand' action for missing objects :
603  >>> data = svc.getObject ( path , True )
604 
605  ## find object in Transient Store
606  # load from tape or for missing objects, disable 'on-demand'-actions
607  >>> data = svc.getObject ( path , True , True )
608 
609  """
610  if not self._idp:
611  raise IndexError(
612  'C++ service %s does not exist' % self.__dict__['_name'])
613  return Helper.getobject(self._idp, path, *args)
614 

◆ leaves()

def GaudiPython.Bindings.iDataSvc.leaves (   self,
  node = None 
)

Definition at line 633 of file Bindings.py.

633  def leaves(self, node=None):
634  if not node:
635  node = self.retrieveObject('')
636  ll = gbl.std.vector('IRegistry*')()
637  if type(node) is str:
638  obj = self.retrieveObject(node)
639  else:
640  obj = node
641  if self._idm.objectLeaves(node, ll).isSuccess():
642  return ll
643 

◆ registerObject()

def GaudiPython.Bindings.iDataSvc.registerObject (   self,
  path,
  obj 
)

Definition at line 549 of file Bindings.py.

549  def registerObject(self, path, obj):
550  if not self._idp:
551  raise AttributeError(
552  'C++ service %s does not exist' % self.__dict__['_name'])
553  return Helper.registerObject(self._idp, path, obj)
554 

◆ retrieveObject()

def GaudiPython.Bindings.iDataSvc.retrieveObject (   self,
  path 
)

Definition at line 561 of file Bindings.py.

561  def retrieveObject(self, path):
562  if not self._idp:
563  return None
564  return Helper.dataobject(self._idp, path)
565 

◆ setRoot()

def GaudiPython.Bindings.iDataSvc.setRoot (   self,
  name,
  obj 
)

Definition at line 694 of file Bindings.py.

694  def setRoot(self, name, obj):
695  if not self._idm:
696  raise IndexError(
697  'C++ service %s does not exist' % self.__dict__['_name'])
698  return self._idm.setRoot(name, obj)
699 

◆ unregisterObject()

def GaudiPython.Bindings.iDataSvc.unregisterObject (   self,
  path 
)

Definition at line 555 of file Bindings.py.

555  def unregisterObject(self, path):
556  if not self._idp:
557  raise AttributeError(
558  'C++ service %s does not exist' % self.__dict__['_name'])
559  return Helper.unregisterObject(self._idp, path)
560 

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