The Gaudi Framework  v33r1 (b1225454)
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 534 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 535 of file Bindings.py.

535  def __init__(self, name, idp):
536  iService.__init__(self, name, idp)
537  self.__dict__['_idp'] = InterfaceCast(gbl.IDataProviderSvc)(idp)
538  self.__dict__['_idm'] = InterfaceCast(gbl.IDataManagerSvc)(idp)
539 

Member Function Documentation

◆ __delitem__()

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

Definition at line 618 of file Bindings.py.

618  def __delitem__(self, path):
619  if not self._idp:
620  raise IndexError(
621  'C++ service %s does not exist' % self.__dict__['_name'])
622  return self.unregisterObject(path)
623 

◆ __getitem__()

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

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

Definition at line 606 of file Bindings.py.

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

◆ __setitem__()

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

Definition at line 612 of file Bindings.py.

612  def __setitem__(self, path, obj):
613  if not self._idp:
614  raise IndexError(
615  'C++ service %s does not exist' % self.__dict__['_name'])
616  return self.registerObject(path, obj)
617 

◆ clearStore()

def GaudiPython.Bindings.iDataSvc.clearStore (   self)

Definition at line 691 of file Bindings.py.

691  def clearStore(self):
692  if not self._idm:
693  raise IndexError(
694  'C++ service %s does not exist' % self.__dict__['_name'])
695  return self._idm.clearStore()
696 
697 
698 # ----iHistogramSvc class------------------------------------------------------

◆ dump()

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

Definition at line 635 of file Bindings.py.

635  def dump(self, node=None):
636  if not node:
637  root = self.retrieveObject('')
638  if root:
639  node = root.registry()
640  else:
641  return
642  print(node.identifier())
643  if node.object():
644  for l in self.leaves(node):
645  self.dump(l)
646 

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

559  def findObject(self, path):
560  """
561 
562  Get the existing object in TransientStore for the given location
563 
564  - loading of object from persistency is NOT triggered
565  - 'data-on-demand' action is NOT triggered
566 
567  >>> svc = ... ## get the service
568  >>> path = ... ## get the path in Transient Store
569  >>> data = svc.findObject ( path ) ## use the method
570 
571  """
572  if not self._idp:
573  raise IndexError(
574  'C++ service %s does not exist' % self.__dict__['_name'])
575  return Helper.findobject(self._idp, path)
576 

◆ getHistoNames()

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

Definition at line 666 of file Bindings.py.

666  def getHistoNames(self, node=None, lst=[]):
667  if not node:
668  root = self.retrieveObject('')
669  if root:
670  node = root.registry()
671  # rootFID = node.address().par()
672  lst = []
673  else:
674  return
675  Helper.dataobject(self._idp, node.identifier())
676  if node.object():
677  lst.append(node.identifier())
678  for l in self.leaves(node):
679  if l.name(): # and l.address().par() == rootFID :
680  self.getHistoNames(l, lst)
681  else:
682  continue
683  return lst
684 

◆ getList()

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

Definition at line 647 of file Bindings.py.

647  def getList(self, node=None, lst=[], rootFID=None):
648  if not node:
649  root = self.retrieveObject('')
650  if root:
651  node = root.registry()
652  rootFID = node.address().par()
653  lst = []
654  else:
655  return
656  Helper.dataobject(self._idp, node.identifier())
657  if node.object():
658  lst.append(node.identifier())
659  for l in self.leaves(node):
660  if l.address() and l.address().par() == rootFID:
661  self.getList(l, lst, rootFID)
662  else:
663  continue
664  return lst
665 

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

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

◆ leaves()

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

Definition at line 624 of file Bindings.py.

624  def leaves(self, node=None):
625  if not node:
626  node = self.retrieveObject('')
627  ll = gbl.std.vector('IRegistry*')()
628  if type(node) is str:
629  obj = self.retrieveObject(node)
630  else:
631  obj = node
632  if self._idm.objectLeaves(node, ll).isSuccess():
633  return ll
634 

◆ registerObject()

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

Definition at line 540 of file Bindings.py.

540  def registerObject(self, path, obj):
541  if not self._idp:
542  raise AttributeError(
543  'C++ service %s does not exist' % self.__dict__['_name'])
544  return Helper.registerObject(self._idp, path, obj)
545 

◆ retrieveObject()

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

Definition at line 552 of file Bindings.py.

552  def retrieveObject(self, path):
553  if not self._idp:
554  return None
555  return Helper.dataobject(self._idp, path)
556 

◆ setRoot()

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

Definition at line 685 of file Bindings.py.

685  def setRoot(self, name, obj):
686  if not self._idm:
687  raise IndexError(
688  'C++ service %s does not exist' % self.__dict__['_name'])
689  return self._idm.setRoot(name, obj)
690 

◆ unregisterObject()

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

Definition at line 546 of file Bindings.py.

546  def unregisterObject(self, path):
547  if not self._idp:
548  raise AttributeError(
549  'C++ service %s does not exist' % self.__dict__['_name'])
550  return Helper.unregisterObject(self._idp, path)
551 

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