The Gaudi Framework  v29r0 (ff2e7097)
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
22 #include "GaudiKernel/DataObject.h"
31 #include "GaudiKernel/MsgStream.h"
32 #include "GaudiKernel/Service.h"
33 #include "GaudiKernel/SmartIF.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 final {
51  SmartIF<IDataProviderSvc> dataProvider;
52  SmartIF<IDataManagerSvc> dataManager;
54  };
55 }
56 
68 class MultiStoreSvc : public extends<Service, IDataProviderSvc, IDataManagerSvc, IPartitionControl>
69 {
70 protected:
73 
74  Gaudi::Property<CLID> m_rootCLID{this, "RootCLID", 110, "CLID of root entry"};
75  Gaudi::Property<std::string> m_rootName{this, "RootName", "/Event", "name of root entry"};
76  Gaudi::Property<PartitionDefs> m_partitionDefs{this, "Partitions", {}, "datastore partition definitions"};
77  Gaudi::Property<std::string> m_loader{this, "DataLoader", "EventPersistencySvc", "data loader name"};
78  Gaudi::Property<std::string> m_defaultPartition{this, "DefaultPartition", "Default", "default partition name"};
79 
85  enum { no_type = 0, address_type = 1, object_type = 2 };
86  struct tagROOT {
87  int type = no_type;
89  union {
92  } root;
93  tagROOT() { root.address = nullptr; }
94  } m_root;
96  Partition m_current;
98  Partitions m_partitions;
99 
100  // member templates to help writing the function calls
101  template <typename... Args, typename... UArgs>
102  STATUS call_( STATUS ( IDataProviderSvc::*pmf )( Args... ), UArgs&&... args )
103  {
104  return m_current.dataProvider ? ( m_current.dataProvider->*pmf )( std::forward<UArgs>( args )... )
106  }
107  template <typename... Args, typename... UArgs>
108  STATUS call_( STATUS ( IDataManagerSvc::*pmf )( Args... ), UArgs&&... args )
109  {
110  return m_current.dataManager ? ( m_current.dataManager->*pmf )( std::forward<UArgs>( args )... )
112  }
113 
114 public:
116  CLID rootCLID() const override { return m_rootCLID; }
118  const std::string& rootName() const override { return m_rootName; }
119 
121  STATUS registerAddress( CSTR& path, ADDRESS* pAddr ) override
122  {
123  return call_<CSTR&, ADDRESS*>( &IDataManagerSvc::registerAddress, path, pAddr );
124  }
126  STATUS registerAddress( OBJECT* parent, CSTR& path, ADDRESS* pAddr ) override
127  {
128  return call_<OBJECT*, CSTR&, ADDRESS*>( &IDataManagerSvc::registerAddress, parent, path, pAddr );
129  }
131  STATUS registerAddress( IRegistry* parent, CSTR& path, ADDRESS* pAdd ) override
132  {
133  return call_<IRegistry*, CSTR&, ADDRESS*>( &IDataManagerSvc::registerAddress, parent, path, pAdd );
134  }
136  STATUS unregisterAddress( CSTR& path ) override { return call_<CSTR&>( &IDataManagerSvc::unregisterAddress, path ); }
138  STATUS unregisterAddress( OBJECT* pParent, CSTR& path ) override
139  {
140  return call_<OBJECT*, CSTR&>( &IDataManagerSvc::unregisterAddress, pParent, path );
141  }
143  STATUS unregisterAddress( IRegistry* pParent, CSTR& path ) override
144  {
145  return call_<IRegistry*, CSTR&>( &IDataManagerSvc::unregisterAddress, pParent, path );
146  }
148  STATUS objectLeaves( const OBJECT* pObject, std::vector<IRegistry*>& leaves ) override
149  {
150  return call_<const OBJECT*, std::vector<IRegistry*>&>( &IDataManagerSvc::objectLeaves, pObject, leaves );
151  }
153  STATUS objectLeaves( const IRegistry* pObject, std::vector<IRegistry*>& leaves ) override
154  {
155  return call_<const IRegistry*, std::vector<IRegistry*>&>( &IDataManagerSvc::objectLeaves, pObject, leaves );
156  }
158  STATUS objectParent( const OBJECT* pObject, IRegistry*& refpParent ) override
159  {
160  return call_<const OBJECT*, IRegistry*&>( &IDataManagerSvc::objectParent, pObject, refpParent );
161  }
163  STATUS objectParent( const IRegistry* pObject, IRegistry*& refpParent ) override
164  {
165  return call_<const IRegistry*, IRegistry*&>( &IDataManagerSvc::objectParent, pObject, refpParent );
166  }
168  STATUS clearSubTree( CSTR& path ) override { return call_<CSTR&>( &IDataManagerSvc::clearSubTree, path ); }
170  STATUS clearSubTree( OBJECT* pObject ) override { return call_<OBJECT*>( &IDataManagerSvc::clearSubTree, pObject ); }
172  STATUS clearStore() override
173  {
174  for ( auto& i : m_partitions ) {
175  i.second.dataManager->clearStore().ignore();
176  }
177  if ( m_root.root.object ) {
178  switch ( m_root.type ) {
179  case address_type:
180  m_root.root.address->release();
181  break;
182  case object_type:
183  m_root.root.object->release();
184  break;
185  }
186  m_root.root.object = nullptr;
187  }
188  m_root.path.clear();
189  m_root.type = no_type;
190  return STATUS::SUCCESS;
191  }
193  STATUS traverseSubTree( CSTR& path, AGENT* pAgent ) override
194  {
195  return call_<CSTR&, AGENT*>( &IDataManagerSvc::traverseSubTree, path, pAgent );
196  }
198  STATUS traverseSubTree( OBJECT* pObject, AGENT* pAgent ) override
199  {
200  return call_<OBJECT*, AGENT*>( &IDataManagerSvc::traverseSubTree, pObject, pAgent );
201  }
203  STATUS traverseTree( AGENT* pAgent ) override { return call_<AGENT*>( &IDataManagerSvc::traverseTree, pAgent ); }
206  STATUS setRoot( std::string path, OBJECT* pObj ) override
207  {
208  if ( m_root.root.object ) {
209  switch ( m_root.type ) {
210  case address_type:
211  m_root.root.address->release();
212  break;
213  case object_type:
214  m_root.root.object->release();
215  break;
216  }
217  }
218  m_root.path = std::move( path );
219  m_root.type = object_type;
220  m_root.root.object = pObj;
221  preparePartitions();
222  return activate( m_defaultPartition );
223  }
224 
227  STATUS setRoot( std::string path, ADDRESS* pAddr ) override
228  {
229  if ( m_root.root.object ) {
230  switch ( m_root.type ) {
231  case address_type:
232  m_root.root.address->release();
233  break;
234  case object_type:
235  m_root.root.object->release();
236  break;
237  }
238  }
239  m_root.path = std::move( path );
240  m_root.type = address_type;
241  m_root.root.address = pAddr;
242  if ( m_root.root.address ) {
243  m_root.root.address->addRef();
244  preparePartitions();
245  return activate( m_defaultPartition );
246  }
247  return STATUS::FAILURE;
248  }
250  STATUS setDataLoader( IConversionSvc* pDataLoader, IDataProviderSvc* dpsvc = nullptr ) override
251  {
252  m_dataLoader = pDataLoader;
253  if ( m_dataLoader ) m_dataLoader->setDataProvider( dpsvc ? dpsvc : this );
254  for ( auto& i : m_partitions ) {
255  i.second.dataManager->setDataLoader( m_dataLoader.get() ).ignore();
256  }
257  return SUCCESS;
258  }
260  STATUS addPreLoadItem( const DataStoreItem& item ) override
261  {
262  return call_<const DataStoreItem&>( &IDataProviderSvc::addPreLoadItem, item );
263  }
265  STATUS addPreLoadItem( CSTR& item ) override { return call_<CSTR&>( &IDataProviderSvc::addPreLoadItem, item ); }
267  STATUS removePreLoadItem( const DataStoreItem& item ) override
268  {
269  return call_<const DataStoreItem&>( &IDataProviderSvc::removePreLoadItem, item );
270  }
272  STATUS removePreLoadItem( CSTR& item ) override { return call_<CSTR&>( &IDataProviderSvc::removePreLoadItem, item ); }
274  STATUS resetPreLoad() override { return call_<>( &IDataProviderSvc::resetPreLoad ); }
276  STATUS preLoad() override { return call_<>( &IDataProviderSvc::preLoad ); }
278  STATUS registerObject( CSTR& path, OBJECT* pObj ) override { return registerObject( nullptr, path, pObj ); }
280  STATUS registerObject( CSTR& parent, CSTR& obj, OBJECT* pObj ) override
281  {
282  return call_<CSTR&, CSTR&, OBJECT*>( &IDataProviderSvc::registerObject, parent, obj, pObj );
283  }
285  STATUS registerObject( CSTR& parent, int item, OBJECT* pObj ) override
286  {
287  return call_<CSTR&, int, OBJECT*>( &IDataProviderSvc::registerObject, parent, item, pObj );
288  }
290  STATUS registerObject( OBJECT* parent, CSTR& obj, OBJECT* pObj ) override
291  {
292  return call_<OBJECT*, CSTR&, OBJECT*>( &IDataProviderSvc::registerObject, parent, obj, pObj );
293  }
295  STATUS registerObject( OBJECT* parent, int obj, OBJECT* pObj ) override
296  {
297  return call_<OBJECT*, int, OBJECT*>( &IDataProviderSvc::registerObject, parent, obj, pObj );
298  }
300  STATUS unregisterObject( CSTR& path ) override { return call_<CSTR&>( &IDataProviderSvc::unregisterObject, path ); }
302  STATUS unregisterObject( CSTR& parent, CSTR& obj ) override
303  {
304  return call_<CSTR&, CSTR&>( &IDataProviderSvc::unregisterObject, parent, obj );
305  }
307  STATUS unregisterObject( CSTR& parent, int obj ) override
308  {
309  return call_<CSTR&, int>( &IDataProviderSvc::unregisterObject, parent, obj );
310  }
312  STATUS unregisterObject( OBJECT* pObj ) override
313  {
314  return call_<OBJECT*>( &IDataProviderSvc::unregisterObject, pObj );
315  }
317  STATUS unregisterObject( OBJECT* pObj, CSTR& path ) override
318  {
319  return call_<OBJECT*, CSTR&>( &IDataProviderSvc::unregisterObject, pObj, path );
320  }
322  STATUS unregisterObject( OBJECT* pObj, int item ) override
323  {
324  return call_<OBJECT*, int>( &IDataProviderSvc::unregisterObject, pObj, item );
325  }
327  STATUS retrieveObject( IRegistry* parent, CSTR& path, OBJECT*& pObj ) override
328  {
329  return call_<IRegistry*, CSTR&, OBJECT*&>( &IDataProviderSvc::retrieveObject, parent, path, pObj );
330  }
332  STATUS retrieveObject( CSTR& path, OBJECT*& pObj ) override
333  {
334  return call_<CSTR&, OBJECT*&>( &IDataProviderSvc::retrieveObject, path, pObj );
335  }
337  STATUS retrieveObject( CSTR& parent, CSTR& path, OBJECT*& pObj ) override
338  {
339  return call_<CSTR&, CSTR&, OBJECT*&>( &IDataProviderSvc::retrieveObject, parent, path, pObj );
340  }
342  STATUS retrieveObject( CSTR& parent, int item, OBJECT*& pObj ) override
343  {
344  return call_<CSTR&, int, OBJECT*&>( &IDataProviderSvc::retrieveObject, parent, item, pObj );
345  }
347  STATUS retrieveObject( OBJECT* parent, CSTR& path, OBJECT*& pObj ) override
348  {
349  return call_<OBJECT*, CSTR&, OBJECT*&>( &IDataProviderSvc::retrieveObject, parent, path, pObj );
350  }
352  STATUS retrieveObject( OBJECT* parent, int item, OBJECT*& pObj ) override
353  {
354  return call_<OBJECT*, int, OBJECT*&>( &IDataProviderSvc::retrieveObject, parent, item, pObj );
355  }
357  STATUS findObject( CSTR& path, OBJECT*& pObj ) override
358  {
359  return call_<CSTR&, OBJECT*&>( &IDataProviderSvc::retrieveObject, path, pObj );
360  }
362  STATUS findObject( IRegistry* parent, CSTR& path, OBJECT*& pObj ) override
363  {
364  return call_<IRegistry*, CSTR&, OBJECT*&>( &IDataProviderSvc::findObject, parent, path, pObj );
365  }
367  STATUS findObject( CSTR& parent, CSTR& path, OBJECT*& pObj ) override
368  {
369  return call_<CSTR&, CSTR&, OBJECT*&>( &IDataProviderSvc::retrieveObject, parent, path, pObj );
370  }
372  STATUS findObject( CSTR& parent, int item, OBJECT*& pObject ) override
373  {
374  return call_<CSTR&, int, OBJECT*&>( &IDataProviderSvc::findObject, parent, item, pObject );
375  }
377  STATUS findObject( OBJECT* parent, CSTR& path, OBJECT*& pObject ) override
378  {
379  return call_<OBJECT*, CSTR&, OBJECT*&>( &IDataProviderSvc::findObject, parent, path, pObject );
380  }
382  STATUS findObject( OBJECT* parent, int item, OBJECT*& pObject ) override
383  {
384  return call_<OBJECT*, int, OBJECT*&>( &IDataProviderSvc::findObject, parent, item, pObject );
385  }
387  STATUS linkObject( IRegistry* from, CSTR& objPath, OBJECT* to ) override
388  {
389  return call_<IRegistry*, CSTR&, OBJECT*>( &IDataProviderSvc::linkObject, from, objPath, to );
390  }
392  STATUS linkObject( CSTR& from, CSTR& objPath, OBJECT* to ) override
393  {
394  return call_<CSTR&, CSTR&, OBJECT*>( &IDataProviderSvc::linkObject, from, objPath, to );
395  }
397  STATUS linkObject( OBJECT* from, CSTR& objPath, OBJECT* to ) override
398  {
399  return call_<OBJECT*, CSTR&, OBJECT*>( &IDataProviderSvc::linkObject, from, objPath, to );
400  }
402  STATUS linkObject( CSTR& fullPath, OBJECT* to ) override
403  {
404  return call_<CSTR&, OBJECT*>( &IDataProviderSvc::linkObject, fullPath, to );
405  }
407  STATUS unlinkObject( IRegistry* from, CSTR& objPath ) override
408  {
409  return call_<IRegistry*, CSTR&>( &IDataProviderSvc::unlinkObject, from, objPath );
410  }
412  STATUS unlinkObject( CSTR& from, CSTR& objPath ) override
413  {
414  return call_<CSTR&, CSTR&>( &IDataProviderSvc::unlinkObject, from, objPath );
415  }
417  STATUS unlinkObject( OBJECT* from, CSTR& objPath ) override
418  {
419  return call_<OBJECT*, CSTR&>( &IDataProviderSvc::unlinkObject, from, objPath );
420  }
422  STATUS unlinkObject( CSTR& path ) override { return call_<CSTR&>( &IDataProviderSvc::unlinkObject, path ); }
424  STATUS updateObject( IRegistry* pDirectory ) override
425  {
426  return call_<IRegistry*>( &IDataProviderSvc::updateObject, pDirectory );
427  }
429  STATUS updateObject( CSTR& path ) override { return call_<CSTR&>( &IDataProviderSvc::updateObject, path ); }
431  STATUS updateObject( OBJECT* pObj ) override { return call_<OBJECT*>( &IDataProviderSvc::updateObject, pObj ); }
433  STATUS updateObject( CSTR& parent, CSTR& updatePath ) override
434  {
435  return call_<CSTR&, CSTR&>( &IDataProviderSvc::updateObject, parent, updatePath );
436  }
438  STATUS updateObject( OBJECT* parent, CSTR& updatePath ) override
439  {
440  return call_<OBJECT*, CSTR&>( &IDataProviderSvc::updateObject, parent, updatePath );
441  }
442 
444  STATUS create( CSTR& nam, CSTR& typ ) override
445  {
446  IInterface* pPartition = nullptr;
447  return create( nam, typ, pPartition );
448  }
450  STATUS create( CSTR& nam, CSTR& typ, IInterface*& pPartition ) override
451  {
452  if ( get( nam, pPartition ).isSuccess() ) return PARTITION_EXISTS;
454  auto isvc = serviceLocator()->service<IService>( typ );
455  if ( !isvc ) return NO_INTERFACE;
456  auto dataMgr = isvc.as<IDataManagerSvc>();
457  auto dataProv = isvc.as<IDataProviderSvc>();
458  if ( !dataMgr || !dataProv ) return NO_INTERFACE;
459  m_partitions.emplace( nam, Partition{dataProv, dataMgr, nam} );
460  return STATUS::SUCCESS;
461  }
462 
464  STATUS drop( CSTR& nam ) override
465  {
466  auto i = m_partitions.find( nam );
467  if ( i == m_partitions.end() ) return PARTITION_NOT_PRESENT;
468  if ( i->second.dataManager == m_current.dataManager ) {
469  m_current = Partition();
470  }
471  i->second.dataManager->clearStore().ignore();
472  m_partitions.erase( i );
473  return STATUS::SUCCESS;
474  }
475 
477  STATUS drop( IInterface* pPartition ) override
478  {
479  auto provider = SmartIF<IDataProviderSvc>( pPartition );
480  if ( !provider ) return NO_INTERFACE;
481  auto i = std::find_if( std::begin( m_partitions ), std::end( m_partitions ),
482  [&]( Partitions::const_reference p ) { return p.second.dataProvider == provider; } );
483  if ( i == std::end( m_partitions ) ) return PARTITION_NOT_PRESENT;
484  i->second.dataManager->clearStore().ignore();
485  m_partitions.erase( i );
486  return STATUS::SUCCESS;
487  }
488 
490  STATUS activate( CSTR& nam ) override
491  {
492  auto i = m_partitions.find( nam );
493  if ( i != m_partitions.end() ) {
494  m_current = i->second;
495  return STATUS::SUCCESS;
496  }
497  m_current = Partition();
498  return PARTITION_NOT_PRESENT;
499  }
500 
502  STATUS activate( IInterface* pPartition ) override
503  {
504  auto provider = SmartIF<IDataProviderSvc>( pPartition );
505  m_current = Partition();
506  if ( !provider ) return NO_INTERFACE;
507  auto i = std::find_if( std::begin( m_partitions ), std::end( m_partitions ),
508  [&]( Partitions::const_reference p ) { return p.second.dataProvider == provider; } );
509  if ( i == std::end( m_partitions ) ) return PARTITION_NOT_PRESENT;
510  m_current = i->second;
511  return STATUS::SUCCESS;
512  }
513 
515  STATUS get( CSTR& nam, IInterface*& pPartition ) const override
516  {
517  auto i = m_partitions.find( nam );
518  if ( i != m_partitions.end() ) {
519  pPartition = i->second.dataProvider;
520  return STATUS::SUCCESS;
521  }
522  pPartition = nullptr;
523  return PARTITION_NOT_PRESENT;
524  }
525 
527  StatusCode activePartition( std::string& nam, IInterface*& pPartition ) const override
528  {
529  if ( m_current.dataProvider ) {
530  nam = m_current.name;
531  pPartition = m_current.dataProvider;
532  return STATUS::SUCCESS;
533  }
534  nam.clear();
535  pPartition = nullptr;
536  return NO_ACTIVE_PARTITION;
537  }
538 
540  {
541  // Attach address creator facility
542  m_addrCreator = service( m_loader, true );
543  if ( !m_addrCreator ) {
544  error() << "Failed to retrieve data loader "
545  << "\"" << m_loader << "\"" << endmsg;
546  return StatusCode::FAILURE;
547  }
548  // Attach data loader facility
549  auto dataLoader = service<IConversionSvc>( m_loader, true );
550  if ( !dataLoader ) {
551  error() << "Failed to retrieve data loader "
552  << "\"" << m_loader << "\"" << endmsg;
553  return StatusCode::FAILURE;
554  }
555  auto sc = setDataLoader( dataLoader.get() );
556  if ( !sc.isSuccess() ) {
557  error() << "Failed to set data loader "
558  << "\"" << m_loader << "\"" << endmsg;
559  }
560  return sc;
561  }
562 
564  {
565  m_addrCreator.reset();
566  m_dataLoader.reset();
567  return STATUS::SUCCESS;
568  }
569 
571  STATUS initialize() override
572  {
573  // Nothing to do: just call base class initialisation
575  if ( !sc.isSuccess() ) return sc;
576  sc = makePartitions();
577  if ( !sc.isSuccess() ) {
578  error() << "Failed to connect to all store partitions." << endmsg;
579  return sc;
580  }
581  return attachServices();
582  }
583 
585  STATUS reinitialize() override
586  {
588  if ( !sc.isSuccess() ) {
589  error() << "Enable to reinitialize base class" << endmsg;
590  return sc;
591  }
592  detachServices();
593  sc = attachServices();
594  if ( !sc.isSuccess() ) {
595  error() << "Failed to attach necessary services." << endmsg;
596  return sc;
597  }
598  sc = makePartitions();
599  if ( !sc.isSuccess() ) {
600  error() << "Failed to connect to store partitions." << endmsg;
601  return sc;
602  }
603  // return
604  return STATUS::SUCCESS;
605  }
606 
608  STATUS finalize() override
609  {
610  setDataLoader( nullptr ).ignore();
611  clearStore().ignore();
612  clearPartitions().ignore();
613  m_current = Partition();
614  detachServices();
615  return Service::finalize();
616  }
617 
618  // protected:
619 
621  using extends::extends;
622 
624  ~MultiStoreSvc() override
625  {
626  setDataLoader( nullptr ).ignore();
627  resetPreLoad().ignore();
628  clearStore().ignore();
629  clearPartitions().ignore();
630  }
631 
634  {
635  STATUS iret = STATUS::SUCCESS;
636  for ( auto& i : m_partitions ) {
637  STATUS sc = STATUS::FAILURE;
638  switch ( m_root.type ) {
639  case address_type:
640  if ( m_root.root.address ) {
641  ADDRESS* pAdd = nullptr;
642  ADDRESS* p = m_root.root.address;
643  sc = m_addrCreator->createAddress( p->svcType(), p->clID(), p->par(), p->ipar(), pAdd );
644  if ( sc.isSuccess() ) {
645  sc = i.second.dataManager->setRoot( m_root.path, pAdd );
646  }
647  }
648  break;
649  case object_type:
650  if ( m_root.root.object ) {
651  if ( m_root.root.object->clID() == CLID_DataObject ) {
652  sc = i.second.dataManager->setRoot( m_root.path, new DataObject() );
653  }
654  }
655  break;
656  default:
657  sc = STATUS::FAILURE;
658  break;
659  }
660  if ( !sc.isSuccess() ) iret = sc;
661  }
662  return iret;
663  }
664 
667  {
668  for ( auto& i : m_partitions ) i.second.dataManager->clearStore().ignore();
669  m_partitions.clear();
670  return STATUS::SUCCESS;
671  }
672 
675  {
676  using Parser = Gaudi::Utils::AttribStringParser;
677  std::string typ, nam;
678  clearPartitions().ignore();
679  for ( auto part : m_partitionDefs ) {
680  for ( auto attrib : Parser( std::move( part ) ) ) {
681  switch (::toupper( attrib.tag[0] ) ) {
682  case 'N':
683  nam = std::move( attrib.value );
684  break;
685  case 'T':
686  typ = std::move( attrib.value );
687  break;
688  }
689  }
690  STATUS sc = create( nam, typ );
691  if ( !sc.isSuccess() ) return sc;
692  if ( m_defaultPartition.empty() ) m_defaultPartition = nam;
693  }
694  return STATUS::SUCCESS;
695  }
696 };
697 
698 // Instantiation of a static factory class used by clients to create
699 // instances of this service
virtual StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent)=0
IDataManagerSvc: Explore the object store: retrieve the object&#39;s parent.
Parse attribute strings allowing iteration over the various attributes.
STATUS objectLeaves(const IRegistry *pObject, std::vector< IRegistry * > &leaves) override
Explore the object store: retrieve all leaves attached to the object.
StatusCode initialize() override
Definition: Service.cpp:64
STATUS clearSubTree(CSTR &path) override
Remove all data objects below the sub tree identified.
STATUS unregisterObject(CSTR &path) override
Unregister object from the data store.
STATUS removePreLoadItem(CSTR &item) override
Add an item to the preload list.
STATUS preLoad() override
load all preload items of the list
Partitions m_partitions
Datastore partitions.
virtual const CLID & clID() const =0
Retrieve class information from link.
STATUS unlinkObject(CSTR &path) override
Remove a link to another object.
STATUS finalize() override
Service initialisation.
STATUS registerAddress(CSTR &path, ADDRESS *pAddr) override
IDataManagerSvc: Register object address with the data store.
StatusCode finalize() override
Definition: Service.cpp:174
Implementation of property with value of concrete type.
Definition: Property.h:319
virtual StatusCode addPreLoadItem(const DataStoreItem &item)=0
Add an item to the preload list.
const std::string & rootName() const override
Name for root Event.
CLID rootCLID() const override
IDataManagerSvc: Accessor for root event CLID.
STATUS updateObject(OBJECT *pObj) override
Update object.
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 StatusCode clearSubTree(const std::string &sub_path)=0
Remove all data objects below the sub tree identified by its full path name.
Invalid root path object cannot be retrieved or stored.
STATUS objectParent(const OBJECT *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object&#39;s parent.
STATUS findObject(OBJECT *parent, int item, OBJECT *&pObject) override
Find object in the data store.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
STATUS detachServices()
virtual StatusCode setDataProvider(IDataProviderSvc *pService)=0
Set Data provider service.
virtual StatusCode preLoad()=0
Load all preload items of the list.
StatusCode STATUS
STATUS registerObject(CSTR &parent, CSTR &obj, OBJECT *pObj) override
Register object with the data store.
virtual StatusCode resetPreLoad()=0
Clear the preload list.
STATUS unregisterAddress(OBJECT *pParent, CSTR &path) override
IDataManagerSvc: Unregister object address from the data store.
STATUS unregisterObject(CSTR &parent, CSTR &obj) override
Unregister object from the data store.
STATUS unlinkObject(OBJECT *from, CSTR &objPath) override
Remove a link to another object.
T end(T...args)
STATUS create(CSTR &nam, CSTR &typ, IInterface *&pPartition) override
Create a partition object. The name identifies the partition uniquely.
Data service base class.
virtual StatusCode unregisterAddress(const std::string &fullPath)=0
Unregister object address from the data store.
STATUS findObject(CSTR &parent, int item, OBJECT *&pObject) override
Find object in the data store.
STATUS reinitialize() override
Service initialisation.
Data provider interface definition.
STATUS removePreLoadItem(const DataStoreItem &item) override
Remove an item from the preload list.
virtual const std::string * par() const =0
Retrieve String parameters.
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
STATUS linkObject(OBJECT *from, CSTR &objPath, OBJECT *to) override
Add a link to another object.
SmartIF< IConversionSvc > m_dataLoader
Pointer to data loader service.
STATUS traverseSubTree(CSTR &path, AGENT *pAgent) override
Analyze by traversing all data objects below the sub tree.
#define DECLARE_COMPONENT(type)
Definition: PluginService.h:33
STATUS create(CSTR &nam, CSTR &typ) override
Create a partition object. The name identifies the partition uniquely.
STATUS linkObject(CSTR &from, CSTR &objPath, OBJECT *to) override
Add a link to another object.
STATUS setDataLoader(IConversionSvc *pDataLoader, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: Pass a default data loader to the service.
STL class.
STATUS updateObject(CSTR &parent, CSTR &updatePath) override
Update object.
std::vector< std::string > PartitionDefs
virtual StatusCode removePreLoadItem(const DataStoreItem &item)=0
Remove an item from the preload list.
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:82
STATUS updateObject(OBJECT *parent, CSTR &updatePath) override
Update object.
STATUS makePartitions()
Create all partitions according to job options.
STATUS retrieveObject(CSTR &path, OBJECT *&pObj) override
Retrieve object identified by its full path from the data store.
STATUS unlinkObject(IRegistry *from, CSTR &objPath) override
Remove a link to another object.
STATUS unregisterAddress(IRegistry *pParent, CSTR &path) override
IDataManagerSvc: Unregister object address from the data store.
virtual StatusCode findObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)=0
Find object identified by its directory entry.
STATUS setRoot(std::string path, OBJECT *pObj) override
Initialize data store for new event by giving new event path and root object.
virtual const unsigned long * ipar() const =0
Access to generic link parameters.
virtual StatusCode traverseTree(IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects in the data store.
STATUS addPreLoadItem(const DataStoreItem &item) override
Add an item to the preload list.
STATUS findObject(IRegistry *parent, CSTR &path, OBJECT *&pObj) override
Find object identified by its full path in the data store.
virtual StatusCode unregisterObject(const std::string &fullPath)=0
Unregister object from the data store.
STATUS retrieveObject(IRegistry *parent, CSTR &path, OBJECT *&pObj) override
Retrieve object from data store.
virtual StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *toObj)=0
Add a link to another object.
General service interface definition.
Definition: IService.h:18
STATUS clearSubTree(OBJECT *pObject) override
Remove all data objects below the sub tree identified.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
virtual StatusCode updateObject(IRegistry *pDirectory)=0
Update object identified by its directory entry.
STATUS activate(CSTR &nam) override
Activate a partition object. The name identifies the partition uniquely.
Definition of the basic interface.
Definition: IInterface.h:277
T erase(T...args)
STATUS registerObject(CSTR &path, OBJECT *pObj) override
Register object with the data store.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
const std::string CSTR
STATUS findObject(CSTR &parent, CSTR &path, OBJECT *&pObj) override
Find object in the data store.
DataObject OBJECT
virtual long svcType() const =0
Retrieve service type.
StatusCode reinitialize() override
Definition: Service.cpp:250
STATUS retrieveObject(CSTR &parent, int item, OBJECT *&pObj) override
Retrieve object from data store.
STATUS unregisterObject(OBJECT *pObj, CSTR &path) override
Unregister object from the data store.
STATUS linkObject(CSTR &fullPath, OBJECT *to) override
Add a link to another object.
STATUS clearPartitions()
Clear all partitions.
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
T clear(T...args)
STATUS call_(STATUS(IDataProviderSvc::*pmf)(Args...), UArgs &&...args)
T move(T...args)
Partition m_current
Current partition.
STATUS unregisterAddress(CSTR &path) override
IDataManagerSvc: Unregister object address from the data store.
STATUS retrieveObject(OBJECT *parent, CSTR &path, OBJECT *&pObj) override
Retrieve object from data store.
STATUS preparePartitions()
Prepare partition for usage.
STATUS objectLeaves(const OBJECT *pObject, std::vector< IRegistry * > &leaves) override
Explore the object store: retrieve all leaves attached to the object.
STATUS unregisterObject(OBJECT *pObj) override
Unregister object from the data store.
STATUS setRoot(std::string path, ADDRESS *pAddr) override
Initialize data store for new event by giving new event path and address of root object.
virtual StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &refLeaves)=0
Explore the object store: retrieve all leaves attached to the object The object is identified by its ...
STATUS resetPreLoad() override
Clear the preload list.
T find(T...args)
STATUS unregisterObject(OBJECT *pObj, int item) override
Unregister object from the data store.
STATUS initialize() override
Service initialisation.
Generic data agent interface.
STATUS drop(CSTR &nam) override
Drop a partition object. The name identifies the partition uniquely.
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
T begin(T...args)
virtual StatusCode unlinkObject(IRegistry *from, const std::string &objPath)=0
Remove a link to another object.
STATUS activate(IInterface *pPartition) override
Activate a partition object.
STATUS addPreLoadItem(CSTR &item) override
Add an item to the preload list.
SmartIF< IAddressCreator > m_addrCreator
Reference to address creator.
STATUS registerObject(OBJECT *parent, CSTR &obj, OBJECT *pObj) override
Register object with the data store.
StatusCode activePartition(std::string &nam, IInterface *&pPartition) const override
Access the active partition object.
T emplace(T...args)
STATUS retrieveObject(OBJECT *parent, int item, OBJECT *&pObj) override
Retrieve object from data store.
STATUS findObject(CSTR &path, OBJECT *&pObj) override
Find object identified by its full path in the data store.
STATUS retrieveObject(CSTR &parent, CSTR &path, OBJECT *&pObj) override
Retrieve object from data store.
STATUS linkObject(IRegistry *from, CSTR &objPath, OBJECT *to) override
Add a link to another object.
STATUS updateObject(CSTR &path) override
Update object.
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:92
virtual StatusCode registerAddress(const std::string &fullPath, IOpaqueAddress *pAddress)=0
Register object address with the data store.
Opaque address interface definition.
STATUS unregisterObject(CSTR &parent, int obj) override
Unregister object from the data store.
void ignore() const
Definition: StatusCode.h:109
IOpaqueAddress ADDRESS
virtual StatusCode registerObject(const std::string &fullPath, DataObject *pObject)=0
Register object with the data store.
STATUS traverseSubTree(OBJECT *pObject, AGENT *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects below the sub tree.
virtual StatusCode traverseSubTree(const std::string &sub_path, IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects below the sub tree identified by its full path name...
STATUS call_(STATUS(IDataManagerSvc::*pmf)(Args...), UArgs &&...args)
std::map< std::string, Partition > Partitions
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
STATUS clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
STATUS registerObject(CSTR &parent, int item, OBJECT *pObj) override
Register object with the data store.
STATUS registerAddress(OBJECT *parent, CSTR &path, ADDRESS *pAddr) override
IDataManagerSvc: Register object address with the data store.
STATUS registerAddress(IRegistry *parent, CSTR &path, ADDRESS *pAdd) override
IDataManagerSvc: Register object address with the data store.
STATUS updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
STATUS unlinkObject(CSTR &from, CSTR &objPath) override
Remove a link to another object.
STATUS findObject(OBJECT *parent, CSTR &path, OBJECT *&pObject) override
Find object in the data store.
void toupper(std::string &s)
STATUS drop(IInterface *pPartition) override
Drop a partition object. The name identifies the partition uniquely.
STATUS traverseTree(AGENT *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects in the data store.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
IDataStoreAgent AGENT
STATUS objectParent(const IRegistry *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object&#39;s parent.
STATUS attachServices()
STATUS registerObject(OBJECT *parent, int obj, OBJECT *pObj) override
Register object with the data store.
~MultiStoreSvc() override
Standard Destructor.
virtual unsigned long addRef()=0
Add reference to object.
virtual StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.