The Gaudi Framework  v32r2 (46d42edc)
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 523 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 524 of file Bindings.py.

524  def __init__(self, name, idp):
525  iService.__init__(self, name, idp)
526  self.__dict__['_idp'] = InterfaceCast(gbl.IDataProviderSvc)(idp)
527  self.__dict__['_idm'] = InterfaceCast(gbl.IDataManagerSvc)(idp)
528 

Member Function Documentation

◆ __delitem__()

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

Definition at line 607 of file Bindings.py.

607  def __delitem__(self, path):
608  if not self._idp:
609  raise IndexError(
610  'C++ service %s does not exist' % self.__dict__['_name'])
611  return self.unregisterObject(path)
612 

◆ __getitem__()

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

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

Definition at line 595 of file Bindings.py.

595  def __getitem__(self, path):
596  if not self._idp:
597  raise IndexError(
598  'C++ service %s does not exist' % self.__dict__['_name'])
599  return Helper.dataobject(self._idp, path)
600 

◆ __setitem__()

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

Definition at line 601 of file Bindings.py.

601  def __setitem__(self, path, obj):
602  if not self._idp:
603  raise IndexError(
604  'C++ service %s does not exist' % self.__dict__['_name'])
605  return self.registerObject(path, obj)
606 

◆ clearStore()

def GaudiPython.Bindings.iDataSvc.clearStore (   self)

Definition at line 680 of file Bindings.py.

680  def clearStore(self):
681  if not self._idm:
682  raise IndexError(
683  'C++ service %s does not exist' % self.__dict__['_name'])
684  return self._idm.clearStore()
685 
686 
687 # ----iHistogramSvc class------------------------------------------------------

◆ dump()

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

Definition at line 624 of file Bindings.py.

624  def dump(self, node=None):
625  if not node:
626  root = self.retrieveObject('')
627  if root:
628  node = root.registry()
629  else:
630  return
631  print(node.identifier())
632  if node.object():
633  for l in self.leaves(node):
634  self.dump(l)
635 

◆ 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 548 of file Bindings.py.

548  def findObject(self, path):
549  """
550 
551  Get the existing object in TransientStore for the given location
552 
553  - loading of object from persistency is NOT triggered
554  - 'data-on-demand' action is NOT triggered
555 
556  >>> svc = ... ## get the service
557  >>> path = ... ## get the path in Transient Store
558  >>> data = svc.findObject ( path ) ## use the method
559 
560  """
561  if not self._idp:
562  raise IndexError(
563  'C++ service %s does not exist' % self.__dict__['_name'])
564  return Helper.findobject(self._idp, path)
565 

◆ getHistoNames()

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

Definition at line 655 of file Bindings.py.

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

◆ getList()

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

Definition at line 636 of file Bindings.py.

636  def getList(self, node=None, lst=[], rootFID=None):
637  if not node:
638  root = self.retrieveObject('')
639  if root:
640  node = root.registry()
641  rootFID = node.address().par()
642  lst = []
643  else:
644  return
645  Helper.dataobject(self._idp, node.identifier())
646  if node.object():
647  lst.append(node.identifier())
648  for l in self.leaves(node):
649  if l.address() and l.address().par() == rootFID:
650  self.getList(l, lst, rootFID)
651  else:
652  continue
653  return lst
654 

◆ 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 567 of file Bindings.py.

567  def getObject(self, path, *args):
568  """
569  Get object from Transient Store for the given location
570 
571  arguments :
572  - path : Location of object in Transient Store
573  - retrieve (bool) True : retrieve versus find
574  - disable on-demand (bool) False : temporary disable 'on-demand' actions
575 
576  >>> svc = ... ## get the service
577  >>> path = ... ## get the path
578 
579  >>> data = svc.getObject ( path , False ) ## find object in Transient Store
580 
581  ## find object in Transient Store
582  # load form tape or use 'on-demand' action for missing objects :
583  >>> data = svc.getObject ( path , True )
584 
585  ## find object in Transient Store
586  # load from tape or for missing objects, disable 'on-demand'-actions
587  >>> data = svc.getObject ( path , True , True )
588 
589  """
590  if not self._idp:
591  raise IndexError(
592  'C++ service %s does not exist' % self.__dict__['_name'])
593  return Helper.getobject(self._idp, path, *args)
594 

◆ leaves()

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

Definition at line 613 of file Bindings.py.

613  def leaves(self, node=None):
614  if not node:
615  node = self.retrieveObject('')
616  ll = gbl.std.vector('IRegistry*')()
617  if type(node) is str:
618  obj = self.retrieveObject(node)
619  else:
620  obj = node
621  if self._idm.objectLeaves(node, ll).isSuccess():
622  return ll
623 

◆ registerObject()

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

Definition at line 529 of file Bindings.py.

529  def registerObject(self, path, obj):
530  if not self._idp:
531  raise AttributeError(
532  'C++ service %s does not exist' % self.__dict__['_name'])
533  return Helper.registerObject(self._idp, path, obj)
534 

◆ retrieveObject()

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

Definition at line 541 of file Bindings.py.

541  def retrieveObject(self, path):
542  if not self._idp:
543  return None
544  return Helper.dataobject(self._idp, path)
545 

◆ setRoot()

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

Definition at line 674 of file Bindings.py.

674  def setRoot(self, name, obj):
675  if not self._idm:
676  raise IndexError(
677  'C++ service %s does not exist' % self.__dict__['_name'])
678  return self._idm.setRoot(name, obj)
679 

◆ unregisterObject()

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

Definition at line 535 of file Bindings.py.

535  def unregisterObject(self, path):
536  if not self._idp:
537  raise AttributeError(
538  'C++ service %s does not exist' % self.__dict__['_name'])
539  return Helper.unregisterObject(self._idp, path)
540 

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