The Gaudi Framework  v30r5 (c7afbd0d)
HiveWhiteBoard.cpp
Go to the documentation of this file.
1 //====================================================================
2 // WhiteBoard (Concurrent Event Data Store)
3 //--------------------------------------------------------------------
4 //
5 //====================================================================
6 // Include files
10 #include "GaudiKernel/DataSvc.h"
11 #include "GaudiKernel/MsgStream.h"
12 #include "GaudiKernel/Service.h"
13 #include "GaudiKernel/SmartIF.h"
15 #include "Rtypes.h"
16 #include "ThreadLocalStorage.h"
17 #include "boost/callable_traits.hpp"
18 #include "tbb/concurrent_queue.h"
19 #include "tbb/mutex.h"
20 #include "tbb/recursive_mutex.h"
21 #include <utility>
22 
23 // Interfaces
31 #include "GaudiKernel/IRegistry.h"
34 
35 namespace
36 {
37  struct Partition final {
38  SmartIF<IDataProviderSvc> dataProvider;
39  SmartIF<IDataManagerSvc> dataManager;
40  int eventNumber = -1;
41 
42  // allow acces 'by type' -- used in fwd
43  template <typename T>
44  T* get();
45  };
46  template <>
47  IDataProviderSvc* Partition::get<IDataProviderSvc>()
48  {
49  return dataProvider.get();
50  }
51  template <>
52  IDataManagerSvc* Partition::get<IDataManagerSvc>()
53  {
54  return dataManager.get();
55  }
56 
57  // C++20: replace with http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0290r2.html
58  // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4033.html
59 
60  template <typename T, typename Mutex = tbb::recursive_mutex, typename ReadLock = typename Mutex::scoped_lock,
61  typename WriteLock = ReadLock>
62  class Synced
63  {
64  T m_obj;
65  mutable Mutex m_mtx;
66 
67  public:
68  template <typename F>
69  decltype( auto ) with_lock( F&& f )
70  {
71  WriteLock lock{m_mtx};
72  return f( m_obj );
73  }
74  template <typename F>
75  decltype( auto ) with_lock( F&& f ) const
76  {
77  ReadLock lock{m_mtx};
78  return f( m_obj );
79  }
80  };
81  // transform an f(T) into an f(Synced<T>)
82  template <typename Fun>
83  auto with_lock( Fun&& f )
84  {
85  return [f = std::forward<Fun>( f )]( auto& p )->decltype( auto ) { return p.with_lock( f ); };
86  }
87  // call f(T) for each element in a container of Synced<T>
88  template <typename ContainerOfSynced, typename Fun>
89  void for_( ContainerOfSynced& c, Fun&& f )
90  {
91  std::for_each( begin( c ), end( c ), with_lock( std::forward<Fun>( f ) ) );
92  }
93 }
94 
95 TTHREAD_TLS( Synced<Partition>* ) s_current = nullptr;
96 
97 namespace
98 {
99  namespace detail
100  {
101  // given a callable F(Arg_t,...)
102  // argument_t<F> will be equal to Arg_t
103  template <typename F>
104  using argument_t = std::tuple_element_t<0, boost::callable_traits::args_t<F>>;
105  }
106 
107  template <typename Fun>
108  StatusCode fwd( Fun f )
109  {
110  if ( !s_current ) return IDataProviderSvc::Status::INVALID_ROOT;
111  return s_current->with_lock( [&]( Partition& p ) {
112  auto* svc = p.get<std::decay_t<detail::argument_t<Fun>>>();
113  return svc ? f( *svc ) : IDataProviderSvc::Status::INVALID_ROOT;
114  } );
115  }
116 }
117 
130 class HiveWhiteBoard : public extends<Service, IDataProviderSvc, IDataManagerSvc, IHiveWhiteBoard>
131 {
132 protected:
133  Gaudi::Property<CLID> m_rootCLID{this, "RootCLID", 110 /*CLID_Event*/, "CLID of root entry"};
134  Gaudi::Property<std::string> m_rootName{this, "RootName", "/Event", "name of root entry"};
135  Gaudi::Property<std::string> m_loader{this, "DataLoader", "EventPersistencySvc", ""};
136  Gaudi::Property<size_t> m_slots{this, "EventSlots", 1, "number of event slots"};
137  Gaudi::Property<bool> m_forceLeaves{this, "ForceLeaves", false, "force creation of default leaves on registerObject"};
138  Gaudi::Property<bool> m_enableFaultHdlr{this, "EnableFaultHandler", false,
139  "enable incidents on data creation requests"};
140 
142  IConversionSvc* m_dataLoader = nullptr;
144  IAddressCreator* m_addrCreator = nullptr;
148  tbb::concurrent_queue<size_t> m_freeSlots;
149 
150 public:
152  using extends::extends;
153 
155  ~HiveWhiteBoard() override
156  {
157  setDataLoader( 0 ).ignore();
158  resetPreLoad().ignore();
159  clearStore().ignore();
160  for_( m_partitions, []( Partition& p ) {
161  p.dataManager->release();
162  p.dataProvider->release();
163  } );
164  m_partitions.clear();
165  }
166 
168  size_t freeSlots() override { return m_freeSlots.unsafe_size(); }
169 
171  CLID rootCLID() const override { return (CLID)m_rootCLID; }
173  const std::string& rootName() const override { return m_rootName; }
174 
176  StatusCode registerAddress( boost::string_ref path, IOpaqueAddress* pAddr ) override
177  {
178  return fwd( [&]( IDataManagerSvc& p ) { return p.registerAddress( path, pAddr ); } );
179  }
181  StatusCode registerAddress( IRegistry* parent, boost::string_ref path, IOpaqueAddress* pAdd ) override
182  {
183  return fwd( [&]( IDataManagerSvc& p ) { return p.registerAddress( parent, path, pAdd ); } );
184  }
186  StatusCode unregisterAddress( boost::string_ref path ) override
187  {
188  return fwd( [&]( IDataManagerSvc& p ) { return p.unregisterAddress( path ); } );
189  }
191  StatusCode unregisterAddress( IRegistry* pParent, boost::string_ref path ) override
192  {
193  return fwd( [&]( IDataManagerSvc& p ) { return p.unregisterAddress( pParent, path ); } );
194  }
196  StatusCode objectLeaves( const DataObject* pObject, std::vector<IRegistry*>& leaves ) override
197  {
198  return fwd( [&]( IDataManagerSvc& p ) { return p.objectLeaves( pObject, leaves ); } );
199  }
201  StatusCode objectLeaves( const IRegistry* pObject, std::vector<IRegistry*>& leaves ) override
202  {
203  return fwd( [&]( IDataManagerSvc& p ) { return p.objectLeaves( pObject, leaves ); } );
204  }
206  StatusCode objectParent( const DataObject* pObject, IRegistry*& refpParent ) override
207  {
208  return fwd( [&]( IDataManagerSvc& p ) { return p.objectParent( pObject, refpParent ); } );
209  }
211  StatusCode objectParent( const IRegistry* pObject, IRegistry*& refpParent ) override
212  {
213  return fwd( [&]( IDataManagerSvc& p ) { return p.objectParent( pObject, refpParent ); } );
214  }
216  StatusCode clearSubTree( boost::string_ref path ) override
217  {
218  return fwd( [&]( IDataManagerSvc& p ) { return p.clearSubTree( path ); } );
219  }
221  StatusCode clearSubTree( DataObject* pObject ) override
222  {
223  return fwd( [&]( IDataManagerSvc& p ) { return p.clearSubTree( pObject ); } );
224  }
227  {
228  for_( m_partitions, []( Partition& p ) { p.dataManager->clearStore().ignore(); } );
229  return StatusCode::SUCCESS;
230  }
231 
233  StatusCode traverseSubTree( boost::string_ref path, IDataStoreAgent* pAgent ) override
234  {
235  return fwd( [&]( IDataManagerSvc& p ) { return p.traverseSubTree( path, pAgent ); } );
236  }
238  StatusCode traverseSubTree( DataObject* pObject, IDataStoreAgent* pAgent ) override
239  {
240  return fwd( [&]( IDataManagerSvc& p ) { return p.traverseSubTree( pObject, pAgent ); } );
241  }
244  {
245  return fwd( [&]( IDataManagerSvc& p ) { return p.traverseTree( pAgent ); } );
246  }
250  {
251  return fwd(
252  [ pObj, path = std::move( path ) ]( IDataManagerSvc & p ) { return p.setRoot( std::move( path ), pObj ); } );
253  }
254 
258  {
259  return fwd(
260  [ pAddr, path = std::move( path ) ]( IDataManagerSvc & p ) { return p.setRoot( std::move( path ), pAddr ); } );
261  }
262 
268  IDataProviderSvc* dpsvc __attribute__( ( unused ) ) = nullptr ) override
269  {
270  if ( pDataLoader ) pDataLoader->addRef();
271  if ( m_dataLoader ) m_dataLoader->release();
272  if ( pDataLoader ) pDataLoader->setDataProvider( this );
273  m_dataLoader = pDataLoader;
274  for_( m_partitions, [&]( Partition& p ) { p.dataManager->setDataLoader( m_dataLoader, this ).ignore(); } );
275  return StatusCode::SUCCESS;
276  }
278  StatusCode addPreLoadItem( const DataStoreItem& item ) override
279  {
280  for_( m_partitions, [&]( Partition& p ) { p.dataProvider->addPreLoadItem( item ); } );
281  return StatusCode::SUCCESS;
282  }
285  {
286  for_( m_partitions, [&]( Partition& p ) { p.dataProvider->removePreLoadItem( item ); } );
287  return StatusCode::SUCCESS;
288  }
291  {
292  for_( m_partitions, [&]( Partition& p ) { p.dataProvider->resetPreLoad(); } );
293  return StatusCode::SUCCESS;
294  }
296  StatusCode preLoad() override
297  {
298  return fwd( [&]( IDataProviderSvc& p ) { return p.preLoad(); } );
299  }
301  StatusCode registerObject( boost::string_ref parent, boost::string_ref obj, DataObject* pObj ) override
302  {
303  return fwd( [&]( IDataProviderSvc& p ) { return p.registerObject( parent, obj, pObj ); } );
304  }
306  StatusCode registerObject( DataObject* parent, boost::string_ref obj, DataObject* pObj ) override
307  {
308  return fwd( [&]( IDataProviderSvc& p ) { return p.registerObject( parent, obj, pObj ); } );
309  }
311  StatusCode unregisterObject( boost::string_ref path ) override
312  {
313  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( path ); } );
314  }
317  {
318  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( pObj ); } );
319  }
321  StatusCode unregisterObject( DataObject* pObj, boost::string_ref path ) override
322  {
323  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( pObj, path ); } );
324  }
326  StatusCode retrieveObject( IRegistry* parent, boost::string_ref path, DataObject*& pObj ) override
327  {
328  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( parent, path, pObj ); } );
329  }
331  StatusCode findObject( boost::string_ref path, DataObject*& pObj ) override
332  {
333  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( path, pObj ); } );
334  }
336  StatusCode findObject( IRegistry* parent, boost::string_ref path, DataObject*& pObj ) override
337  {
338  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( parent, path, pObj ); } );
339  }
341  StatusCode linkObject( IRegistry* from, boost::string_ref objPath, DataObject* to ) override
342  {
343  return fwd( [&]( IDataProviderSvc& p ) { return p.linkObject( from, objPath, to ); } );
344  }
346  StatusCode linkObject( boost::string_ref fullPath, DataObject* to ) override
347  {
348  return fwd( [&]( IDataProviderSvc& p ) { return p.linkObject( fullPath, to ); } );
349  }
351  StatusCode unlinkObject( IRegistry* from, boost::string_ref objPath ) override
352  {
353  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( from, objPath ); } );
354  }
356  StatusCode unlinkObject( DataObject* from, boost::string_ref objPath ) override
357  {
358  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( from, objPath ); } );
359  }
361  StatusCode unlinkObject( boost::string_ref path ) override
362  {
363  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( path ); } );
364  }
366  StatusCode updateObject( IRegistry* pDirectory ) override
367  {
368  return fwd( [&]( IDataProviderSvc& p ) { return p.updateObject( pDirectory ); } );
369  }
372  {
373  return fwd( [&]( IDataProviderSvc& p ) { return p.updateObject( pObj ); } );
374  }
375 
376  //
377  //---IHiveWhiteBard implemenation--------------------------------------------------
378  //
379 
381  StatusCode clearStore( size_t partition ) override
382  {
383  return m_partitions[partition].with_lock( []( Partition& p ) { return p.dataManager->clearStore(); } );
384  }
385 
387  StatusCode selectStore( size_t partition ) override
388  {
389  s_current = &m_partitions[partition];
390  return StatusCode::SUCCESS;
391  }
392 
394  StatusCode setNumberOfStores( size_t slots ) override
395  {
396  if ( FSMState() == Gaudi::StateMachine::INITIALIZED || FSMState() == Gaudi::StateMachine::RUNNING ) {
397  warning() << "Too late to change the number of slots!" << endmsg;
398  return StatusCode::FAILURE;
399  }
400  m_slots = slots;
402  return StatusCode::SUCCESS;
403  }
404 
406  size_t getNumberOfStores() const override { return m_slots; }
407 
409  bool exists( const DataObjID& id ) override
410  {
411  DataObject* pObject{nullptr};
412  return findObject( id.fullKey(), pObject ).isSuccess();
413  }
414 
416  size_t allocateStore( int evtnumber ) override
417  {
418  // take next free slot in the list
419  size_t slot = std::string::npos;
420  if ( m_freeSlots.try_pop( slot ) ) {
421  assert( slot != std::string::npos );
422  assert( slot < m_partitions.size() );
423  m_partitions[slot].with_lock( [evtnumber]( Partition& p ) {
424  assert( p.eventNumber == -1 ); // or whatever value represents 'free'
425  p.eventNumber = evtnumber;
426  } );
427  }
428  return slot;
429  }
430 
432  StatusCode freeStore( size_t partition ) override
433  {
434  assert( partition < m_partitions.size() );
435  auto prev = m_partitions[partition].with_lock( []( Partition& p ) { return std::exchange( p.eventNumber, -1 ); } );
436  if ( UNLIKELY( prev == -1 ) ) return StatusCode::FAILURE; // double free -- should never happen!
437  m_freeSlots.push( partition );
438  return StatusCode::SUCCESS;
439  }
440 
442  size_t getPartitionNumber( int eventnumber ) const override
443  {
444  auto i = std::find_if( begin( m_partitions ), end( m_partitions ),
445  with_lock( [eventnumber]( const Partition& p ) { return p.eventNumber == eventnumber; } ) );
446  return i != end( m_partitions ) ? std::distance( begin( m_partitions ), i ) : std::string::npos;
447  }
448 
450  {
451  StatusCode sc = service( m_loader, m_addrCreator, true );
452  if ( !sc.isSuccess() ) {
453  error() << "Failed to retrieve data loader "
454  << "\"" << m_loader << "\"" << endmsg;
455  return sc;
456  }
457  IConversionSvc* dataLoader = nullptr;
458  sc = service( m_loader, dataLoader, true );
459  if ( !sc.isSuccess() ) {
460  error() << MSG::ERROR << "Failed to retrieve data loader "
461  << "\"" << m_loader << "\"" << endmsg;
462  return sc;
463  }
464  sc = setDataLoader( dataLoader );
465  dataLoader->release();
466  if ( !sc.isSuccess() ) {
467  error() << MSG::ERROR << "Failed to set data loader "
468  << "\"" << m_loader << "\"" << endmsg;
469  return sc;
470  }
471  return sc;
472  }
473 
475  {
476  if ( m_addrCreator ) m_addrCreator->release();
477  if ( m_dataLoader ) m_dataLoader->release();
478  m_addrCreator = nullptr;
479  m_dataLoader = nullptr;
480  return StatusCode::SUCCESS;
481  }
482 
483  //
484  //---IService implemenation---------------------------------------------------------
485  //
486 
489  {
491  if ( !sc.isSuccess() ) {
492  error() << "Unable to initialize base class" << endmsg;
493  return sc;
494  }
495  if ( m_slots < (size_t)1 ) {
496  error() << "Invalid number of slots (" << m_slots << ")" << endmsg;
497  return StatusCode::FAILURE;
498  }
499 
500  if ( !setNumberOfStores( m_slots ).isSuccess() ) {
501  error() << "Cannot set number of slots" << endmsg;
502  return StatusCode::FAILURE;
503  }
504 
505  m_partitions = std::vector<Synced<Partition>>( m_slots );
506  for ( size_t i = 0; i < m_slots; i++ ) {
507  DataSvc* svc = new DataSvc( name() + "_" + std::to_string( i ), serviceLocator() );
508  // Percolate properties
509  svc->setProperty( m_rootCLID ).ignore();
510  svc->setProperty( m_rootName ).ignore();
511  svc->setProperty( m_forceLeaves ).ignore();
512  svc->setProperty( m_enableFaultHdlr ).ignore();
513  // make sure that CommonMessaging is initialized
514  svc->setProperty( m_outputLevel ).ignore();
515 
516  sc = svc->initialize();
517  if ( !sc.isSuccess() ) {
518  error() << "Failed to instantiate DataSvc as store partition" << endmsg;
519  return sc;
520  }
521  m_partitions[i].with_lock( [&]( Partition& p ) {
522  p.dataProvider = svc;
523  p.dataManager = svc;
524  } );
525  m_freeSlots.push( i );
526  }
527  selectStore( 0 ).ignore();
528  return attachServices();
529  }
530 
533  {
535  if ( !sc.isSuccess() ) {
536  error() << "Unable to reinitialize base class" << endmsg;
537  return sc;
538  }
539  detachServices();
540  sc = attachServices();
541  if ( !sc.isSuccess() ) {
542  error() << "Failed to attach necessary services." << endmsg;
543  return sc;
544  }
545  return StatusCode::SUCCESS;
546  }
547 
549  StatusCode finalize() override
550  {
551  setDataLoader( 0 ).ignore();
552  clearStore().ignore();
553  return Service::finalize();
554  }
555 };
556 
557 // Instantiation of a static factory class used by clients to create
558 // instances of this service
virtual StatusCode traverseTree(IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects in the data store.
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
#define UNLIKELY(x)
Definition: Kernel.h:89
constexpr static const auto FAILURE
Definition: StatusCode.h:88
StatusCode initialize() override
Definition: Service.cpp:63
StatusCode unregisterObject(DataObject *pObj) override
Unregister object from the data store.
#define __attribute__(x)
Definition: System.cpp:89
size_t allocateStore(int evtnumber) override
Allocate a store partition for a given event number.
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 ...
virtual StatusCode unlinkObject(IRegistry *from, boost::string_ref objPath)=0
Remove a link to another object.
T distance(T...args)
StatusCode setDataLoader(IConversionSvc *pDataLoader, IDataProviderSvc *dpsvc __attribute__((unused))=nullptr) override
IDataManagerSvc: Pass a default data loader to the service.
StatusCode finalize() override
Definition: Service.cpp:173
StatusCode linkObject(boost::string_ref fullPath, DataObject *to) override
Add a link to another object.
Implementation of property with value of concrete type.
Definition: Property.h:383
StatusCode setProperty(const Gaudi::Details::PropertyBase &p) override
set the property form another property
StatusCode freeStore(size_t partition) override
Free a store partition.
StatusCode unlinkObject(IRegistry *from, boost::string_ref objPath) override
Remove a link to another object.
size_t getPartitionNumber(int eventnumber) const override
Get the partition number corresponding to a given event.
StatusCode clearStore(size_t partition) override
Remove all data objects in one &#39;slot&#39; of the data store.
bool isSuccess() const
Definition: StatusCode.h:287
StatusCode registerAddress(boost::string_ref path, IOpaqueAddress *pAddr) override
IDataManagerSvc: Register object address with the data store.
virtual StatusCode setRoot(std::string root_name, DataObject *pObject)=0
Initialize data store for new event by giving new event path.
T to_string(T...args)
IAddressCreator interface definition.
StatusCode unlinkObject(boost::string_ref path) override
Remove a link to another object.
virtual StatusCode setDataProvider(IDataProviderSvc *pService)=0
Set Data provider service.
StatusCode findObject(IRegistry *parent, boost::string_ref path, DataObject *&pObj) override
Find object identified by its full path in the data store.
virtual StatusCode preLoad()=0
Load all preload items of the list.
StatusCode unregisterAddress(boost::string_ref path) override
IDataManagerSvc: Unregister object address from the data store.
StatusCode resetPreLoad() override
Clear the preload list.
StatusCode finalize() override
Service initialisation.
StatusCode clearSubTree(DataObject *pObject) override
Remove all data objects below the sub tree identified.
size_t getNumberOfStores() const override
Get the number of event slots (copies of DataSvc objects).
StatusCode objectParent(const IRegistry *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object&#39;s parent.
StatusCode addPreLoadItem(const DataStoreItem &item) override
Add an item to the preload list.
StatusCode updateObject(DataObject *pObj) override
Update object.
std::vector< Synced< Partition > > m_partitions
Datastore partitions.
Data provider interface definition.
StatusCode preLoad() override
load all preload items of the list
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
StatusCode unlinkObject(DataObject *from, boost::string_ref objPath) override
Remove a link to another object.
size_t freeSlots() override
Get free slots number.
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...
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
StatusCode selectStore(size_t partition) override
Activate a partition object. The identifies the partition uniquely.
Invalid root path object cannot be retrieved or stored.
STL class.
virtual StatusCode linkObject(IRegistry *from, boost::string_ref objPath, DataObject *toObj)=0
Add a link to another object.
#define DECLARE_COMPONENT(type)
StatusCode detachServices()
TupleObj.h GaudiAlg/TupleObj.h namespace with few technical implementations.
StatusCode unregisterAddress(IRegistry *pParent, boost::string_ref path) override
IDataManagerSvc: Unregister object address from the data store.
StatusCode objectLeaves(const IRegistry *pObject, std::vector< IRegistry * > &leaves) override
Explore the object store: retrieve all leaves attached to the object.
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
virtual StatusCode updateObject(IRegistry *pDirectory)=0
Update object identified by its directory entry.
StatusCode linkObject(IRegistry *from, boost::string_ref objPath, DataObject *to) override
Add a link to another object.
StatusCode unregisterObject(boost::string_ref path) override
Unregister object from the data store.
T lock(T...args)
StatusCode removePreLoadItem(const DataStoreItem &item) override
Remove an item from the preload list.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
StatusCode reinitialize() override
Definition: Service.cpp:249
StatusCode traverseSubTree(boost::string_ref path, IDataStoreAgent *pAgent) override
Analyze by traversing all data objects below the sub tree.
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)
StatusCode clearSubTree(boost::string_ref path) override
Remove all data objects below the sub tree identified.
T move(T...args)
Data service base class.
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
TTHREAD_TLS(Synced< Partition > *) s_current
StatusCode attachServices()
StatusCode traverseSubTree(DataObject *pObject, IDataStoreAgent *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects below the sub tree.
virtual StatusCode unregisterAddress(boost::string_ref fullPath)=0
Unregister object address from the data store.
T find_if(T...args)
T size(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 objectParent(const DataObject *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object&#39;s parent.
StatusCode setRoot(std::string path, IOpaqueAddress *pAddr) override
Initialize data store for new event by giving new event path and address of root object.
STL class.
virtual unsigned long release()=0
Release Interface instance.
Generic data agent interface.
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
StatusCode initialize() override
Service initialization.
Definition: DataSvc.cpp:900
StatusCode unregisterObject(DataObject *pObj, boost::string_ref path) override
Unregister object from the data store.
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:165
StatusCode setRoot(std::string path, DataObject *pObj) override
Initialize data store for new event by giving new event path and root object.
CLID rootCLID() const override
IDataManagerSvc: Accessor for root event CLID.
Data service base class.
Definition: DataSvc.h:43
virtual StatusCode registerAddress(boost::string_ref fullPath, IOpaqueAddress *pAddress)=0
Register object address with the data store.
StatusCode registerAddress(IRegistry *parent, boost::string_ref path, IOpaqueAddress *pAdd) override
IDataManagerSvc: Register object address with the data store.
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &leaves) override
Explore the object store: retrieve all leaves attached to the object.
StatusCode registerObject(DataObject *parent, boost::string_ref obj, DataObject *pObj) override
Register object with the data store.
StatusCode initialize() override
Service initialisation.
StatusCode traverseTree(IDataStoreAgent *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects in the data store.
AttribStringParser::Iterator begin(const AttribStringParser &parser)
StatusCode findObject(boost::string_ref path, DataObject *&pObj) override
Find object identified by its full path in the data store.
Opaque address interface definition.
StatusCode registerObject(boost::string_ref parent, boost::string_ref obj, DataObject *pObj) override
Register object with the data store.
T for_each(T...args)
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
tbb::concurrent_queue< size_t > m_freeSlots
fifo queue of free slots
bool exists(const DataObjID &id) override
check if a data object exists in the current store
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
const std::string & rootName() const override
Name for root Event.
static GAUDI_API void setNumConcEvents(const std::size_t &nE)
StatusCode reinitialize() override
Service initialisation.
StatusCode retrieveObject(IRegistry *parent, boost::string_ref path, DataObject *&pObj) override
Retrieve object from data store.
StatusCode setNumberOfStores(size_t slots) override
Set the number of event slots (copies of DataSvc objects).
~HiveWhiteBoard() override
Standard Destructor.