All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MultiStoreSvc.cpp
Go to the documentation of this file.
1 //====================================================================
2 // MultiStoreSvc.cpp
3 //--------------------------------------------------------------------
4 //
5 // Package : System ( The LHCb Offline System)
6 //
7 // Description: implementation of the Transient event data service.
8 //
9 // Author : M.Frank
10 // History :
11 // +---------+----------------------------------------------+---------
12 // | Date | Comment | Who
13 // +---------+----------------------------------------------+---------
14 // | 29/10/98| Initial version | MF
15 // +---------+----------------------------------------------+---------
16 //
17 //====================================================================
18 #define DATASVC_MULTISTORESVC_CPP
19 
20 // Include files
21 #include "GaudiKernel/Service.h"
22 #include "GaudiKernel/SmartIF.h"
24 #include "GaudiKernel/MsgStream.h"
25 #include "GaudiKernel/Tokenizer.h"
26 #include "GaudiKernel/DataObject.h"
35 
36 #include <map>
37 
38 // Forward declarations
39 // This class
41 
42 typedef const std::string CSTR;
47 
48 namespace {
49 
50  struct Partition {
51  IDataProviderSvc* dataProvider;
52  IDataManagerSvc* dataManager;
53  std::string name;
54  Partition() : dataProvider(0), dataManager(0)
55  {
56  }
57  Partition(const Partition& entry)
58  : dataProvider(entry.dataProvider),
59  dataManager(entry.dataManager),
60  name(entry.name)
61  {
62  }
63  Partition& operator=(const Partition& entry) {
64  dataProvider = entry.dataProvider;
65  dataManager = entry.dataManager;
66  name = entry.name;
67  return *this;
68  }
69  };
70 }
71 
83 class MultiStoreSvc: public extends3<Service,
84  IDataProviderSvc,
85  IDataManagerSvc,
86  IPartitionControl>
87 {
88 protected:
89  typedef std::vector<std::string> PartitionDefs;
90  typedef std::map<std::string, Partition> Partitions;
94  std::string m_rootName;
96  std::string m_loader;
102  enum { no_type = 0, address_type = 1, object_type = 2};
103  struct tagROOT {
104  int type;
105  std::string path;
106  union {
109  } root;
110  tagROOT() : type(no_type) { root.address = 0; }
111  } m_root;
113  Partition m_current;
119  std::string m_defaultPartition;
120 
121 public:
123  virtual CLID rootCLID() const {
124  return (CLID)m_rootCLID;
125  }
127  std::string rootName() const {
128  return m_rootName;
129  }
130 
131 // macro to help writing the function calls
132 #define _CALL(P,F,ARGS) \
133  P ? P->F ARGS : IDataProviderSvc::INVALID_ROOT
134 
136  virtual STATUS registerAddress(CSTR& path, ADDRESS* pAddr) {
137  return _CALL(m_current.dataManager, registerAddress, (path, pAddr));
138  }
140  virtual STATUS registerAddress(OBJECT* parent, CSTR& path, ADDRESS* pAddr) {
141  return _CALL(m_current.dataManager, registerAddress, (parent, path, pAddr));
142  }
144  virtual STATUS registerAddress(IRegistry* parent, CSTR& path, ADDRESS* pAdd) {
145  return _CALL(m_current.dataManager, registerAddress, (parent, path, pAdd));
146  }
149  return _CALL(m_current.dataManager, unregisterAddress, (path));
150  }
152  virtual STATUS unregisterAddress(OBJECT* pParent, CSTR& path) {
153  return _CALL(m_current.dataManager, unregisterAddress, (pParent, path));
154  }
157  return _CALL(m_current.dataManager, unregisterAddress, (pParent, path));
158  }
160  virtual STATUS objectLeaves(const OBJECT* pObject, std::vector<IRegistry*>& leaves) {
161  return _CALL(m_current.dataManager, objectLeaves, (pObject, leaves));
162  }
164  virtual STATUS objectLeaves(const IRegistry* pObject, std::vector<IRegistry*>& leaves) {
165  return _CALL(m_current.dataManager, objectLeaves, (pObject, leaves));
166  }
168  virtual STATUS objectParent(const OBJECT* pObject, IRegistry*& refpParent) {
169  return _CALL(m_current.dataManager, objectParent, (pObject, refpParent));
170  }
172  virtual STATUS objectParent(const IRegistry* pObject, IRegistry*& refpParent) {
173  return _CALL(m_current.dataManager, objectParent, (pObject, refpParent));
174  }
177  return _CALL(m_current.dataManager, clearSubTree, (path));
178  }
180  virtual STATUS clearSubTree(OBJECT* pObject) {
181  return _CALL(m_current.dataManager, clearSubTree, (pObject));
182  }
184  virtual STATUS clearStore() {
185  Partitions::iterator i;
186  for(i=m_partitions.begin(); i != m_partitions.end(); ++i) {
187  (*i).second.dataManager->clearStore().ignore();
188  }
189  if ( m_root.root.object ) {
190  switch ( m_root.type ) {
191  case address_type:
193  break;
194  case object_type:
196  break;
197  }
198  m_root.root.object = 0;
199  }
200  m_root.path = "";
201  m_root.type = no_type;
202  return STATUS::SUCCESS;
203  }
205  virtual STATUS traverseSubTree(CSTR& path, AGENT* pAgent) {
206  return _CALL(m_current.dataManager, traverseSubTree, (path, pAgent));
207  }
209  virtual STATUS traverseSubTree(OBJECT* pObject, AGENT* pAgent) {
210  return _CALL(m_current.dataManager, traverseSubTree, (pObject, pAgent));
211  }
213  virtual STATUS traverseTree( AGENT* pAgent ) {
214  return _CALL(m_current.dataManager, traverseTree, (pAgent));
215  }
218  virtual STATUS setRoot( CSTR& path, OBJECT* pObj) {
219  if ( m_root.root.object ) {
220  switch ( m_root.type ) {
221  case address_type:
223  break;
224  case object_type:
226  break;
227  }
228  }
229  m_root.path = path;
231  m_root.root.object = pObj;
234  }
235 
238  virtual STATUS setRoot (CSTR& path, ADDRESS* pAddr) {
239  if ( m_root.root.object ) {
240  switch ( m_root.type ) {
241  case address_type:
243  break;
244  case object_type:
246  break;
247  }
248  }
249  m_root.path = path;
251  m_root.root.address = pAddr;
252  if ( m_root.root.address ) {
256  }
257  return STATUS::FAILURE;
258  }
260  virtual STATUS setDataLoader(IConversionSvc* pDataLoader) {
261  Partitions::iterator i;
262  if ( 0 != pDataLoader ) pDataLoader->addRef();
263  if ( 0 != m_dataLoader ) m_dataLoader->release();
264  if ( 0 != pDataLoader ) {
265  pDataLoader->setDataProvider(this);
266  }
267  m_dataLoader = pDataLoader;
268  for(i=m_partitions.begin(); i != m_partitions.end(); ++i) {
269  (*i).second.dataManager->setDataLoader(m_dataLoader).ignore();
270  }
271  return SUCCESS;
272  }
275  return _CALL(m_current.dataProvider, addPreLoadItem, (item));
276  }
279  return _CALL(m_current.dataProvider, addPreLoadItem, (item));
280  }
283  return _CALL(m_current.dataProvider, removePreLoadItem, (item));
284  }
287  return _CALL(m_current.dataProvider, removePreLoadItem, (item));
288  }
290  virtual STATUS resetPreLoad() {
291  return _CALL(m_current.dataProvider, resetPreLoad, ());
292  }
294  virtual STATUS preLoad() {
295  return _CALL(m_current.dataProvider, preLoad, ());
296  }
298  virtual STATUS registerObject(CSTR& path, OBJECT* pObj) {
299  return registerObject(0, path, pObj);
300  }
302  virtual STATUS registerObject(CSTR& parent, CSTR& obj, OBJECT* pObj) {
303  return _CALL(m_current.dataProvider, registerObject, (parent, obj, pObj));
304  }
306  virtual STATUS registerObject(CSTR& parent, int item, OBJECT* pObj) {
307  return _CALL(m_current.dataProvider, registerObject, (parent, item, pObj));
308  }
310  virtual STATUS registerObject(OBJECT* parent, CSTR& obj, OBJECT* pObj) {
311  return _CALL(m_current.dataProvider, registerObject, (parent, obj, pObj));
312  }
314  virtual STATUS registerObject(OBJECT* parent, int obj, OBJECT* pObj) {
315  return _CALL(m_current.dataProvider, registerObject, (parent, obj, pObj));
316  }
319  return _CALL(m_current.dataProvider, unregisterObject, (path));
320  }
322  virtual STATUS unregisterObject(CSTR& parent, CSTR& obj) {
323  return _CALL(m_current.dataProvider, unregisterObject, (parent, obj));
324  }
326  virtual STATUS unregisterObject(CSTR& parent, int obj) {
327  return _CALL(m_current.dataProvider, unregisterObject, (parent, obj));
328  }
330  virtual STATUS unregisterObject(OBJECT* pObj) {
331  return _CALL(m_current.dataProvider, unregisterObject, (pObj));
332  }
335  return _CALL(m_current.dataProvider, unregisterObject, (pObj, path));
336  }
338  virtual STATUS unregisterObject(OBJECT* pObj, int item ) {
339  return _CALL(m_current.dataProvider, unregisterObject, (pObj, item));
340  }
342  virtual STATUS retrieveObject(IRegistry* parent, CSTR& path, OBJECT*& pObj ) {
343  return _CALL(m_current.dataProvider, retrieveObject, (parent, path, pObj));
344  }
346  virtual STATUS retrieveObject(CSTR& path, OBJECT*& pObj) {
347  return _CALL(m_current.dataProvider, retrieveObject, (path, pObj));
348  }
350  virtual STATUS retrieveObject(CSTR& parent, CSTR& path, OBJECT*& pObj ) {
351  return _CALL(m_current.dataProvider, retrieveObject, (parent, path, pObj));
352  }
354  virtual STATUS retrieveObject(CSTR& parent, int item, OBJECT*& pObj) {
355  return _CALL(m_current.dataProvider, retrieveObject, (parent, item, pObj));
356  }
358  virtual STATUS retrieveObject(OBJECT* parent, CSTR& path, OBJECT*& pObj ) {
359  return _CALL(m_current.dataProvider, retrieveObject, (parent, path, pObj));
360  }
362  virtual STATUS retrieveObject(OBJECT* parent, int item, OBJECT*& pObj ) {
363  return _CALL(m_current.dataProvider, retrieveObject, (parent, item, pObj));
364  }
366  virtual STATUS findObject(CSTR& path, OBJECT*& pObj) {
367  return _CALL(m_current.dataProvider, retrieveObject, (path, pObj));
368  }
370  virtual STATUS findObject(IRegistry* parent, CSTR& path, OBJECT*& pObj) {
371  return _CALL(m_current.dataProvider, retrieveObject, (parent, path, pObj));
372  }
374  virtual STATUS findObject(CSTR& parent, CSTR& path, OBJECT*& pObj) {
375  return _CALL(m_current.dataProvider, retrieveObject, (parent, path, pObj));
376  }
378  virtual STATUS findObject(CSTR& parent, int item, OBJECT*& pObject ) {
379  return _CALL(m_current.dataProvider, findObject, (parent, item, pObject));
380  }
382  virtual STATUS findObject(OBJECT* parent, CSTR& path, OBJECT*& pObject) {
383  return _CALL(m_current.dataProvider, findObject, (parent, path, pObject));
384  }
386  virtual STATUS findObject(OBJECT* parent, int item, OBJECT*& pObject) {
387  return _CALL(m_current.dataProvider, findObject, (parent, item, pObject));
388  }
390  virtual STATUS linkObject(IRegistry* from, CSTR& objPath, OBJECT* to) {
391  return _CALL(m_current.dataProvider, linkObject, (from, objPath, to));
392  }
394  virtual STATUS linkObject(CSTR& from, CSTR& objPath, OBJECT* to) {
395  return _CALL(m_current.dataProvider, linkObject, (from, objPath, to));
396  }
398  virtual STATUS linkObject(OBJECT* from, CSTR& objPath, OBJECT* to) {
399  return _CALL(m_current.dataProvider, linkObject, (from, objPath, to));
400  }
402  virtual STATUS linkObject(CSTR& fullPath, OBJECT* to) {
403  return _CALL(m_current.dataProvider, linkObject, (fullPath, to));
404  }
406  virtual STATUS unlinkObject(IRegistry* from, CSTR& objPath) {
407  return _CALL(m_current.dataProvider, unlinkObject, (from, objPath));
408  }
410  virtual STATUS unlinkObject(CSTR& from, CSTR& objPath) {
411  return _CALL(m_current.dataProvider, unlinkObject, (from, objPath));
412  }
414  virtual STATUS unlinkObject(OBJECT* from, CSTR& objPath) {
415  return _CALL(m_current.dataProvider, unlinkObject, (from, objPath));
416  }
419  return _CALL(m_current.dataProvider, unlinkObject, (path));
420  }
422  virtual STATUS updateObject(IRegistry* pDirectory ) {
423  return _CALL(m_current.dataProvider, updateObject, (pDirectory));
424  }
427  return _CALL(m_current.dataProvider, updateObject, (path));
428  }
430  virtual STATUS updateObject(OBJECT* pObj ) {
431  return _CALL(m_current.dataProvider, updateObject, (pObj));
432  }
434  virtual STATUS updateObject(CSTR& parent, CSTR& updatePath ) {
435  return _CALL(m_current.dataProvider, updateObject, (parent, updatePath));
436  }
438  virtual STATUS updateObject(OBJECT* parent, CSTR& updatePath) {
439  return _CALL(m_current.dataProvider, updateObject, (parent, updatePath));
440  }
441 
443  virtual STATUS create(CSTR& nam, CSTR& typ) {
444  IInterface* pPartition = 0;
445  return create(nam, typ, pPartition);
446  }
447 
449  virtual STATUS create(CSTR& nam, CSTR& typ, IInterface*& pPartition) {
450  STATUS sc = get(nam, pPartition);
451  if ( !sc.isSuccess() ) {
454  SmartIF<IService>& isvc = serviceLocator()->service(typ);
455  if (isvc.isValid()) {
456  SmartIF<IDataManagerSvc> dataMgr(isvc);
457  SmartIF<IDataProviderSvc> dataProv(isvc);
458  if ( dataMgr.isValid() && dataProv.isValid() ) {
459  Partition p;
460  p.name = nam;
461  p.dataManager = dataMgr;
462  p.dataProvider = dataProv;
463  p.dataManager->addRef();
464  p.dataProvider->addRef();
465  m_partitions.insert(std::make_pair(nam, p));
466  return STATUS::SUCCESS;
467  }
468  else {
469  // Error
470  return NO_INTERFACE;
471  }
472  }
473  else {
474  // Error
475  return NO_INTERFACE;
476  }
477  }
478  return PARTITION_EXISTS;
479  }
480 
482  virtual STATUS drop(CSTR& nam) {
483  Partitions::iterator i = m_partitions.find(nam);
484  if ( i != m_partitions.end() ) {
485  if ( (*i).second.dataManager == m_current.dataManager ) {
486  m_current = Partition();
487  }
488  (*i).second.dataManager->clearStore().ignore();
489  (*i).second.dataProvider->release();
490  (*i).second.dataManager->release();
491  m_partitions.erase(i);
492  return STATUS::SUCCESS;
493  }
494  return PARTITION_NOT_PRESENT;
495  }
496 
498  virtual STATUS drop(IInterface* pPartition) {
499  SmartIF<IDataProviderSvc> provider(pPartition);
500  if ( provider.isValid() ) {
501  Partitions::iterator i;
502  for(i=m_partitions.begin(); i != m_partitions.end(); ++i) {
503  if ( (*i).second.dataProvider == provider ) {
504  (*i).second.dataManager->clearStore().ignore();
505  (*i).second.dataProvider->release();
506  (*i).second.dataManager->release();
507  m_partitions.erase(i);
508  return STATUS::SUCCESS;
509  }
510  }
511  return PARTITION_NOT_PRESENT;
512  }
513  return NO_INTERFACE;
514  }
515 
517  virtual STATUS activate(CSTR& nam) {
518  Partitions::const_iterator i = m_partitions.find(nam);
519  if ( i != m_partitions.end() ) {
520  m_current = (*i).second;
521  return STATUS::SUCCESS;
522  }
523  m_current = Partition();
524  return PARTITION_NOT_PRESENT;
525  }
526 
528  virtual STATUS activate(IInterface* pPartition) {
529  SmartIF<IDataProviderSvc> provider(pPartition);
530  m_current = Partition();
531  if ( provider ) {
532  Partitions::iterator i;
533  for(i=m_partitions.begin(); i != m_partitions.end(); ++i) {
534  if ( (*i).second.dataProvider == provider ) {
535  m_current = (*i).second;
536  return STATUS::SUCCESS;
537  }
538  }
539  return PARTITION_NOT_PRESENT;
540  }
541  return NO_INTERFACE;
542  }
543 
545  virtual STATUS get(CSTR& nam, IInterface*& pPartition) const {
546  Partitions::const_iterator i = m_partitions.find(nam);
547  if ( i != m_partitions.end() ) {
548  pPartition = (*i).second.dataProvider;
549  return STATUS::SUCCESS;
550  }
551  pPartition = 0;
552  return PARTITION_NOT_PRESENT;
553  }
554 
556  virtual StatusCode activePartition(std::string& nam, IInterface*& pPartition) const {
557  if ( m_current.dataProvider ) {
558  nam = m_current.name;
559  pPartition = m_current.dataProvider;
560  return STATUS::SUCCESS;
561  }
562  nam = "";
563  pPartition = 0;
564  return NO_ACTIVE_PARTITION;
565  }
566 
568  MsgStream log(msgSvc(), name());
569  // Attach address creator facility
571  if (!sc.isSuccess()) {
572  log << MSG::ERROR
573  << "Failed to retrieve data loader "
574  << "\"" << m_loader << "\"" << endmsg;
575  return sc;
576  }
577  IConversionSvc* dataLoader = 0;
578  // Attach data loader facility
579  sc = service(m_loader, dataLoader, true);
580  if (!sc.isSuccess()) {
581  log << MSG::ERROR << "Failed to retrieve data loader "
582  << "\"" << m_loader << "\"" << endmsg;
583  return sc;
584  }
585  sc = setDataLoader(dataLoader);
586  dataLoader->release();
587  if (!sc.isSuccess()) {
588  log << MSG::ERROR << "Failed to set data loader "
589  << "\"" << m_loader << "\"" << endmsg;
590  return sc;
591  }
592  return sc;
593  }
594 
598  m_addrCreator = 0;
599  m_dataLoader = 0;
600  return STATUS::SUCCESS;
601  }
602 
604  virtual STATUS initialize() {
605  // Nothing to do: just call base class initialisation
607  if ( !sc.isSuccess() ) {
608  return sc;
609  }
610  sc = makePartitions();
611  if (!sc.isSuccess()) {
612  MsgStream log(msgSvc(), name());
613  log << MSG::ERROR << "Failed to connect to all store partitions." << endmsg;
614  return sc;
615  }
616  return attachServices();
617  }
618 
620  virtual STATUS reinitialize() {
622  MsgStream log(msgSvc(), name());
623  if (!sc.isSuccess()) {
624  log << MSG::ERROR << "Enable to reinitialize base class"
625  << endmsg;
626  return sc;
627  }
628  detachServices();
629  sc = attachServices();
630  if ( !sc.isSuccess() ) {
631  log << MSG::ERROR << "Failed to attach necessary services." << endmsg;
632  return sc;
633  }
634  sc = makePartitions();
635  if (!sc.isSuccess()) {
636  log << MSG::ERROR << "Failed to connect to store partitions." << endmsg;
637  return sc;
638  }
639  // return
640  return STATUS::SUCCESS;
641  }
642 
644  virtual STATUS finalize() {
645  setDataLoader(0).ignore();
646  clearStore().ignore();
648  m_current = Partition();
649  detachServices();
650  return Service::finalize();
651  }
652 
653 
654 //protected:
655 
658  : base_class(name,svc), m_rootCLID(110), m_rootName("/Event"),
660  {
661  m_dataLoader = 0;
662  declareProperty("RootCLID", m_rootCLID);
663  declareProperty("RootName", m_rootName);
664  declareProperty("Partitions", m_partitionDefs);
665  declareProperty("DataLoader", m_loader="EventPersistencySvc");
666  declareProperty("DefaultPartition", m_defaultPartition="Default");
667  }
668 
670  virtual ~MultiStoreSvc() {
671  setDataLoader(0).ignore();
672  resetPreLoad().ignore();
673  clearStore().ignore();
675  }
676 
679  STATUS iret = STATUS::SUCCESS;
680  for(Partitions::iterator i=m_partitions.begin(); i != m_partitions.end(); ++i) {
682  switch ( m_root.type ) {
683  case address_type:
684  if ( m_root.root.address ) {
685  ADDRESS* pAdd = 0;
686  ADDRESS* p = m_root.root.address;
688  p->clID(),
689  p->par(),
690  p->ipar(),
691  pAdd);
692  if ( sc.isSuccess() ) {
693  sc = (*i).second.dataManager->setRoot(m_root.path, pAdd);
694  }
695  }
696  break;
697  case object_type:
698  if ( m_root.root.object ) {
699  if ( m_root.root.object->clID() == CLID_DataObject ) {
700  DataObject* pObj = new DataObject();
701  sc = (*i).second.dataManager->setRoot(m_root.path, pObj);
702  }
703  }
704  break;
705  default:
706  sc = STATUS::FAILURE;
707  break;
708  }
709  if ( !sc.isSuccess() ) {
710  iret = sc;
711  }
712  }
713  return iret;
714  }
715 
718  Partitions::iterator i;
719  for(i=m_partitions.begin(); i != m_partitions.end(); ++i) {
720  (*i).second.dataManager->clearStore().ignore();
721  (*i).second.dataProvider->release();
722  (*i).second.dataManager->release();
723  }
724  m_partitions.clear();
725  return STATUS::SUCCESS;
726  }
727 
730  std::string typ, nam;
731  PartitionDefs::iterator j;
733  for(j=m_partitionDefs.begin(); j != m_partitionDefs.end(); ++j) {
734  Tokenizer tok(true);
735  Tokenizer::Items::iterator i;
736  tok.analyse(*j, " ", "", "", "=", "'", "'");
737  for(i = tok.items().begin(); i != tok.items().end(); i++ ) {
738  CSTR& t = (*i).tag();
739  CSTR& v = (*i).value();
740  switch( ::toupper(t[0]) ) {
741  case 'N':
742  nam = v;
743  break;
744  case 'T':
745  typ = v;
746  break;
747  }
748  }
749  STATUS sc = create(nam, typ);
750  if ( !sc.isSuccess() ) {
751  return sc;
752  }
753  else if ( !m_defaultPartition.length() ) {
754  m_defaultPartition = nam;
755  }
756  }
757  return STATUS::SUCCESS;
758  }
759 };
760 
761 // Instantiation of a static factory class used by clients to create
762 // instances of this service
virtual STATUS resetPreLoad()
Clear the preload list.
virtual const std::string * par() const =0
Retrieve String parameters.
virtual STATUS unlinkObject(IRegistry *from, CSTR &objPath)
Remove a link to another object.
virtual STATUS activate(IInterface *pPartition)
Activate a partition object.
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
virtual STATUS initialize()
Service initialisation.
virtual STATUS reinitialize()
Service initialisation.
virtual STATUS retrieveObject(CSTR &parent, CSTR &path, OBJECT *&pObj)
Retrieve object from data store.
std::string rootName() const
Name for root Event.
virtual STATUS objectLeaves(const IRegistry *pObject, std::vector< IRegistry * > &leaves)
Explore the object store: retrieve all leaves attached to the object.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:26
virtual STATUS registerObject(CSTR &parent, CSTR &obj, OBJECT *pObj)
Register object with the data store.
Partitions m_partitions
Datastore partitions.
virtual STATUS clearSubTree(OBJECT *pObject)
Remove all data objects below the sub tree identified.
virtual STATUS setRoot(CSTR &path, OBJECT *pObj)
Initialize data store for new event by giving new event path and root object.
PartitionDefs m_partitionDefs
Datastore partition definitions.
virtual STATUS clearSubTree(CSTR &path)
Remove all data objects below the sub tree identified.
Items & items()
Access token collection.
Definition: Tokenizer.h:99
Requested interface is not available.
Definition: IInterface.h:221
virtual STATUS findObject(OBJECT *parent, int item, OBJECT *&pObject)
Find object in the data store.
virtual STATUS setDataLoader(IConversionSvc *pDataLoader)
IDataManagerSvc: Pass a default data loader to the service.
virtual STATUS traverseSubTree(CSTR &path, AGENT *pAgent)
Analyze by traversing all data objects below the sub tree.
virtual STATUS registerObject(CSTR &path, OBJECT *pObj)
Register object with the data store.
virtual STATUS traverseTree(AGENT *pAgent)
IDataManagerSvc: Analyze by traversing all data objects in the data store.
virtual StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ipar, IOpaqueAddress *&refpAddress)=0
Create a Generic address using explicit arguments to identify a single object.
virtual STATUS updateObject(IRegistry *pDirectory)
Update object identified by its directory entry.
virtual STATUS linkObject(OBJECT *from, CSTR &objPath, OBJECT *to)
Add a link to another object.
virtual STATUS activate(CSTR &nam)
Activate a partition object. The name identifies the partition uniquely.
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Normal successful completion.
Definition: IInterface.h:219
virtual STATUS registerObject(OBJECT *parent, CSTR &obj, OBJECT *pObj)
Register object with the data store.
virtual STATUS retrieveObject(CSTR &parent, int item, OBJECT *&pObj)
Retrieve object from data store.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
virtual STATUS removePreLoadItem(CSTR &item)
Add an item to the preload list.
virtual STATUS updateObject(OBJECT *pObj)
Update object.
STATUS detachServices()
IAddressCreator interface definition.
virtual StatusCode setDataProvider(IDataProviderSvc *pService)=0
Set Data provider service.
virtual STATUS findObject(CSTR &parent, CSTR &path, OBJECT *&pObj)
Find object in the data store.
StatusCode STATUS
virtual STATUS unregisterObject(CSTR &parent, CSTR &obj)
Unregister object from the data store.
virtual STATUS retrieveObject(CSTR &path, OBJECT *&pObj)
Retrieve object identified by its full path from the data store.
virtual STATUS retrieveObject(OBJECT *parent, CSTR &path, OBJECT *&pObj)
Retrieve object from data store.
void analyse(const std::string &s, const char *delim, const char *tagBegin, const char *tagEnd, const char *eq, const char *valBegin, const char *valEnd)
Analyse tokens from string.
Definition: Tokenizer.cpp:37
virtual STATUS finalize()
Service initialisation.
virtual STATUS findObject(OBJECT *parent, CSTR &path, OBJECT *&pObject)
Find object in the data store.
virtual STATUS unregisterObject(OBJECT *pObj, CSTR &path)
Unregister object from the data store.
virtual unsigned long release()=0
release reference to object
Data service base class.
Data provider interface definition.
virtual STATUS clearStore()
IDataManagerSvc: Remove all data objects in the data store.
Description of the DataStoreItem class.
Definition: DataStoreItem.h:18
virtual long svcType() const =0
Retrieve service type.
std::string m_rootName
Name of root event.
Base class used to extend a class implementing other interfaces.
Definition: extends.h:140
#define DECLARE_COMPONENT(type)
Definition: PluginService.h:36
virtual STATUS create(CSTR &nam, CSTR &typ, IInterface *&pPartition)
Create a partition object. The name identifies the partition uniquely.
virtual STATUS drop(CSTR &nam)
Drop a partition object. The name identifies the partition uniquely.
virtual STATUS findObject(CSTR &path, OBJECT *&pObj)
Find object identified by its full path in the data store.
IConversionSvc * m_dataLoader
Pointer to data loader service.
std::vector< std::string > PartitionDefs
virtual STATUS unlinkObject(CSTR &from, CSTR &objPath)
Remove a link to another object.
virtual STATUS addPreLoadItem(const DataStoreItem &item)
Add an item to the preload list.
STATUS makePartitions()
Create all partitions according to job options.
virtual STATUS findObject(IRegistry *parent, CSTR &path, OBJECT *&pObj)
Find object identified by its full path in the data store.
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:9
virtual const CLID & clID() const
Retrieve reference to class definition structure.
Definition: DataObject.cpp:58
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:51
virtual const CLID & clID() const =0
Retrieve class information from link.
virtual STATUS preLoad()
load all preload items of the list
virtual STATUS objectLeaves(const OBJECT *pObject, std::vector< IRegistry * > &leaves)
Explore the object store: retrieve all leaves attached to the object.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:30
Definition of the basic interface.
Definition: IInterface.h:160
struct MultiStoreSvc::tagROOT m_root
virtual STATUS updateObject(CSTR &parent, CSTR &updatePath)
Update object.
STL Include files.
Definition: Tokenizer.h:24
virtual STATUS unregisterObject(CSTR &path)
Unregister object from the data store.
virtual STATUS objectParent(const OBJECT *pObject, IRegistry *&refpParent)
IDataManagerSvc: Explore the object store: retrieve the object's parent.
virtual STATUS unlinkObject(OBJECT *from, CSTR &objPath)
Remove a link to another object.
virtual STATUS registerAddress(IRegistry *parent, CSTR &path, ADDRESS *pAdd)
IDataManagerSvc: Register object address with the data store.
IAddressCreator * m_addrCreator
Reference to address creator.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
virtual STATUS retrieveObject(IRegistry *parent, CSTR &path, OBJECT *&pObj)
Retrieve object from data store.
const std::string CSTR
virtual STATUS addPreLoadItem(CSTR &item)
Add an item to the preload list.
DataObject OBJECT
virtual STATUS findObject(CSTR &parent, int item, OBJECT *&pObject)
Find object in the data store.
MultiStoreSvc(CSTR &name, ISvcLocator *svc)
Standard Constructor.
STATUS clearPartitions()
Clear all partitions.
unsigned int CLID
Class ID definition.
Definition: ClassID.h:9
#define _CALL(P, F, ARGS)
union MultiStoreSvc::tagROOT::@1 root
std::string m_loader
Data loader name.
virtual const std::string & name() const
Retrieve name of the service.
Definition: Service.cpp:331
Partition m_current
Current partition.
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
virtual STATUS registerObject(CSTR &parent, int item, OBJECT *pObj)
Register object with the data store.
STATUS preparePartitions()
Prepare partition for usage.
virtual StatusCode reinitialize()
Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED).
Definition: Service.cpp:294
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:44
virtual unsigned long release()=0
Release Interface instance.
virtual StatusCode initialize()
Initialization (from CONFIGURED to INITIALIZED).
Definition: Service.cpp:74
Generic data agent interface.
virtual STATUS linkObject(CSTR &from, CSTR &objPath, OBJECT *to)
Add a link to another object.
virtual STATUS drop(IInterface *pPartition)
Drop a partition object. The name identifies the partition uniquely.
virtual STATUS unregisterAddress(IRegistry *pParent, CSTR &path)
IDataManagerSvc: Unregister object address from the data store.
virtual STATUS unregisterAddress(OBJECT *pParent, CSTR &path)
IDataManagerSvc: Unregister object address from the data store.
virtual STATUS setRoot(CSTR &path, ADDRESS *pAddr)
Initialize data store for new event by giving new event path and address of root object.
virtual STATUS retrieveObject(OBJECT *parent, int item, OBJECT *&pObj)
Retrieve object from data store.
virtual STATUS linkObject(CSTR &fullPath, OBJECT *to)
Add a link to another object.
virtual STATUS create(CSTR &nam, CSTR &typ)
Create a partition object. The name identifies the partition uniquely.
CLID m_rootCLID
Integer Property corresponding to CLID of root entry.
virtual STATUS unregisterAddress(CSTR &path)
IDataManagerSvc: Unregister object address from the data store.
tuple item
print s1,s2
Definition: ana.py:146
Templated class to add the standard messaging functionalities.
virtual STATUS registerObject(OBJECT *parent, int obj, OBJECT *pObj)
Register object with the data store.
virtual STATUS registerAddress(CSTR &path, ADDRESS *pAddr)
IDataManagerSvc: Register object address with the data store.
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Service.h:142
virtual STATUS registerAddress(OBJECT *parent, CSTR &path, ADDRESS *pAddr)
IDataManagerSvc: Register object address with the data store.
virtual CLID rootCLID() const
IDataManagerSvc: Accessor for root event CLID.
virtual ~MultiStoreSvc()
Standard Destructor.
virtual STATUS updateObject(OBJECT *parent, CSTR &updatePath)
Update object.
virtual STATUS updateObject(CSTR &path)
Update object.
Opaque address interface definition.
void ignore() const
Definition: StatusCode.h:107
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Service.h:211
virtual STATUS unlinkObject(CSTR &path)
Remove a link to another object.
IOpaqueAddress ADDRESS
std::map< std::string, Partition > Partitions
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
list i
Definition: ana.py:128
std::string m_defaultPartition
Default partition.
virtual StatusCode activePartition(std::string &nam, IInterface *&pPartition) const
Access the active partition object.
virtual STATUS removePreLoadItem(const DataStoreItem &item)
Remove an item from the preload list.
virtual const unsigned long * ipar() const =0
Access to generic link parameters.
virtual STATUS unregisterObject(OBJECT *pObj)
Unregister object from the data store.
void toupper(std::string &s)
virtual STATUS traverseSubTree(OBJECT *pObject, AGENT *pAgent)
IDataManagerSvc: Analyze by traversing all data objects below the sub tree.
virtual STATUS unregisterObject(CSTR &parent, int obj)
Unregister object from the data store.
virtual StatusCode finalize()
Finalize (from INITIALIZED to CONFIGURED).
Definition: Service.cpp:199
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
IDataStoreAgent AGENT
SmartIF< ISvcLocator > & serviceLocator() const
Retrieve pointer to service locator.
Definition: Service.cpp:336
virtual STATUS linkObject(IRegistry *from, CSTR &objPath, OBJECT *to)
Add a link to another object.
STATUS attachServices()
virtual STATUS objectParent(const IRegistry *pObject, IRegistry *&refpParent)
IDataManagerSvc: Explore the object store: retrieve the object's parent.
virtual unsigned long addRef()=0
Add reference to object.
virtual STATUS unregisterObject(OBJECT *pObj, int item)
Unregister object from the data store.