The Gaudi Framework  v33r1 (b1225454)
MultiStoreSvc.cpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 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
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;
125  } m_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
virtual StatusCode traverseTree(IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects in the data store.
StatusCode detachServices()
Parse attribute strings allowing iteration over the various attributes.
StatusCode registerAddress(std::string_view path, ADDRESS *pAddr) override
IDataManagerSvc: Register object address with the data store.
Requested interface is not available.
StatusCode create(CSTR &nam, CSTR &typ) override
Create a partition object. The name identifies the partition uniquely.
StatusCode removePreLoadItem(const DataStoreItem &item) override
Remove an item from the preload list.
StatusCode initialize() override
Definition: Service.cpp:70
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:287
std::variant< std::monostate, ADDRESS *, OBJECT * > root
StatusCode clearSubTree(std::string_view path) override
Remove all data objects below the sub tree identified.
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 ...
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Partitions m_partitions
Datastore partitions.
StatusCode fwd(Fun f)
StatusCode unlinkObject(std::string_view path) override
Remove a link to another object.
StatusCode traverseTree(AGENT *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects in the data store.
virtual StatusCode registerAddress(std::string_view fullPath, IOpaqueAddress *pAddress)=0
Register object address with the data store.
virtual StatusCode linkObject(IRegistry *from, std::string_view objPath, DataObject *toObj)=0
Add a link to another object.
struct MultiStoreSvc::tagROOT m_root
StatusCode finalize() override
Definition: Service.cpp:174
Implementation of property with value of concrete type.
Definition: Property.h:370
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.
virtual StatusCode addPreLoadItem(const DataStoreItem &item)=0
Add an item to the preload list.
StatusCode objectLeaves(const OBJECT *pObject, std::vector< IRegistry * > &leaves) override
Explore the object store: retrieve all leaves attached to the object.
StatusCode unregisterObject(std::string_view path) override
Unregister object from the data store.
Root type (address or object)
virtual StatusCode unregisterAddress(std::string_view fullPath)=0
Unregister object address from the data store.
virtual StatusCode setDataProvider(IDataProviderSvc *pService)=0
Set Data provider service.
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
virtual StatusCode preLoad()=0
Load all preload items of the list.
StatusCode registerAddress(IRegistry *parent, std::string_view path, ADDRESS *pAddr) override
IDataManagerSvc: Register object address with the data store.
StatusCode unlinkObject(OBJECT *from, std::string_view objPath) override
Remove a link to another object.
virtual StatusCode resetPreLoad()=0
Clear the preload list.
StatusCode linkObject(std::string_view fullPath, OBJECT *to) override
Add a link to another object.
Gaudi::Property< CLID > m_rootCLID
T end(T... args)
Data service base class.
StatusCode unlinkObject(IRegistry *from, std::string_view objPath) override
Remove a link to another object.
Data provider interface definition.
Description of the DataStoreItem class.
Definition: DataStoreItem.h:27
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:86
virtual StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent)=0
IDataManagerSvc: Explore the object store: retrieve the object's parent.
SmartIF< IConversionSvc > m_dataLoader
Pointer to data loader service.
virtual StatusCode findObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Find object identified by its directory entry.
virtual StatusCode unlinkObject(IRegistry *from, std::string_view objPath)=0
Remove a link to another object.
StatusCode registerObject(std::string_view parent, std::string_view obj, OBJECT *pObj) override
Register object with the data store.
Invalid root path object cannot be retrieved or stored.
StatusCode attachServices()
STL class.
#define DECLARE_COMPONENT(type)
std::vector< std::string > PartitionDefs
virtual StatusCode removePreLoadItem(const DataStoreItem &item)=0
Remove an item from the preload list.
virtual StatusCode unregisterObject(std::string_view fullPath)=0
Unregister object from the data store.
StatusCode get(CSTR &nam, IInterface *&pPartition) const override
Access a partition object. The name identifies the partition uniquely.
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:86
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:284
StatusCode setRoot(std::string path, OBJECT *pObj) override
Initialize data store for new event by giving new event path and root object.
virtual StatusCode clearSubTree(std::string_view sub_path)=0
Remove all data objects below the sub tree identified by its full path name.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
StatusCode unregisterAddress(std::string_view path) override
IDataManagerSvc: Unregister object address from the data store.
TupleObj.h GaudiAlg/TupleObj.h namespace with few technical implementations.
General service interface definition.
Definition: IService.h:28
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
typename arg_helper< lambda >::type argument_t
Definition: EventIDBase.h:43
StatusCode drop(CSTR &nam) override
Drop a partition object. The name identifies the partition uniquely.
virtual StatusCode updateObject(IRegistry *pDirectory)=0
Update object identified by its directory entry.
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition of the basic interface.
Definition: IInterface.h:254
StatusCode findObject(IRegistry *parent, std::string_view path, OBJECT *&pObj) override
Find object identified by its full path in the data store.
Gaudi::Property< std::string > m_loader
T erase(T... args)
StatusCode clearPartitions()
Clear all partitions.
StatusCode unregisterObject(OBJECT *pObj) override
Unregister object from the data store.
Gaudi::Property< std::string > m_defaultPartition
StatusCode findObject(std::string_view path, OBJECT *&pObj) override
Find object identified by its full path in the data store.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:32
const std::string CSTR
StatusCode preparePartitions()
Prepare partition for usage.
DataObject OBJECT
StatusCode reinitialize() override
Definition: Service.cpp:247
unsigned int CLID
Class ID definition.
Definition: ClassID.h:18
StatusCode registerObject(OBJECT *parent, std::string_view obj, OBJECT *pObj) override
Register object with the data store.
T clear(T... args)
bool isSuccess() const
Definition: StatusCode.h:365
T move(T... args)
StatusCode traverseSubTree(OBJECT *pObject, AGENT *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects below the sub tree.
CLID rootCLID() const override
IDataManagerSvc: Accessor for root event CLID.
const std::string & rootName() const override
Name for root Event.
Partition m_current
Current partition.
Gaudi::Property< std::string > m_rootName
StatusCode objectParent(const OBJECT *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object's parent.
StatusCode drop(IInterface *pPartition) override
Drop a partition object. The name identifies the partition uniquely.
StatusCode objectLeaves(const IRegistry *pObject, std::vector< IRegistry * > &leaves) override
Explore the object store: retrieve all leaves attached to the object.
StatusCode traverseSubTree(std::string_view path, AGENT *pAgent) override
Analyze by traversing all data objects below the sub tree.
T find(T... args)
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:168
StatusCode create(CSTR &nam, CSTR &typ, IInterface *&pPartition) override
Create a partition object. The name identifies the partition uniquely.
virtual StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
Generic data agent interface.
StatusCode resetPreLoad() override
Clear the preload list.
StatusCode registerObject(std::string_view fullPath, DataObject *pObject)
Register object with the data store.
Base class used to extend a class implementing other interfaces.
Definition: extends.h:20
T begin(T... args)
StatusCode setRoot(std::string path, ADDRESS *pAddr) override
Initialize data store for new event by giving new event path and address of root object.
StatusCode updateObject(OBJECT *pObj) override
Update object.
StatusCode activePartition(std::string &nam, IInterface *&pPartition) const override
Access the active partition object.
SmartIF< IAddressCreator > m_addrCreator
Reference to address creator.
T emplace(T... args)
StatusCode activate(CSTR &nam) override
Activate a partition object. The name identifies the partition uniquely.
StatusCode unregisterAddress(IRegistry *pParent, std::string_view path) override
IDataManagerSvc: Unregister object address from the data store.
StatusCode activate(IInterface *pPartition) override
Activate a partition object.
constexpr static const auto FAILURE
Definition: StatusCode.h:101
const Gaudi::Algorithm & parent
StatusCode initialize() override
Service initialisation.
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:93
StatusCode setDataLoader(IConversionSvc *pDataLoader, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: Pass a default data loader to the service.
StatusCode addPreLoadItem(const DataStoreItem &item) override
Add an item to the preload list.
StatusCode unregisterObject(OBJECT *pObj, std::string_view path) override
Unregister object from the data store.
StatusCode retrieveObject(IRegistry *parent, std::string_view path, OBJECT *&pObj) override
Retrieve object from data store.
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:96
StatusCode makePartitions()
Create all partitions according to job options.
StatusCode clearSubTree(OBJECT *pObject) override
Remove all data objects below the sub tree identified.
Opaque address interface definition.
Gaudi::Property< PartitionDefs > m_partitionDefs
StatusCode reinitialize() override
Service initialisation.
StatusCode objectParent(const IRegistry *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object's parent.
IOpaqueAddress ADDRESS
StatusCode finalize() override
Service initialisation.
StatusCode preLoad() override
load all preload items of the list
std::map< std::string, Partition > Partitions
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:40
auto overload(lambda_ts &&... lambdas)
Definition: compose.h:38
T forward(T... args)
void toupper(std::string &s)
StatusCode linkObject(IRegistry *from, std::string_view objPath, OBJECT *to) override
Add a link to another object.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
IDataStoreAgent AGENT
~MultiStoreSvc() override
Standard Destructor.
virtual unsigned long addRef()=0
Add reference to object.