Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
MultiStoreSvc.cpp
Go to the documentation of this file.
1 //====================================================================
2 // MultiStoreSvc.cpp
3 //--------------------------------------------------------------------
4 //
5 // Package : System ( The LHCb Offline System)
6 //
7 // Description: implementation of the Transient event data service.
8 //
9 // Author : M.Frank
10 // History :
11 // +---------+----------------------------------------------+---------
12 // | Date | Comment | Who
13 // +---------+----------------------------------------------+---------
14 // | 29/10/98| Initial version | MF
15 // +---------+----------------------------------------------+---------
16 //
17 //====================================================================
18 #define DATASVC_MULTISTORESVC_CPP
19 
20 // Include files
22 #include "GaudiKernel/DataObject.h"
31 #include "GaudiKernel/MsgStream.h"
32 #include "GaudiKernel/Service.h"
33 #include "GaudiKernel/SmartIF.h"
35 #include "GaudiKernel/compose.h"
36 #include "boost/variant.hpp"
37 #include <map>
38 
39 // Forward declarations
40 // This class
42 
43 typedef const std::string CSTR;
47 
48 namespace {
49  struct Partition final {
50  SmartIF<IDataProviderSvc> dataProvider;
51  SmartIF<IDataManagerSvc> dataManager;
53 
54  template <typename T>
55  T* get();
56  };
57  template <>
58  IDataProviderSvc* Partition::get<IDataProviderSvc>() {
59  return dataProvider.get();
60  }
61  template <>
62  IDataManagerSvc* Partition::get<IDataManagerSvc>() {
63  return dataManager.get();
64  }
65 
66  namespace detail {
67  template <typename lambda>
68  struct arg_helper : public arg_helper<decltype( &lambda::operator() )> {};
69  template <typename T, typename Ret, typename Arg>
70  struct arg_helper<Ret ( T::* )( Arg ) const> {
71  using type = Arg;
72  };
73 
74  // given a unary lambda whose argument is of type Arg_t,
75  // argument_t<lambda> will be equal to Arg_t
76  template <typename lambda>
77  using argument_t = typename arg_helper<lambda>::type;
78  } // namespace detail
79  auto visit = []( auto&& variant, auto&&... lambdas ) -> decltype( auto ) {
80  return boost::apply_visitor( Gaudi::overload( std::forward<decltype( lambdas )>( lambdas )... ),
81  std::forward<decltype( variant )>( variant ) );
82  };
83 } // namespace
84 
96 class MultiStoreSvc : public extends<Service, IDataProviderSvc, IDataManagerSvc, IPartitionControl> {
97 protected:
100 
101  Gaudi::Property<CLID> m_rootCLID{this, "RootCLID", 110, "CLID of root entry"};
102  Gaudi::Property<std::string> m_rootName{this, "RootName", "/Event", "name of root entry"};
103  Gaudi::Property<PartitionDefs> m_partitionDefs{this, "Partitions", {}, "datastore partition definitions"};
104  Gaudi::Property<std::string> m_loader{this, "DataLoader", "EventPersistencySvc", "data loader name"};
105  Gaudi::Property<std::string> m_defaultPartition{this, "DefaultPartition", "Default", "default partition name"};
106 
112  struct tagROOT {
114  boost::variant<boost::blank, ADDRESS*, OBJECT*> root;
115  } m_root;
117  Partition m_current;
119  Partitions m_partitions;
120 
121  // member templates to help writing the function calls
122  template <typename Fun>
123  StatusCode fwd( Fun f ) {
124  auto* svc = m_current.get<std::decay_t<detail::argument_t<Fun>>>();
125  return svc ? f( *svc ) : IDataProviderSvc::Status::INVALID_ROOT;
126  }
127 
128 public:
130  CLID rootCLID() const override { return m_rootCLID; }
132  const std::string& rootName() const override { return m_rootName; }
133 
135  StatusCode registerAddress( boost::string_ref path, ADDRESS* pAddr ) override {
136  return fwd( [&]( IDataManagerSvc& svc ) { return svc.registerAddress( path, pAddr ); } );
137  }
139  StatusCode registerAddress( IRegistry* parent, boost::string_ref path, ADDRESS* pAddr ) override {
140  return fwd( [&]( IDataManagerSvc& svc ) { return svc.registerAddress( parent, path, pAddr ); } );
141  }
143  StatusCode unregisterAddress( boost::string_ref path ) override {
144  return fwd( [&]( IDataManagerSvc& svc ) { return svc.unregisterAddress( path ); } );
145  }
147  StatusCode unregisterAddress( IRegistry* pParent, boost::string_ref path ) override {
148  return fwd( [&]( IDataManagerSvc& svc ) { return svc.unregisterAddress( pParent, path ); } );
149  }
151  StatusCode objectLeaves( const OBJECT* pObject, std::vector<IRegistry*>& leaves ) override {
152  return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectLeaves( pObject, leaves ); } );
153  }
155  StatusCode objectLeaves( const IRegistry* pObject, std::vector<IRegistry*>& leaves ) override {
156  return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectLeaves( pObject, leaves ); } );
157  }
159  StatusCode objectParent( const OBJECT* pObject, IRegistry*& refpParent ) override {
160  return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectParent( pObject, refpParent ); } );
161  }
163  StatusCode objectParent( const IRegistry* pObject, IRegistry*& refpParent ) override {
164  return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectParent( pObject, refpParent ); } );
165  }
167  StatusCode clearSubTree( boost::string_ref path ) override {
168  return fwd( [&]( IDataManagerSvc& svc ) { return svc.clearSubTree( path ); } );
169  }
171  StatusCode clearSubTree( OBJECT* pObject ) override {
172  return fwd( [&]( IDataManagerSvc& svc ) { return svc.clearSubTree( pObject ); } );
173  }
175  StatusCode clearStore() override {
176  for ( auto& i : m_partitions ) { i.second.dataManager->clearStore().ignore(); }
177  visit( m_root.root,
178  []( auto* p ) {
179  if ( p ) p->release();
180  },
181  []( boost::blank ) {} );
182  m_root.root = {};
183  m_root.path.clear();
184  return StatusCode::SUCCESS;
185  }
187  StatusCode traverseSubTree( boost::string_ref path, AGENT* pAgent ) override {
188  return fwd( [&]( IDataManagerSvc& svc ) { return svc.traverseSubTree( path, pAgent ); } );
189  }
191  StatusCode traverseSubTree( OBJECT* pObject, AGENT* pAgent ) override {
192  return fwd( [&]( IDataManagerSvc& svc ) { return svc.traverseSubTree( pObject, pAgent ); } );
193  }
195  StatusCode traverseTree( AGENT* pAgent ) override {
196  return fwd( [&]( IDataManagerSvc& svc ) { return svc.traverseTree( pAgent ); } );
197  }
200  StatusCode setRoot( std::string path, OBJECT* pObj ) override {
201  visit( m_root.root,
202  []( auto* p ) {
203  if ( p ) p->release();
204  },
205  []( boost::blank ) {} );
206  m_root.path = std::move( path );
207  m_root.root = pObj;
209  return activate( m_defaultPartition );
210  }
211 
214  StatusCode setRoot( std::string path, ADDRESS* pAddr ) override {
215  visit( m_root.root,
216  []( auto* p ) {
217  if ( p ) p->release();
218  },
219  []( boost::blank ) {} );
220  m_root.path = std::move( path );
221  m_root.root = pAddr;
222  if ( !pAddr ) return StatusCode::FAILURE;
223  pAddr->addRef();
225  return activate( m_defaultPartition );
226  }
228  StatusCode setDataLoader( IConversionSvc* pDataLoader, IDataProviderSvc* dpsvc = nullptr ) override {
229  m_dataLoader = pDataLoader;
230  if ( m_dataLoader ) m_dataLoader->setDataProvider( dpsvc ? dpsvc : this );
231  for ( auto& i : m_partitions ) { i.second.dataManager->setDataLoader( m_dataLoader.get() ).ignore(); }
232  return StatusCode::SUCCESS;
233  }
235  StatusCode addPreLoadItem( const DataStoreItem& item ) override {
236  return fwd( [&]( IDataProviderSvc& svc ) { return svc.addPreLoadItem( item ); } );
237  }
239  StatusCode removePreLoadItem( const DataStoreItem& item ) override {
240  return fwd( [&]( IDataProviderSvc& svc ) { return svc.removePreLoadItem( item ); } );
241  }
244  return fwd( [&]( IDataProviderSvc& svc ) { return svc.resetPreLoad(); } );
245  }
247  StatusCode preLoad() override {
248  return fwd( [&]( IDataProviderSvc& svc ) { return svc.preLoad(); } );
249  }
251  StatusCode registerObject( boost::string_ref parent, boost::string_ref obj, OBJECT* pObj ) override {
252  return fwd( [&]( IDataProviderSvc& svc ) { return svc.registerObject( parent, obj, pObj ); } );
253  }
255  StatusCode registerObject( OBJECT* parent, boost::string_ref obj, OBJECT* pObj ) override {
256  return fwd( [&]( IDataProviderSvc& svc ) { return svc.registerObject( parent, obj, pObj ); } );
257  }
259  StatusCode unregisterObject( boost::string_ref path ) override {
260  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unregisterObject( path ); } );
261  }
263  StatusCode unregisterObject( OBJECT* pObj ) override {
264  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unregisterObject( pObj ); } );
265  }
267  StatusCode unregisterObject( OBJECT* pObj, boost::string_ref path ) override {
268  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unregisterObject( pObj, path ); } );
269  }
271  StatusCode retrieveObject( IRegistry* parent, boost::string_ref path, OBJECT*& pObj ) override {
272  return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( parent, path, pObj ); } );
273  }
275  StatusCode findObject( boost::string_ref path, OBJECT*& pObj ) override {
276  return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( path, pObj ); } );
277  }
279  StatusCode findObject( IRegistry* parent, boost::string_ref path, OBJECT*& pObj ) override {
280  return fwd( [&]( IDataProviderSvc& svc ) { return svc.findObject( parent, path, pObj ); } );
281  }
283  StatusCode linkObject( IRegistry* from, boost::string_ref objPath, OBJECT* to ) override {
284  return fwd( [&]( IDataProviderSvc& svc ) { return svc.linkObject( from, objPath, to ); } );
285  }
287  StatusCode linkObject( boost::string_ref fullPath, OBJECT* to ) override {
288  return fwd( [&]( IDataProviderSvc& svc ) { return svc.linkObject( fullPath, to ); } );
289  }
291  StatusCode unlinkObject( IRegistry* from, boost::string_ref objPath ) override {
292  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unlinkObject( from, objPath ); } );
293  }
295  StatusCode unlinkObject( OBJECT* from, boost::string_ref objPath ) override {
296  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unlinkObject( from, objPath ); } );
297  }
299  StatusCode unlinkObject( boost::string_ref path ) override {
300  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unlinkObject( path ); } );
301  }
303  StatusCode updateObject( IRegistry* pDirectory ) override {
304  return fwd( [&]( IDataProviderSvc& svc ) { return svc.updateObject( pDirectory ); } );
305  }
307  StatusCode updateObject( OBJECT* pObj ) override {
308  return fwd( [&]( IDataProviderSvc& svc ) { return svc.updateObject( pObj ); } );
309  }
311  StatusCode create( CSTR& nam, CSTR& typ ) override {
312  IInterface* pPartition = nullptr;
313  return create( nam, typ, pPartition );
314  }
316  StatusCode create( CSTR& nam, CSTR& typ, IInterface*& pPartition ) override {
317  if ( get( nam, pPartition ).isSuccess() ) return IPartitionControl::Status::PARTITION_EXISTS;
319  auto isvc = serviceLocator()->service<IService>( typ );
320  if ( !isvc ) return IInterface::Status::NO_INTERFACE;
321  auto dataMgr = isvc.as<IDataManagerSvc>();
322  auto dataProv = isvc.as<IDataProviderSvc>();
323  if ( !dataMgr || !dataProv ) return IInterface::Status::NO_INTERFACE;
324  m_partitions.emplace( nam, Partition{dataProv, dataMgr, nam} );
325  return StatusCode::SUCCESS;
326  }
327 
329  StatusCode drop( CSTR& nam ) override {
330  auto i = m_partitions.find( nam );
331  if ( i == m_partitions.end() ) return IPartitionControl::Status::PARTITION_NOT_PRESENT;
332  if ( i->second.dataManager == m_current.dataManager ) { m_current = Partition(); }
333  i->second.dataManager->clearStore().ignore();
334  m_partitions.erase( i );
335  return StatusCode::SUCCESS;
336  }
337 
339  StatusCode drop( IInterface* pPartition ) override {
340  auto provider = SmartIF<IDataProviderSvc>( pPartition );
341  if ( !provider ) return IInterface::Status::NO_INTERFACE;
342  auto i = std::find_if( std::begin( m_partitions ), std::end( m_partitions ),
343  [&]( Partitions::const_reference p ) { return p.second.dataProvider == provider; } );
344  if ( i == std::end( m_partitions ) ) return IPartitionControl::Status::PARTITION_NOT_PRESENT;
345  i->second.dataManager->clearStore().ignore();
346  m_partitions.erase( i );
347  return StatusCode::SUCCESS;
348  }
349 
351  StatusCode activate( CSTR& nam ) override {
352  auto i = m_partitions.find( nam );
353  if ( i != m_partitions.end() ) {
354  m_current = i->second;
355  return StatusCode::SUCCESS;
356  }
357  m_current = {};
359  }
360 
362  StatusCode activate( IInterface* pPartition ) override {
363  auto provider = SmartIF<IDataProviderSvc>( pPartition );
364  m_current = Partition();
365  if ( !provider ) return IInterface::Status::NO_INTERFACE;
366  auto i = std::find_if( std::begin( m_partitions ), std::end( m_partitions ),
367  [&]( Partitions::const_reference p ) { return p.second.dataProvider == provider; } );
368  if ( i == std::end( m_partitions ) ) return IPartitionControl::Status::PARTITION_NOT_PRESENT;
369  m_current = i->second;
370  return StatusCode::SUCCESS;
371  }
372 
374  StatusCode get( CSTR& nam, IInterface*& pPartition ) const override {
375  auto i = m_partitions.find( nam );
376  if ( i != m_partitions.end() ) {
377  pPartition = i->second.dataProvider;
378  return StatusCode::SUCCESS;
379  }
380  pPartition = nullptr;
382  }
383 
385  StatusCode activePartition( std::string& nam, IInterface*& pPartition ) const override {
386  if ( m_current.dataProvider ) {
387  nam = m_current.name;
388  pPartition = m_current.dataProvider;
389  return StatusCode::SUCCESS;
390  }
391  nam.clear();
392  pPartition = nullptr;
394  }
395 
397  // Attach address creator facility
398  m_addrCreator = service( m_loader, true );
399  if ( !m_addrCreator ) {
400  error() << "Failed to retrieve data loader "
401  << "\"" << m_loader << "\"" << endmsg;
402  return StatusCode::FAILURE;
403  }
404  // Attach data loader facility
405  auto dataLoader = service<IConversionSvc>( m_loader, true );
406  if ( !dataLoader ) {
407  error() << "Failed to retrieve data loader "
408  << "\"" << m_loader << "\"" << endmsg;
409  return StatusCode::FAILURE;
410  }
411  auto sc = setDataLoader( dataLoader.get() );
412  if ( !sc.isSuccess() ) {
413  error() << "Failed to set data loader "
414  << "\"" << m_loader << "\"" << endmsg;
415  }
416  return sc;
417  }
418 
420  m_addrCreator.reset();
421  m_dataLoader.reset();
422  return StatusCode::SUCCESS;
423  }
424 
426  StatusCode initialize() override {
427  // Nothing to do: just call base class initialisation
429  if ( !sc.isSuccess() ) return sc;
430  sc = makePartitions();
431  if ( !sc.isSuccess() ) {
432  error() << "Failed to connect to all store partitions." << endmsg;
433  return sc;
434  }
435  return attachServices();
436  }
437 
441  if ( !sc.isSuccess() ) {
442  error() << "Enable to reinitialize base class" << endmsg;
443  return sc;
444  }
445  detachServices();
446  sc = attachServices();
447  if ( !sc.isSuccess() ) {
448  error() << "Failed to attach necessary services." << endmsg;
449  return sc;
450  }
451  sc = makePartitions();
452  if ( !sc.isSuccess() ) {
453  error() << "Failed to connect to store partitions." << endmsg;
454  return sc;
455  }
456  // return
457  return StatusCode::SUCCESS;
458  }
459 
461  StatusCode finalize() override {
462  setDataLoader( nullptr ).ignore();
463  clearStore().ignore();
465  m_current = Partition();
466  detachServices();
467  return Service::finalize();
468  }
469 
470  // protected:
471 
473  using extends::extends;
474 
476  ~MultiStoreSvc() override {
477  setDataLoader( nullptr ).ignore();
478  resetPreLoad().ignore();
479  clearStore().ignore();
481  }
482 
486  for ( auto& i : m_partitions ) {
487  StatusCode sc = visit( m_root.root,
488  [&]( ADDRESS* address ) -> StatusCode {
489  if ( !address ) return StatusCode::FAILURE;
490  ADDRESS* pAdd = nullptr;
491  ADDRESS* p = address;
492  auto sc =
493  m_addrCreator->createAddress( p->svcType(), p->clID(), p->par(), p->ipar(), pAdd );
494  return sc.isSuccess() ? i.second.dataManager->setRoot( m_root.path, pAdd ) : sc;
495  },
496  [&]( OBJECT* object ) -> StatusCode {
497  if ( object && object->clID() == CLID_DataObject ) {
498  return i.second.dataManager->setRoot( m_root.path, new DataObject() );
499  }
500  return StatusCode::FAILURE;
501  },
502  []( boost::blank ) -> StatusCode { return StatusCode::FAILURE; } );
503  if ( !sc.isSuccess() ) iret = sc;
504  }
505  return iret;
506  }
507 
510  for ( auto& i : m_partitions ) i.second.dataManager->clearStore().ignore();
511  m_partitions.clear();
512  return StatusCode::SUCCESS;
513  }
514 
517  using Parser = Gaudi::Utils::AttribStringParser;
518  std::string typ, nam;
520  for ( auto part : m_partitionDefs ) {
521  for ( auto attrib : Parser( std::move( part ) ) ) {
522  switch ( ::toupper( attrib.tag[0] ) ) {
523  case 'N':
524  nam = std::move( attrib.value );
525  break;
526  case 'T':
527  typ = std::move( attrib.value );
528  break;
529  }
530  }
531  StatusCode sc = create( nam, typ );
532  if ( !sc.isSuccess() ) return sc;
533  if ( m_defaultPartition.empty() ) m_defaultPartition = nam;
534  }
535  return StatusCode::SUCCESS;
536  }
537 };
538 
539 // Instantiation of a static factory class used by clients to create
540 // 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 unregisterAddress(boost::string_ref path) override
IDataManagerSvc: Unregister object address from 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 registerObject(OBJECT *parent, boost::string_ref obj, OBJECT *pObj) override
Register object with the data store.
StatusCode initialize() override
Definition: Service.cpp:60
StatusCode clearSubTree(boost::string_ref 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.
virtual StatusCode unlinkObject(IRegistry *from, boost::string_ref objPath)=0
Remove a link to another object.
Partitions m_partitions
Datastore partitions.
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:274
StatusCode fwd(Fun f)
StatusCode traverseTree(AGENT *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects in the data store.
struct MultiStoreSvc::tagROOT m_root
StatusCode finalize() override
Definition: Service.cpp:164
Implementation of property with value of concrete type.
Definition: Property.h:352
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.
StatusCode unlinkObject(IRegistry *from, boost::string_ref objPath) override
Remove a link to another object.
virtual StatusCode findObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject)=0
Find object identified by its directory entry.
StatusCode objectLeaves(const OBJECT *pObject, std::vector< IRegistry * > &leaves) override
Explore the object store: retrieve all leaves attached to the object.
bool isSuccess() const
Definition: StatusCode.h:267
Root type (address or object)
virtual StatusCode setDataProvider(IDataProviderSvc *pService)=0
Set Data provider service.
boost::variant< boost::blank, ADDRESS *, OBJECT * > root
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
virtual StatusCode preLoad()=0
Load all preload items of the list.
virtual StatusCode resetPreLoad()=0
Clear the preload list.
StatusCode linkObject(boost::string_ref fullPath, OBJECT *to) override
Add a link to another object.
Gaudi::Property< CLID > m_rootCLID
T end(T...args)
Data service base class.
StatusCode linkObject(IRegistry *from, boost::string_ref objPath, OBJECT *to) override
Add a link to another object.
Data provider interface definition.
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
StatusCode findObject(boost::string_ref path, OBJECT *&pObj) override
Find object identified by its full path in the data store.
virtual StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent)=0
IDataManagerSvc: Explore the object store: retrieve the object&#39;s parent.
virtual StatusCode traverseSubTree(boost::string_ref sub_tree_path, IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects below the sub tree identified by its full path name...
SmartIF< IConversionSvc > m_dataLoader
Pointer to data loader service.
Invalid root path object cannot be retrieved or stored.
StatusCode attachServices()
STL class.
virtual StatusCode linkObject(IRegistry *from, boost::string_ref objPath, DataObject *toObj)=0
Add a link to another object.
#define DECLARE_COMPONENT(type)
std::vector< std::string > PartitionDefs
virtual StatusCode removePreLoadItem(const DataStoreItem &item)=0
Remove an item from the preload list.
StatusCode unregisterObject(boost::string_ref path) override
Unregister object from the data store.
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:76
StatusCode setRoot(std::string path, OBJECT *pObj) override
Initialize data store for new event by giving new event path and root object.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
TupleObj.h GaudiAlg/TupleObj.h namespace with few technical implementations.
StatusCode registerAddress(IRegistry *parent, boost::string_ref path, ADDRESS *pAddr) override
IDataManagerSvc: Register object address with the data store.
General service interface definition.
Definition: IService.h:18
StatusCode findObject(IRegistry *parent, boost::string_ref path, OBJECT *&pObj) override
Find object identified by its full path in the data store.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
typename arg_helper< lambda >::type argument_t
Definition: EventIDBase.h:33
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:244
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
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
StatusCode preparePartitions()
Prepare partition for usage.
DataObject OBJECT
StatusCode reinitialize() override
Definition: Service.cpp:237
StatusCode unlinkObject(boost::string_ref path) override
Remove a link to another object.
virtual StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
virtual StatusCode clearSubTree(boost::string_ref sub_path)=0
Remove all data objects below the sub tree identified by its full path name.
T clear(T...args)
T move(T...args)
StatusCode traverseSubTree(OBJECT *pObject, AGENT *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects below the sub tree.
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&#39;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.
virtual StatusCode unregisterAddress(boost::string_ref fullPath)=0
Unregister object address from the data store.
T find(T...args)
StatusCode registerObject(boost::string_ref fullPath, DataObject *pObject)
Register object with the data store.
virtual StatusCode unregisterObject(boost::string_ref fullPath)=0
Unregister object from the data store.
StatusCode create(CSTR &nam, CSTR &typ, IInterface *&pPartition) override
Create a partition object. The name identifies the partition uniquely.
Generic data agent interface.
StatusCode resetPreLoad() override
Clear the preload list.
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
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.
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:153
StatusCode registerObject(boost::string_ref parent, boost::string_ref obj, OBJECT *pObj) override
Register object with the data store.
StatusCode updateObject(OBJECT *pObj) override
Update object.
SmartIF< IAddressCreator > m_addrCreator
Reference to address creator.
auto overload(lambda_ts &&...lambdas)
Definition: compose.h:58
virtual StatusCode registerAddress(boost::string_ref fullPath, IOpaqueAddress *pAddress)=0
Register object address with the data store.
StatusCode activePartition(std::string &nam, IInterface *&pPartition) const override
Access the active partition object.
T emplace(T...args)
StatusCode activate(CSTR &nam) override
Activate a partition object. The name identifies the partition uniquely.
StatusCode activate(IInterface *pPartition) override
Activate a partition object.
constexpr static const auto FAILURE
Definition: StatusCode.h:86
StatusCode initialize() override
Service initialisation.
StatusCode unregisterObject(OBJECT *pObj, boost::string_ref path) override
Unregister object from the data store.
StatusCode setDataLoader(IConversionSvc *pDataLoader, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: Pass a default data loader to the service.
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn&#39;t already exist.
Definition: Service.h:83
StatusCode addPreLoadItem(const DataStoreItem &item) override
Add an item to the preload list.
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:86
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&#39;s parent.
IOpaqueAddress ADDRESS
StatusCode finalize() override
Service initialisation.
StatusCode traverseSubTree(boost::string_ref path, AGENT *pAgent) override
Analyze by traversing all data objects below the sub tree.
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:30
StatusCode unlinkObject(OBJECT *from, boost::string_ref objPath) override
Remove a link to another object.
StatusCode retrieveObject(IRegistry *parent, boost::string_ref path, OBJECT *&pObj) override
Retrieve object from data store.
T forward(T...args)
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:277
void toupper(std::string &s)
StatusCode unregisterAddress(IRegistry *pParent, boost::string_ref path) override
IDataManagerSvc: Unregister object address from the data store.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
IDataStoreAgent AGENT
StatusCode registerAddress(boost::string_ref path, ADDRESS *pAddr) override
IDataManagerSvc: Register object address with the data store.
~MultiStoreSvc() override
Standard Destructor.
virtual unsigned long addRef()=0
Add reference to object.