The Gaudi Framework  v33r0 (d5ea422b)
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 533 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 534 of file Bindings.py.

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

Member Function Documentation

◆ __delitem__()

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

Definition at line 617 of file Bindings.py.

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

◆ __getitem__()

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

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

Definition at line 605 of file Bindings.py.

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

◆ __setitem__()

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

Definition at line 611 of file Bindings.py.

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

◆ clearStore()

def GaudiPython.Bindings.iDataSvc.clearStore (   self)

Definition at line 690 of file Bindings.py.

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

◆ dump()

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

Definition at line 634 of file Bindings.py.

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

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

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

◆ getHistoNames()

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

Definition at line 665 of file Bindings.py.

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

◆ getList()

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

Definition at line 646 of file Bindings.py.

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

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

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

◆ leaves()

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

Definition at line 623 of file Bindings.py.

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

◆ registerObject()

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

Definition at line 539 of file Bindings.py.

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

◆ retrieveObject()

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

Definition at line 551 of file Bindings.py.

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

◆ setRoot()

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

Definition at line 684 of file Bindings.py.

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

◆ unregisterObject()

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

Definition at line 545 of file Bindings.py.

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

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