The Gaudi Framework  v30r4 (9b837755)
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 {
50  struct Partition final {
51  SmartIF<IDataProviderSvc> dataProvider;
52  SmartIF<IDataManagerSvc> dataManager;
54 
55  template <typename T>
56  T* get();
57  };
58  template <>
59  IDataProviderSvc* Partition::get<IDataProviderSvc>()
60  {
61  return dataProvider.get();
62  }
63  template <>
64  IDataManagerSvc* Partition::get<IDataManagerSvc>()
65  {
66  return dataManager.get();
67  }
68 
69  namespace detail
70  {
71  template <typename lambda>
72  struct arg_helper : public arg_helper<decltype( &lambda::operator() )> {
73  };
74  template <typename T, typename Ret, typename Arg>
75  struct arg_helper<Ret ( T::* )( Arg ) const> {
76  using type = Arg;
77  };
78 
79  // given a unary lambda whose argument is of type Arg_t,
80  // argument_t<lambda> will be equal to Arg_t
81  template <typename lambda>
82  using argument_t = typename arg_helper<lambda>::type;
83  }
84  auto visit = []( auto&& variant, auto&&... lambdas ) -> decltype( auto ) {
85  return boost::apply_visitor( Gaudi::overload( std::forward<decltype( lambdas )>( lambdas )... ),
86  std::forward<decltype( variant )>( variant ) );
87  };
88 }
89 
101 class MultiStoreSvc : public extends<Service, IDataProviderSvc, IDataManagerSvc, IPartitionControl>
102 {
103 protected:
106 
107  Gaudi::Property<CLID> m_rootCLID{this, "RootCLID", 110, "CLID of root entry"};
108  Gaudi::Property<std::string> m_rootName{this, "RootName", "/Event", "name of root entry"};
109  Gaudi::Property<PartitionDefs> m_partitionDefs{this, "Partitions", {}, "datastore partition definitions"};
110  Gaudi::Property<std::string> m_loader{this, "DataLoader", "EventPersistencySvc", "data loader name"};
111  Gaudi::Property<std::string> m_defaultPartition{this, "DefaultPartition", "Default", "default partition name"};
112 
118  struct tagROOT {
120  boost::variant<boost::blank, ADDRESS*, OBJECT*> root;
121  } m_root;
123  Partition m_current;
125  Partitions m_partitions;
126 
127  // member templates to help writing the function calls
128  template <typename Fun>
129  StatusCode fwd( Fun f )
130  {
131  auto* svc = m_current.get<std::decay_t<detail::argument_t<Fun>>>();
132  return svc ? f( *svc ) : IDataProviderSvc::Status::INVALID_ROOT;
133  }
134 
135 public:
137  CLID rootCLID() const override { return m_rootCLID; }
139  const std::string& rootName() const override { return m_rootName; }
140 
142  StatusCode registerAddress( boost::string_ref path, ADDRESS* pAddr ) override
143  {
144  return fwd( [&]( IDataManagerSvc& svc ) { return svc.registerAddress( path, pAddr ); } );
145  }
147  StatusCode registerAddress( IRegistry* parent, boost::string_ref path, ADDRESS* pAddr ) override
148  {
149  return fwd( [&]( IDataManagerSvc& svc ) { return svc.registerAddress( parent, path, pAddr ); } );
150  }
152  StatusCode unregisterAddress( boost::string_ref path ) override
153  {
154  return fwd( [&]( IDataManagerSvc& svc ) { return svc.unregisterAddress( path ); } );
155  }
157  StatusCode unregisterAddress( IRegistry* pParent, boost::string_ref path ) override
158  {
159  return fwd( [&]( IDataManagerSvc& svc ) { return svc.unregisterAddress( pParent, path ); } );
160  }
162  StatusCode objectLeaves( const OBJECT* pObject, std::vector<IRegistry*>& leaves ) override
163  {
164  return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectLeaves( pObject, leaves ); } );
165  }
167  StatusCode objectLeaves( const IRegistry* pObject, std::vector<IRegistry*>& leaves ) override
168  {
169  return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectLeaves( pObject, leaves ); } );
170  }
172  StatusCode objectParent( const OBJECT* pObject, IRegistry*& refpParent ) override
173  {
174  return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectParent( pObject, refpParent ); } );
175  }
177  StatusCode objectParent( const IRegistry* pObject, IRegistry*& refpParent ) override
178  {
179  return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectParent( pObject, refpParent ); } );
180  }
182  StatusCode clearSubTree( boost::string_ref path ) override
183  {
184  return fwd( [&]( IDataManagerSvc& svc ) { return svc.clearSubTree( path ); } );
185  }
187  StatusCode clearSubTree( OBJECT* pObject ) override
188  {
189  return fwd( [&]( IDataManagerSvc& svc ) { return svc.clearSubTree( pObject ); } );
190  }
193  {
194  for ( auto& i : m_partitions ) {
195  i.second.dataManager->clearStore().ignore();
196  }
197  visit( m_root.root,
198  []( auto* p ) {
199  if ( p ) p->release();
200  },
201  []( boost::blank ) {} );
202  m_root.root = {};
203  m_root.path.clear();
204  return StatusCode::SUCCESS;
205  }
207  StatusCode traverseSubTree( boost::string_ref path, AGENT* pAgent ) override
208  {
209  return fwd( [&]( IDataManagerSvc& svc ) { return svc.traverseSubTree( path, pAgent ); } );
210  }
212  StatusCode traverseSubTree( OBJECT* pObject, AGENT* pAgent ) override
213  {
214  return fwd( [&]( IDataManagerSvc& svc ) { return svc.traverseSubTree( pObject, pAgent ); } );
215  }
217  StatusCode traverseTree( AGENT* pAgent ) override
218  {
219  return fwd( [&]( IDataManagerSvc& svc ) { return svc.traverseTree( pAgent ); } );
220  }
224  {
225  visit( m_root.root,
226  []( auto* p ) {
227  if ( p ) p->release();
228  },
229  []( boost::blank ) {} );
230  m_root.path = std::move( path );
231  m_root.root = pObj;
232  preparePartitions();
233  return activate( m_defaultPartition );
234  }
235 
239  {
240  visit( m_root.root,
241  []( auto* p ) {
242  if ( p ) p->release();
243  },
244  []( boost::blank ) {} );
245  m_root.path = std::move( path );
246  m_root.root = pAddr;
247  if ( !pAddr ) return StatusCode::FAILURE;
248  pAddr->addRef();
249  preparePartitions();
250  return activate( m_defaultPartition );
251  }
253  StatusCode setDataLoader( IConversionSvc* pDataLoader, IDataProviderSvc* dpsvc = nullptr ) override
254  {
255  m_dataLoader = pDataLoader;
256  if ( m_dataLoader ) m_dataLoader->setDataProvider( dpsvc ? dpsvc : this );
257  for ( auto& i : m_partitions ) {
258  i.second.dataManager->setDataLoader( m_dataLoader.get() ).ignore();
259  }
260  return StatusCode::SUCCESS;
261  }
263  StatusCode addPreLoadItem( const DataStoreItem& item ) override
264  {
265  return fwd( [&]( IDataProviderSvc& svc ) { return svc.addPreLoadItem( item ); } );
266  }
269  {
270  return fwd( [&]( IDataProviderSvc& svc ) { return svc.removePreLoadItem( item ); } );
271  }
274  {
275  return fwd( [&]( IDataProviderSvc& svc ) { return svc.resetPreLoad(); } );
276  }
278  StatusCode preLoad() override
279  {
280  return fwd( [&]( IDataProviderSvc& svc ) { return svc.preLoad(); } );
281  }
283  StatusCode registerObject( boost::string_ref parent, boost::string_ref obj, OBJECT* pObj ) override
284  {
285  return fwd( [&]( IDataProviderSvc& svc ) { return svc.registerObject( parent, obj, pObj ); } );
286  }
288  StatusCode registerObject( OBJECT* parent, boost::string_ref obj, OBJECT* pObj ) override
289  {
290  return fwd( [&]( IDataProviderSvc& svc ) { return svc.registerObject( parent, obj, pObj ); } );
291  }
293  StatusCode unregisterObject( boost::string_ref path ) override
294  {
295  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unregisterObject( path ); } );
296  }
299  {
300  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unregisterObject( pObj ); } );
301  }
303  StatusCode unregisterObject( OBJECT* pObj, boost::string_ref path ) override
304  {
305  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unregisterObject( pObj, path ); } );
306  }
308  StatusCode retrieveObject( IRegistry* parent, boost::string_ref path, OBJECT*& pObj ) override
309  {
310  return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( parent, path, pObj ); } );
311  }
313  StatusCode findObject( boost::string_ref path, OBJECT*& pObj ) override
314  {
315  return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( path, pObj ); } );
316  }
318  StatusCode findObject( IRegistry* parent, boost::string_ref path, OBJECT*& pObj ) override
319  {
320  return fwd( [&]( IDataProviderSvc& svc ) { return svc.findObject( parent, path, pObj ); } );
321  }
323  StatusCode linkObject( IRegistry* from, boost::string_ref objPath, OBJECT* to ) override
324  {
325  return fwd( [&]( IDataProviderSvc& svc ) { return svc.linkObject( from, objPath, to ); } );
326  }
328  StatusCode linkObject( boost::string_ref fullPath, OBJECT* to ) override
329  {
330  return fwd( [&]( IDataProviderSvc& svc ) { return svc.linkObject( fullPath, to ); } );
331  }
333  StatusCode unlinkObject( IRegistry* from, boost::string_ref objPath ) override
334  {
335  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unlinkObject( from, objPath ); } );
336  }
338  StatusCode unlinkObject( OBJECT* from, boost::string_ref objPath ) override
339  {
340  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unlinkObject( from, objPath ); } );
341  }
343  StatusCode unlinkObject( boost::string_ref path ) override
344  {
345  return fwd( [&]( IDataProviderSvc& svc ) { return svc.unlinkObject( path ); } );
346  }
348  StatusCode updateObject( IRegistry* pDirectory ) override
349  {
350  return fwd( [&]( IDataProviderSvc& svc ) { return svc.updateObject( pDirectory ); } );
351  }
353  StatusCode updateObject( OBJECT* pObj ) override
354  {
355  return fwd( [&]( IDataProviderSvc& svc ) { return svc.updateObject( pObj ); } );
356  }
358  StatusCode create( CSTR& nam, CSTR& typ ) override
359  {
360  IInterface* pPartition = nullptr;
361  return create( nam, typ, pPartition );
362  }
364  StatusCode create( CSTR& nam, CSTR& typ, IInterface*& pPartition ) override
365  {
366  if ( get( nam, pPartition ).isSuccess() ) return IPartitionControl::Status::PARTITION_EXISTS;
368  auto isvc = serviceLocator()->service<IService>( typ );
369  if ( !isvc ) return IInterface::Status::NO_INTERFACE;
370  auto dataMgr = isvc.as<IDataManagerSvc>();
371  auto dataProv = isvc.as<IDataProviderSvc>();
372  if ( !dataMgr || !dataProv ) return IInterface::Status::NO_INTERFACE;
373  m_partitions.emplace( nam, Partition{dataProv, dataMgr, nam} );
374  return StatusCode::SUCCESS;
375  }
376 
378  StatusCode drop( CSTR& nam ) override
379  {
380  auto i = m_partitions.find( nam );
381  if ( i == m_partitions.end() ) return IPartitionControl::Status::PARTITION_NOT_PRESENT;
382  if ( i->second.dataManager == m_current.dataManager ) {
383  m_current = Partition();
384  }
385  i->second.dataManager->clearStore().ignore();
386  m_partitions.erase( i );
387  return StatusCode::SUCCESS;
388  }
389 
391  StatusCode drop( IInterface* pPartition ) override
392  {
393  auto provider = SmartIF<IDataProviderSvc>( pPartition );
394  if ( !provider ) return IInterface::Status::NO_INTERFACE;
395  auto i = std::find_if( std::begin( m_partitions ), std::end( m_partitions ),
396  [&]( Partitions::const_reference p ) { return p.second.dataProvider == provider; } );
397  if ( i == std::end( m_partitions ) ) return IPartitionControl::Status::PARTITION_NOT_PRESENT;
398  i->second.dataManager->clearStore().ignore();
399  m_partitions.erase( i );
400  return StatusCode::SUCCESS;
401  }
402 
404  StatusCode activate( CSTR& nam ) override
405  {
406  auto i = m_partitions.find( nam );
407  if ( i != m_partitions.end() ) {
408  m_current = i->second;
409  return StatusCode::SUCCESS;
410  }
411  m_current = {};
413  }
414 
416  StatusCode activate( IInterface* pPartition ) override
417  {
418  auto provider = SmartIF<IDataProviderSvc>( pPartition );
419  m_current = Partition();
420  if ( !provider ) return IInterface::Status::NO_INTERFACE;
421  auto i = std::find_if( std::begin( m_partitions ), std::end( m_partitions ),
422  [&]( Partitions::const_reference p ) { return p.second.dataProvider == provider; } );
423  if ( i == std::end( m_partitions ) ) return IPartitionControl::Status::PARTITION_NOT_PRESENT;
424  m_current = i->second;
425  return StatusCode::SUCCESS;
426  }
427 
429  StatusCode get( CSTR& nam, IInterface*& pPartition ) const override
430  {
431  auto i = m_partitions.find( nam );
432  if ( i != m_partitions.end() ) {
433  pPartition = i->second.dataProvider;
434  return StatusCode::SUCCESS;
435  }
436  pPartition = nullptr;
438  }
439 
441  StatusCode activePartition( std::string& nam, IInterface*& pPartition ) const override
442  {
443  if ( m_current.dataProvider ) {
444  nam = m_current.name;
445  pPartition = m_current.dataProvider;
446  return StatusCode::SUCCESS;
447  }
448  nam.clear();
449  pPartition = nullptr;
451  }
452 
454  {
455  // Attach address creator facility
456  m_addrCreator = service( m_loader, true );
457  if ( !m_addrCreator ) {
458  error() << "Failed to retrieve data loader "
459  << "\"" << m_loader << "\"" << endmsg;
460  return StatusCode::FAILURE;
461  }
462  // Attach data loader facility
463  auto dataLoader = service<IConversionSvc>( m_loader, true );
464  if ( !dataLoader ) {
465  error() << "Failed to retrieve data loader "
466  << "\"" << m_loader << "\"" << endmsg;
467  return StatusCode::FAILURE;
468  }
469  auto sc = setDataLoader( dataLoader.get() );
470  if ( !sc.isSuccess() ) {
471  error() << "Failed to set data loader "
472  << "\"" << m_loader << "\"" << endmsg;
473  }
474  return sc;
475  }
476 
478  {
479  m_addrCreator.reset();
480  m_dataLoader.reset();
481  return StatusCode::SUCCESS;
482  }
483 
486  {
487  // Nothing to do: just call base class initialisation
489  if ( !sc.isSuccess() ) return sc;
490  sc = makePartitions();
491  if ( !sc.isSuccess() ) {
492  error() << "Failed to connect to all store partitions." << endmsg;
493  return sc;
494  }
495  return attachServices();
496  }
497 
500  {
502  if ( !sc.isSuccess() ) {
503  error() << "Enable to reinitialize base class" << endmsg;
504  return sc;
505  }
506  detachServices();
507  sc = attachServices();
508  if ( !sc.isSuccess() ) {
509  error() << "Failed to attach necessary services." << endmsg;
510  return sc;
511  }
512  sc = makePartitions();
513  if ( !sc.isSuccess() ) {
514  error() << "Failed to connect to store partitions." << endmsg;
515  return sc;
516  }
517  // return
518  return StatusCode::SUCCESS;
519  }
520 
522  StatusCode finalize() override
523  {
524  setDataLoader( nullptr ).ignore();
525  clearStore().ignore();
526  clearPartitions().ignore();
527  m_current = Partition();
528  detachServices();
529  return Service::finalize();
530  }
531 
532  // protected:
533 
535  using extends::extends;
536 
538  ~MultiStoreSvc() override
539  {
540  setDataLoader( nullptr ).ignore();
541  resetPreLoad().ignore();
542  clearStore().ignore();
543  clearPartitions().ignore();
544  }
545 
548  {
550  for ( auto& i : m_partitions ) {
551  StatusCode sc = visit( m_root.root,
552  [&]( ADDRESS* address ) -> StatusCode {
553  if ( !address ) return StatusCode::FAILURE;
554  ADDRESS* pAdd = nullptr;
555  ADDRESS* p = address;
556  auto sc =
557  m_addrCreator->createAddress( p->svcType(), p->clID(), p->par(), p->ipar(), pAdd );
558  return sc.isSuccess() ? i.second.dataManager->setRoot( m_root.path, pAdd ) : sc;
559  },
560  [&]( OBJECT* object ) -> StatusCode {
561  if ( object && object->clID() == CLID_DataObject ) {
562  return i.second.dataManager->setRoot( m_root.path, new DataObject() );
563  }
564  return StatusCode::FAILURE;
565  },
566  []( boost::blank ) -> StatusCode { return StatusCode::FAILURE; } );
567  if ( !sc.isSuccess() ) iret = sc;
568  }
569  return iret;
570  }
571 
574  {
575  for ( auto& i : m_partitions ) i.second.dataManager->clearStore().ignore();
576  m_partitions.clear();
577  return StatusCode::SUCCESS;
578  }
579 
582  {
583  using Parser = Gaudi::Utils::AttribStringParser;
584  std::string typ, nam;
585  clearPartitions().ignore();
586  for ( auto part : m_partitionDefs ) {
587  for ( auto attrib : Parser( std::move( part ) ) ) {
588  switch (::toupper( attrib.tag[0] ) ) {
589  case 'N':
590  nam = std::move( attrib.value );
591  break;
592  case 'T':
593  typ = std::move( attrib.value );
594  break;
595  }
596  }
597  StatusCode sc = create( nam, typ );
598  if ( !sc.isSuccess() ) return sc;
599  if ( m_defaultPartition.empty() ) m_defaultPartition = nam;
600  }
601  return StatusCode::SUCCESS;
602  }
603 };
604 
605 // Instantiation of a static factory class used by clients to create
606 // 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.
constexpr static const auto FAILURE
Definition: StatusCode.h:88
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:63
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.
StatusCode fwd(Fun f)
StatusCode traverseTree(AGENT *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects in the data store.
StatusCode finalize() override
Definition: Service.cpp:173
Implementation of property with value of concrete type.
Definition: Property.h:383
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:287
Root type (address or object)
virtual StatusCode setDataProvider(IDataProviderSvc *pService)=0
Set Data provider service.
boost::variant< boost::blank, ADDRESS *, OBJECT * > root
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.
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:82
StatusCode setRoot(std::string path, OBJECT *pObj) override
Initialize data store for new event by giving new event path and root object.
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:51
typename arg_helper< lambda >::type argument_t
Definition: EventIDBase.h:35
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:277
T erase(T...args)
StatusCode clearPartitions()
Clear all partitions.
StatusCode unregisterObject(OBJECT *pObj) override
Unregister object from the data store.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
const std::string CSTR
StatusCode preparePartitions()
Prepare partition for usage.
DataObject OBJECT
StatusCode reinitialize() override
Definition: Service.cpp:249
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.
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
Partition m_current
Current partition.
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:165
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:64
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.
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 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:92
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.
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)
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:209
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.