The Gaudi Framework  master (37c0b60a)
MultiStoreSvc.cpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 //====================================================================
12 // MultiStoreSvc.cpp
13 //--------------------------------------------------------------------
14 //
15 // Package : System ( The LHCb Offline System)
16 //
17 // Description: implementation of the Transient event data service.
18 //
19 // Author : M.Frank
20 // History :
21 // +---------+----------------------------------------------+---------
22 // | Date | Comment | Who
23 // +---------+----------------------------------------------+---------
24 // | 29/10/98| Initial version | MF
25 // +---------+----------------------------------------------+---------
26 //
27 //====================================================================
28 #define DATASVC_MULTISTORESVC_CPP
29 
30 // Include files
32 #include <GaudiKernel/DataObject.h>
41 #include <GaudiKernel/MsgStream.h>
42 #include <GaudiKernel/Service.h>
43 #include <GaudiKernel/SmartIF.h>
45 #include <GaudiKernel/compose.h>
46 #include <map>
47 #include <variant>
48 
49 // Forward declarations
50 // This class
51 class MultiStoreSvc;
52 
53 typedef const std::string CSTR;
57 
58 namespace {
59  struct Partition final {
60  SmartIF<IDataProviderSvc> dataProvider;
61  SmartIF<IDataManagerSvc> dataManager;
63 
64  template <typename T>
65  T* get();
66  };
67  template <>
68  IDataProviderSvc* Partition::get<IDataProviderSvc>() {
69  return dataProvider.get();
70  }
71  template <>
72  IDataManagerSvc* Partition::get<IDataManagerSvc>() {
73  return dataManager.get();
74  }
75 
76  namespace detail {
77  template <typename lambda>
78  struct arg_helper : public arg_helper<decltype( &lambda::operator() )> {};
79  template <typename T, typename Ret, typename Arg>
80  struct arg_helper<Ret ( T::* )( Arg ) const> {
81  using type = Arg;
82  };
83 
84  // given a unary lambda whose argument is of type Arg_t,
85  // argument_t<lambda> will be equal to Arg_t
86  template <typename lambda>
87  using argument_t = typename arg_helper<lambda>::type;
88  } // namespace detail
89  auto visit = []( auto&& variant, auto&&... lambdas ) -> decltype( auto ) {
90  return std::visit( Gaudi::overload( std::forward<decltype( lambdas )>( lambdas )... ),
91  std::forward<decltype( variant )>( variant ) );
92  };
93 } // namespace
94 
106 class MultiStoreSvc : public extends<Service, IDataProviderSvc, IDataManagerSvc, IPartitionControl> {
107 protected:
110 
111  Gaudi::Property<CLID> m_rootCLID{ this, "RootCLID", 110, "CLID of root entry" };
112  Gaudi::Property<std::string> m_rootName{ this, "RootName", "/Event", "name of root entry" };
113  Gaudi::Property<PartitionDefs> m_partitionDefs{ this, "Partitions", {}, "datastore partition definitions" };
114  Gaudi::Property<std::string> m_loader{ this, "DataLoader", "EventPersistencySvc", "data loader name" };
115  Gaudi::Property<std::string> m_defaultPartition{ this, "DefaultPartition", "Default", "default partition name" };
116 
122  struct tagROOT {
124  std::variant<std::monostate, ADDRESS*, OBJECT*> root;
127  Partition m_current;
130 
131  // member templates to help writing the function calls
132  template <typename Fun>
133  StatusCode fwd( Fun f ) {
134  auto* svc = m_current.get<std::decay_t<detail::argument_t<Fun>>>();
135  return svc ? f( *svc ) : IDataProviderSvc::Status::INVALID_ROOT;
136  }
137 
138 public:
140  CLID rootCLID() const override { return m_rootCLID; }
142  const std::string& rootName() const override { return m_rootName; }
143 
145  StatusCode registerAddress( std::string_view path, ADDRESS* pAddr ) override {
146  return fwd( [&]( IDataManagerSvc& svc ) { return svc.registerAddress( path, pAddr ); } );
147  }
149  StatusCode registerAddress( IRegistry* parent, std::string_view path, ADDRESS* pAddr ) override {
150  return fwd( [&]( IDataManagerSvc& svc ) { return svc.registerAddress( parent, path, pAddr ); } );
151  }
153  StatusCode unregisterAddress( std::string_view path ) override {
154  return fwd( [&]( IDataManagerSvc& svc ) { return svc.unregisterAddress( path ); } );
155  }
157  StatusCode unregisterAddress( IRegistry* pParent, std::string_view path ) override {
158  return fwd( [&]( IDataManagerSvc& svc ) { return svc.unregisterAddress( pParent, path ); } );
159  }
161  StatusCode objectLeaves( const OBJECT* pObject, std::vector<IRegistry*>& leaves ) override {
162  return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectLeaves( pObject, leaves ); } );
163  }
165  StatusCode objectLeaves( const IRegistry* pObject, std::vector<IRegistry*>& leaves ) override {
166  return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectLeaves( pObject, leaves ); } );
167  }
169  StatusCode objectParent( const OBJECT* pObject, IRegistry*& refpParent ) override {
170  return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectParent( pObject, refpParent ); } );
171  }
173  StatusCode objectParent( const IRegistry* pObject, IRegistry*& refpParent ) override {
174  return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectParent( pObject, refpParent ); } );
175  }
177  StatusCode clearSubTree( std::string_view path ) override {
178  return fwd( [&]( IDataManagerSvc& svc ) { return svc.clearSubTree( path ); } );
179  }
181  StatusCode clearSubTree( OBJECT* pObject ) override {
182  return fwd( [&]( IDataManagerSvc& svc ) { return svc.clearSubTree( pObject ); } );
183  }
185  StatusCode clearStore() override {
186  for ( auto& i : m_partitions ) { i.second.dataManager->clearStore().ignore(); }
187  visit(
188  m_root.root,
189  []( auto* p ) {
190  if ( p ) p->release();
191  },
192  []( std::monostate ) {} );
193  m_root.root = {};
194  m_root.path.clear();
195  return StatusCode::SUCCESS;
196  }
198  StatusCode traverseSubTree( std::string_view path, AGENT* pAgent ) override {
199  return fwd( [&]( IDataManagerSvc& svc ) { return svc.traverseSubTree( path, pAgent ); } );
200  }
202  StatusCode traverseSubTree( OBJECT* pObject, AGENT* pAgent ) override {
203  return fwd( [&]( IDataManagerSvc& svc ) { return svc.traverseSubTree( pObject, pAgent ); } );
204  }
206  StatusCode traverseTree( AGENT* pAgent ) override {
207  return fwd( [&]( IDataManagerSvc& svc ) { return svc.traverseTree( pAgent ); } );
208  }
211  StatusCode setRoot( std::string path, OBJECT* pObj ) override {
212  visit(
213  m_root.root,
214  []( auto* p ) {
215  if ( p ) p->release();
216  },
217  []( std::monostate ) {} );
218  m_root.path = std::move( path );
219  m_root.root = pObj;
220  if ( auto sc = preparePartitions(); !sc ) return sc;
221  return activate( m_defaultPartition );
222  }
223 
226  StatusCode setRoot( std::string path, ADDRESS* pAddr ) override {
227  visit(
228  m_root.root,
229  []( auto* p ) {
230  if ( p ) p->release();
231  },
232  []( std::monostate ) {} );
233  m_root.path = std::move( path );
234  m_root.root = pAddr;
235  if ( !pAddr ) return StatusCode::FAILURE;
236  pAddr->addRef();
237  if ( auto sc = preparePartitions(); !sc ) return sc;
238  return activate( m_defaultPartition );
239  }
241  StatusCode setDataLoader( IConversionSvc* pDataLoader, IDataProviderSvc* dpsvc = nullptr ) override {
242  m_dataLoader = pDataLoader;
243  if ( m_dataLoader )
244  if ( auto sc = m_dataLoader->setDataProvider( dpsvc ? dpsvc : this ); !sc ) return sc;
245  for ( auto& i : m_partitions ) {
246  if ( auto sc = i.second.dataManager->setDataLoader( m_dataLoader.get() ); !sc ) return sc;
247  }
248  return StatusCode::SUCCESS;
249  }
251  StatusCode addPreLoadItem( const DataStoreItem& item ) override {
252  return fwd( [&]( IDataProviderSvc& svc ) { return svc.addPreLoadItem( item ); } );
253  }
255  StatusCode removePreLoadItem( const DataStoreItem& item ) override {
256  return fwd( [&]( IDataProviderSvc& svc ) { return svc.removePreLoadItem( item ); } );
257  }
260  return fwd( [&]( IDataProviderSvc& svc ) { return svc.resetPreLoad(); } );
261  }
263  StatusCode preLoad() override {
264  return fwd( [&]( IDataProviderSvc& svc ) { return svc.preLoad(); } );
265  }
267  StatusCode registerObject( std::string_view parent, std::string_view obj, OBJECT* pObj ) override {
268  return fwd( [&]( IDataProviderSvc& svc ) { return svc.registerObject( parent, obj, pObj ); } );
269  }
271  StatusCode registerObject( OBJECT* parent, std::string_view obj, OBJECT* pObj ) override {
272  return fwd( [&]( IDataProviderSvc& svc ) { return svc.registerObject( parent, obj, pObj ); } );
273  }
275  StatusCode unregisterObject( std::string_view path ) override {
276  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unregisterObject( path ); } );
277  }
279  StatusCode unregisterObject( OBJECT* pObj ) override {
280  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unregisterObject( pObj ); } );
281  }
283  StatusCode unregisterObject( OBJECT* pObj, std::string_view path ) override {
284  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unregisterObject( pObj, path ); } );
285  }
287  StatusCode retrieveObject( IRegistry* parent, std::string_view path, OBJECT*& pObj ) override {
288  return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( parent, path, pObj ); } );
289  }
291  StatusCode findObject( std::string_view path, OBJECT*& pObj ) override {
292  return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( path, pObj ); } );
293  }
295  StatusCode findObject( IRegistry* parent, std::string_view path, OBJECT*& pObj ) override {
296  return fwd( [&]( IDataProviderSvc& svc ) { return svc.findObject( parent, path, pObj ); } );
297  }
299  StatusCode linkObject( IRegistry* from, std::string_view objPath, OBJECT* to ) override {
300  return fwd( [&]( IDataProviderSvc& svc ) { return svc.linkObject( from, objPath, to ); } );
301  }
303  StatusCode linkObject( std::string_view fullPath, OBJECT* to ) override {
304  return fwd( [&]( IDataProviderSvc& svc ) { return svc.linkObject( fullPath, to ); } );
305  }
307  StatusCode unlinkObject( IRegistry* from, std::string_view objPath ) override {
308  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unlinkObject( from, objPath ); } );
309  }
311  StatusCode unlinkObject( OBJECT* from, std::string_view objPath ) override {
312  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unlinkObject( from, objPath ); } );
313  }
315  StatusCode unlinkObject( std::string_view path ) override {
316  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unlinkObject( path ); } );
317  }
319  StatusCode updateObject( IRegistry* pDirectory ) override {
320  return fwd( [&]( IDataProviderSvc& svc ) { return svc.updateObject( pDirectory ); } );
321  }
323  StatusCode updateObject( OBJECT* pObj ) override {
324  return fwd( [&]( IDataProviderSvc& svc ) { return svc.updateObject( pObj ); } );
325  }
327  StatusCode create( CSTR& nam, CSTR& typ ) override {
328  IInterface* pPartition = nullptr;
329  return create( nam, typ, pPartition );
330  }
332  StatusCode create( CSTR& nam, CSTR& typ, IInterface*& pPartition ) override {
333  if ( get( nam, pPartition ).isSuccess() ) return IPartitionControl::Status::PARTITION_EXISTS;
335  auto isvc = serviceLocator()->service<IService>( typ );
336  if ( !isvc ) return IInterface::Status::NO_INTERFACE;
337  auto dataMgr = isvc.as<IDataManagerSvc>();
338  auto dataProv = isvc.as<IDataProviderSvc>();
339  if ( !dataMgr || !dataProv ) return IInterface::Status::NO_INTERFACE;
340  m_partitions.emplace( nam, Partition{ dataProv, dataMgr, nam } );
341  return StatusCode::SUCCESS;
342  }
343 
345  StatusCode drop( CSTR& nam ) override {
346  auto i = m_partitions.find( nam );
348  if ( i->second.dataManager == m_current.dataManager ) { m_current = Partition(); }
349  i->second.dataManager->clearStore().ignore();
350  m_partitions.erase( i );
351  return StatusCode::SUCCESS;
352  }
353 
355  StatusCode drop( IInterface* pPartition ) override {
356  auto provider = SmartIF<IDataProviderSvc>( pPartition );
357  if ( !provider ) return IInterface::Status::NO_INTERFACE;
359  [&]( Partitions::const_reference p ) { return p.second.dataProvider == provider; } );
361  i->second.dataManager->clearStore().ignore();
362  m_partitions.erase( i );
363  return StatusCode::SUCCESS;
364  }
365 
367  StatusCode activate( CSTR& nam ) override {
368  auto i = m_partitions.find( nam );
369  if ( i != m_partitions.end() ) {
370  m_current = i->second;
371  return StatusCode::SUCCESS;
372  }
373  m_current = {};
375  }
376 
378  StatusCode activate( IInterface* pPartition ) override {
379  auto provider = SmartIF<IDataProviderSvc>( pPartition );
380  m_current = Partition();
381  if ( !provider ) return IInterface::Status::NO_INTERFACE;
383  [&]( Partitions::const_reference p ) { return p.second.dataProvider == provider; } );
385  m_current = i->second;
386  return StatusCode::SUCCESS;
387  }
388 
390  StatusCode get( CSTR& nam, IInterface*& pPartition ) const override {
391  auto i = m_partitions.find( nam );
392  if ( i != m_partitions.end() ) {
393  pPartition = i->second.dataProvider;
394  return StatusCode::SUCCESS;
395  }
396  pPartition = nullptr;
398  }
399 
401  StatusCode activePartition( std::string& nam, IInterface*& pPartition ) const override {
402  if ( m_current.dataProvider ) {
403  nam = m_current.name;
404  pPartition = m_current.dataProvider;
405  return StatusCode::SUCCESS;
406  }
407  nam.clear();
408  pPartition = nullptr;
410  }
411 
413  // Attach address creator facility
414  m_addrCreator = service( m_loader, true );
415  if ( !m_addrCreator ) {
416  error() << "Failed to retrieve data loader "
417  << "\"" << m_loader << "\"" << endmsg;
418  return StatusCode::FAILURE;
419  }
420  // Attach data loader facility
421  auto dataLoader = service<IConversionSvc>( m_loader, true );
422  if ( !dataLoader ) {
423  error() << "Failed to retrieve data loader "
424  << "\"" << m_loader << "\"" << endmsg;
425  return StatusCode::FAILURE;
426  }
427  auto sc = setDataLoader( dataLoader.get() );
428  if ( !sc.isSuccess() ) {
429  error() << "Failed to set data loader "
430  << "\"" << m_loader << "\"" << endmsg;
431  }
432  return sc;
433  }
434 
438  return StatusCode::SUCCESS;
439  }
440 
442  StatusCode initialize() override {
443  // Nothing to do: just call base class initialisation
445  if ( !sc.isSuccess() ) return sc;
446  sc = makePartitions();
447  if ( !sc.isSuccess() ) {
448  error() << "Failed to connect to all store partitions." << endmsg;
449  return sc;
450  }
451  return attachServices();
452  }
453 
457  if ( !sc.isSuccess() ) {
458  error() << "Enable to reinitialize base class" << endmsg;
459  return sc;
460  }
461  sc = detachServices();
462  if ( !sc.isSuccess() ) {
463  error() << "Failed to detach necessary services." << endmsg;
464  return sc;
465  }
466  sc = attachServices();
467  if ( !sc.isSuccess() ) {
468  error() << "Failed to attach necessary services." << endmsg;
469  return sc;
470  }
471  sc = makePartitions();
472  if ( !sc.isSuccess() ) {
473  error() << "Failed to connect to store partitions." << endmsg;
474  return sc;
475  }
476  // return
477  return StatusCode::SUCCESS;
478  }
479 
481  StatusCode finalize() override {
482  setDataLoader( nullptr ).ignore();
483  clearStore().ignore();
485  m_current = Partition();
487  return Service::finalize();
488  }
489 
490  // protected:
491 
493  using extends::extends;
494 
496  ~MultiStoreSvc() override {
497  setDataLoader( nullptr ).ignore();
498  resetPreLoad().ignore();
499  clearStore().ignore();
501  }
502 
506  for ( auto& i : m_partitions ) {
507  StatusCode sc = visit(
508  m_root.root,
509  [&]( ADDRESS* address ) -> StatusCode {
510  if ( !address ) return StatusCode::FAILURE;
511  ADDRESS* pAdd = nullptr;
512  ADDRESS* p = address;
513  auto sc = m_addrCreator->createAddress( p->svcType(), p->clID(), p->par(), p->ipar(), pAdd );
514  return sc.isSuccess() ? i.second.dataManager->setRoot( m_root.path, pAdd ) : sc;
515  },
516  [&]( OBJECT* object ) -> StatusCode {
517  if ( object && object->clID() == CLID_DataObject ) {
518  return i.second.dataManager->setRoot( m_root.path, new DataObject() );
519  }
520  return StatusCode::FAILURE;
521  },
522  []( std::monostate ) -> StatusCode { return StatusCode::FAILURE; } );
523  if ( !sc.isSuccess() ) iret = sc;
524  }
525  return iret;
526  }
527 
530  for ( auto& i : m_partitions ) i.second.dataManager->clearStore().ignore();
531  m_partitions.clear();
532  return StatusCode::SUCCESS;
533  }
534 
537  using Parser = Gaudi::Utils::AttribStringParser;
538  std::string typ, nam;
539  clearPartitions().ignore();
540  for ( auto part : m_partitionDefs ) {
541  for ( auto attrib : Parser( std::move( part ) ) ) {
542  switch ( ::toupper( attrib.tag[0] ) ) {
543  case 'N':
544  nam = std::move( attrib.value );
545  break;
546  case 'T':
547  typ = std::move( attrib.value );
548  break;
549  }
550  }
551  StatusCode sc = create( nam, typ );
552  if ( !sc.isSuccess() ) return sc;
553  if ( m_defaultPartition.empty() ) m_defaultPartition = nam;
554  }
555  return StatusCode::SUCCESS;
556  }
557 };
558 
559 // Instantiation of a static factory class used by clients to create
560 // instances of this service
MultiStoreSvc::m_addrCreator
SmartIF< IAddressCreator > m_addrCreator
Reference to address creator.
Definition: MultiStoreSvc.cpp:120
MultiStoreSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: MultiStoreSvc.cpp:112
IService
Definition: IService.h:28
MultiStoreSvc::traverseSubTree
StatusCode traverseSubTree(std::string_view path, AGENT *pAgent) override
Analyze by traversing all data objects below the sub tree.
Definition: MultiStoreSvc.cpp:198
MultiStoreSvc::drop
StatusCode drop(IInterface *pPartition) override
Drop a partition object. The name identifies the partition uniquely.
Definition: MultiStoreSvc.cpp:355
IDataManagerSvc::objectParent
virtual StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent)=0
IDataManagerSvc: Explore the object store: retrieve the object's parent.
MultiStoreSvc::registerObject
StatusCode registerObject(std::string_view parent, std::string_view obj, OBJECT *pObj) override
Register object with the data store.
Definition: MultiStoreSvc.cpp:267
MultiStoreSvc::activate
StatusCode activate(IInterface *pPartition) override
Activate a partition object.
Definition: MultiStoreSvc.cpp:378
toupper
void toupper(std::string &s)
Definition: ExceptionSvc.cpp:36
MultiStoreSvc::unregisterAddress
StatusCode unregisterAddress(IRegistry *pParent, std::string_view path) override
IDataManagerSvc: Unregister object address from the data store.
Definition: MultiStoreSvc.cpp:157
MultiStoreSvc::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: MultiStoreSvc.cpp:259
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:118
IDataProviderSvc::unregisterObject
virtual StatusCode unregisterObject(std::string_view fullPath)=0
Unregister object from the data store.
std::string
STL class.
IDataProviderSvc::removePreLoadItem
virtual StatusCode removePreLoadItem(const DataStoreItem &item)=0
Remove an item from the preload list.
MultiStoreSvc::unregisterObject
StatusCode unregisterObject(OBJECT *pObj, std::string_view path) override
Unregister object from the data store.
Definition: MultiStoreSvc.cpp:283
IDataProviderSvc::unlinkObject
virtual StatusCode unlinkObject(IRegistry *from, std::string_view objPath)=0
Remove a link to another object.
IDataManagerSvc
Definition: IDataManagerSvc.h:55
std::move
T move(T... args)
MultiStoreSvc::m_dataLoader
SmartIF< IConversionSvc > m_dataLoader
Pointer to data loader service.
Definition: MultiStoreSvc.cpp:118
AtlasMCRecoFullPrecedenceDump.path
path
Definition: AtlasMCRecoFullPrecedenceDump.py:49
MultiStoreSvc::updateObject
StatusCode updateObject(OBJECT *pObj) override
Update object.
Definition: MultiStoreSvc.cpp:323
MultiStoreSvc::tagROOT::root
std::variant< std::monostate, ADDRESS *, OBJECT * > root
Definition: MultiStoreSvc.cpp:124
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:314
IPartitionControl::Status::PARTITION_EXISTS
@ PARTITION_EXISTS
MultiStoreSvc::reinitialize
StatusCode reinitialize() override
Service initialisation.
Definition: MultiStoreSvc.cpp:455
IOpaqueAddress::addRef
virtual unsigned long addRef()=0
Add reference to object.
MultiStoreSvc::PartitionDefs
std::vector< std::string > PartitionDefs
Definition: MultiStoreSvc.cpp:108
MultiStoreSvc::objectParent
StatusCode objectParent(const IRegistry *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object's parent.
Definition: MultiStoreSvc.cpp:173
MultiStoreSvc::setRoot
StatusCode setRoot(std::string path, OBJECT *pObj) override
Initialize data store for new event by giving new event path and root object.
Definition: MultiStoreSvc.cpp:211
MultiStoreSvc::findObject
StatusCode findObject(IRegistry *parent, std::string_view path, OBJECT *&pObj) override
Find object identified by its full path in the data store.
Definition: MultiStoreSvc.cpp:295
IOpaqueAddress
Definition: IOpaqueAddress.h:33
MultiStoreSvc::setDataLoader
StatusCode setDataLoader(IConversionSvc *pDataLoader, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: Pass a default data loader to the service.
Definition: MultiStoreSvc.cpp:241
MultiStoreSvc::initialize
StatusCode initialize() override
Service initialisation.
Definition: MultiStoreSvc.cpp:442
std::vector< std::string >
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:96
std::map::find
T find(T... args)
MultiStoreSvc::clearPartitions
StatusCode clearPartitions()
Clear all partitions.
Definition: MultiStoreSvc.cpp:529
IAddressCreator.h
IDataManagerSvc::objectLeaves
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 ...
MultiStoreSvc::m_partitionDefs
Gaudi::Property< PartitionDefs > m_partitionDefs
Definition: MultiStoreSvc.cpp:113
MultiStoreSvc::finalize
StatusCode finalize() override
Service initialisation.
Definition: MultiStoreSvc.cpp:481
std::map::emplace
T emplace(T... args)
MultiStoreSvc::clearSubTree
StatusCode clearSubTree(OBJECT *pObject) override
Remove all data objects below the sub tree identified.
Definition: MultiStoreSvc.cpp:181
IPartitionControl::Status::PARTITION_NOT_PRESENT
@ PARTITION_NOT_PRESENT
MultiStoreSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: MultiStoreSvc.cpp:319
detail
Definition: HistogramSvc.h:46
MultiStoreSvc::preLoad
StatusCode preLoad() override
load all preload items of the list
Definition: MultiStoreSvc.cpp:263
IRegistry
Definition: IRegistry.h:32
IInterface::Status::NO_INTERFACE
@ NO_INTERFACE
Requested interface is not available.
AGENT
IDataStoreAgent AGENT
Definition: MultiStoreSvc.cpp:54
OBJECT
DataObject OBJECT
Definition: MultiStoreSvc.cpp:55
MultiStoreSvc::findObject
StatusCode findObject(std::string_view path, OBJECT *&pObj) override
Find object identified by its full path in the data store.
Definition: MultiStoreSvc.cpp:291
IDataProviderSvc::resetPreLoad
virtual StatusCode resetPreLoad()=0
Clear the preload list.
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:222
IDataProviderSvc.h
std::string::clear
T clear(T... args)
IDataProviderSvc::addPreLoadItem
virtual StatusCode addPreLoadItem(const DataStoreItem &item)=0
Add an item to the preload list.
MultiStoreSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: MultiStoreSvc.cpp:185
MultiStoreSvc::registerAddress
StatusCode registerAddress(std::string_view path, ADDRESS *pAddr) override
IDataManagerSvc: Register object address with the data store.
Definition: MultiStoreSvc.cpp:145
IDataManagerSvc::traverseSubTree
virtual StatusCode traverseSubTree(std::string_view sub_tree_path, IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects below the sub tree identified by its full path name.
IDataProviderSvc::registerObject
StatusCode registerObject(std::string_view fullPath, DataObject *pObject)
Register object with the data store.
Definition: IDataProviderSvc.h:72
MultiStoreSvc::unlinkObject
StatusCode unlinkObject(std::string_view path) override
Remove a link to another object.
Definition: MultiStoreSvc.cpp:315
IDataProviderSvc::linkObject
virtual StatusCode linkObject(IRegistry *from, std::string_view objPath, DataObject *toObj)=0
Add a link to another object.
MultiStoreSvc::objectParent
StatusCode objectParent(const OBJECT *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object's parent.
Definition: MultiStoreSvc.cpp:169
SmartIF.h
IDataProviderSvc::Status::INVALID_ROOT
@ INVALID_ROOT
Invalid root path object cannot be retrieved or stored.
Service::name
const std::string & name() const override
Retrieve name of the service
Definition: Service.cpp:332
StatusCode
Definition: StatusCode.h:65
MultiStoreSvc::tagROOT::path
std::string path
Definition: MultiStoreSvc.cpp:123
IDataManagerSvc::registerAddress
virtual StatusCode registerAddress(std::string_view fullPath, IOpaqueAddress *pAddress)=0
Register object address with the data store.
std::forward
T forward(T... args)
MultiStoreSvc::activePartition
StatusCode activePartition(std::string &nam, IInterface *&pPartition) const override
Access the active partition object.
Definition: MultiStoreSvc.cpp:401
DataStoreItem
Definition: DataStoreItem.h:27
IDataProviderSvc::retrieveObject
virtual StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
MultiStoreSvc::unlinkObject
StatusCode unlinkObject(OBJECT *from, std::string_view objPath) override
Remove a link to another object.
Definition: MultiStoreSvc.cpp:311
IOpaqueAddress.h
MultiStoreSvc::activate
StatusCode activate(CSTR &nam) override
Activate a partition object. The name identifies the partition uniquely.
Definition: MultiStoreSvc.cpp:367
MultiStoreSvc::unregisterObject
StatusCode unregisterObject(std::string_view path) override
Unregister object from the data store.
Definition: MultiStoreSvc.cpp:275
IDataManagerSvc::unregisterAddress
virtual StatusCode unregisterAddress(std::string_view fullPath)=0
Unregister object address from the data store.
IDataProviderSvc::preLoad
virtual StatusCode preLoad()=0
Load all preload items of the list.
std::map::erase
T erase(T... args)
IDataManagerSvc::traverseTree
virtual StatusCode traverseTree(IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects in the data store.
details::argument_t
typename arg_helper< lambda >::type argument_t
Definition: EventIDBase.h:43
AttribStringParser.h
MultiStoreSvc::Partitions
std::map< std::string, Partition > Partitions
Definition: MultiStoreSvc.cpp:109
MultiStoreSvc::linkObject
StatusCode linkObject(IRegistry *from, std::string_view objPath, OBJECT *to) override
Add a link to another object.
Definition: MultiStoreSvc.cpp:299
SmartIF< IDataProviderSvc >
MultiStoreSvc::makePartitions
StatusCode makePartitions()
Create all partitions according to job options.
Definition: MultiStoreSvc.cpp:536
MultiStoreSvc::addPreLoadItem
StatusCode addPreLoadItem(const DataStoreItem &item) override
Add an item to the preload list.
Definition: MultiStoreSvc.cpp:251
IPartitionControl::Status::NO_ACTIVE_PARTITION
@ NO_ACTIVE_PARTITION
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:18
MultiStoreSvc::registerAddress
StatusCode registerAddress(IRegistry *parent, std::string_view path, ADDRESS *pAddr) override
IDataManagerSvc: Register object address with the data store.
Definition: MultiStoreSvc.cpp:149
compose.h
MultiStoreSvc::retrieveObject
StatusCode retrieveObject(IRegistry *parent, std::string_view path, OBJECT *&pObj) override
Retrieve object from data store.
Definition: MultiStoreSvc.cpp:287
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
std::map< std::string, Partition >
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:20
ADDRESS
IOpaqueAddress ADDRESS
Definition: MultiStoreSvc.cpp:56
TypeNameString.h
MultiStoreSvc::~MultiStoreSvc
~MultiStoreSvc() override
Standard Destructor.
Definition: MultiStoreSvc.cpp:496
MultiStoreSvc::detachServices
StatusCode detachServices()
Definition: MultiStoreSvc.cpp:435
StatusCode::ignore
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Definition: StatusCode.h:139
Service.h
MultiStoreSvc::attachServices
StatusCode attachServices()
Definition: MultiStoreSvc.cpp:412
MultiStoreSvc::removePreLoadItem
StatusCode removePreLoadItem(const DataStoreItem &item) override
Remove an item from the preload list.
Definition: MultiStoreSvc.cpp:255
MultiStoreSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, std::string_view objPath) override
Remove a link to another object.
Definition: MultiStoreSvc.cpp:307
gaudirun.type
type
Definition: gaudirun.py:160
MultiStoreSvc::clearSubTree
StatusCode clearSubTree(std::string_view path) override
Remove all data objects below the sub tree identified.
Definition: MultiStoreSvc.cpp:177
MultiStoreSvc
Definition: MultiStoreSvc.cpp:106
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
DataObject.h
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:86
MultiStoreSvc::traverseTree
StatusCode traverseTree(AGENT *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects in the data store.
Definition: MultiStoreSvc.cpp:206
MultiStoreSvc::m_partitions
Partitions m_partitions
Datastore partitions.
Definition: MultiStoreSvc.cpp:129
std::begin
T begin(T... args)
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginServiceV1.h:46
MultiStoreSvc::create
StatusCode create(CSTR &nam, CSTR &typ) override
Create a partition object. The name identifies the partition uniquely.
Definition: MultiStoreSvc.cpp:327
IInterface
Definition: IInterface.h:239
MultiStoreSvc::m_loader
Gaudi::Property< std::string > m_loader
Definition: MultiStoreSvc.cpp:114
MultiStoreSvc::get
StatusCode get(CSTR &nam, IInterface *&pPartition) const override
Access a partition object. The name identifies the partition uniquely.
Definition: MultiStoreSvc.cpp:390
DataObject
Definition: DataObject.h:36
MultiStoreSvc::unregisterAddress
StatusCode unregisterAddress(std::string_view path) override
IDataManagerSvc: Unregister object address from the data store.
Definition: MultiStoreSvc.cpp:153
Service::reinitialize
StatusCode reinitialize() override
Definition: Service.cpp:295
MultiStoreSvc::objectLeaves
StatusCode objectLeaves(const OBJECT *pObject, std::vector< IRegistry * > &leaves) override
Explore the object store: retrieve all leaves attached to the object.
Definition: MultiStoreSvc.cpp:161
MultiStoreSvc::tagROOT
Root type (address or object)
Definition: MultiStoreSvc.cpp:122
MultiStoreSvc::m_defaultPartition
Gaudi::Property< std::string > m_defaultPartition
Definition: MultiStoreSvc.cpp:115
IDataManagerSvc::clearSubTree
virtual StatusCode clearSubTree(std::string_view sub_path)=0
Remove all data objects below the sub tree identified by its full path name.
MultiStoreSvc::fwd
StatusCode fwd(Fun f)
Definition: MultiStoreSvc.cpp:133
std::map::end
T end(T... args)
MultiStoreSvc::drop
StatusCode drop(CSTR &nam) override
Drop a partition object. The name identifies the partition uniquely.
Definition: MultiStoreSvc.cpp:345
IDataProviderSvc
Definition: IDataProviderSvc.h:53
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
IConversionSvc.h
MultiStoreSvc::rootName
const std::string & rootName() const override
Name for root Event.
Definition: MultiStoreSvc.cpp:142
MultiStoreSvc::rootCLID
CLID rootCLID() const override
IDataManagerSvc: Accessor for root event CLID.
Definition: MultiStoreSvc.cpp:140
ISvcLocator.h
MultiStoreSvc::linkObject
StatusCode linkObject(std::string_view fullPath, OBJECT *to) override
Add a link to another object.
Definition: MultiStoreSvc.cpp:303
MultiStoreSvc::traverseSubTree
StatusCode traverseSubTree(OBJECT *pObject, AGENT *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects below the sub tree.
Definition: MultiStoreSvc.cpp:202
MultiStoreSvc::unregisterObject
StatusCode unregisterObject(OBJECT *pObj) override
Unregister object from the data store.
Definition: MultiStoreSvc.cpp:279
MultiStoreSvc::m_rootCLID
Gaudi::Property< CLID > m_rootCLID
Definition: MultiStoreSvc.cpp:111
MultiStoreSvc::preparePartitions
StatusCode preparePartitions()
Prepare partition for usage.
Definition: MultiStoreSvc.cpp:504
Gaudi::Utils::AttribStringParser
Parse attribute strings allowing iteration over the various attributes.
Definition: AttribStringParser.h:40
MultiStoreSvc::m_current
Partition m_current
Current partition.
Definition: MultiStoreSvc.cpp:127
IPartitionControl.h
MultiStoreSvc::create
StatusCode create(CSTR &nam, CSTR &typ, IInterface *&pPartition) override
Create a partition object. The name identifies the partition uniquely.
Definition: MultiStoreSvc.cpp:332
Service::service
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:89
MultiStoreSvc::objectLeaves
StatusCode objectLeaves(const IRegistry *pObject, std::vector< IRegistry * > &leaves) override
Explore the object store: retrieve all leaves attached to the object.
Definition: MultiStoreSvc.cpp:165
CSTR
const std::string CSTR
Definition: MultiStoreSvc.cpp:51
MultiStoreSvc::registerObject
StatusCode registerObject(OBJECT *parent, std::string_view obj, OBJECT *pObj) override
Register object with the data store.
Definition: MultiStoreSvc.cpp:271
Gaudi::Property< CLID >
IDataManagerSvc.h
IDataProviderSvc::updateObject
virtual StatusCode updateObject(IRegistry *pDirectory)=0
Update object identified by its directory entry.
ISvcManager.h
IDataProviderSvc::findObject
virtual StatusCode findObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Find object identified by its directory entry.
Gaudi::overload
auto overload(lambda_ts &&... lambdas)
Definition: compose.h:38
MsgStream.h
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator
Definition: Service.cpp:335
IDataStoreAgent
Definition: IDataStoreAgent.h:27
MultiStoreSvc::setRoot
StatusCode setRoot(std::string path, ADDRESS *pAddr) override
Initialize data store for new event by giving new event path and address of root object.
Definition: MultiStoreSvc.cpp:226
MultiStoreSvc::m_root
struct MultiStoreSvc::tagROOT m_root
IConversionSvc
Definition: IConversionSvc.h:47