The Gaudi Framework  master (37c0b60a)
HiveWhiteBoard.cpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 //====================================================================
12 // WhiteBoard (Concurrent Event Data Store)
13 //--------------------------------------------------------------------
14 //
15 //====================================================================
16 // Include files
18 #include <GaudiKernel/DataObjID.h>
19 #include <GaudiKernel/DataObject.h>
20 #include <GaudiKernel/DataSvc.h>
21 #include <GaudiKernel/MsgStream.h>
22 #include <GaudiKernel/Service.h>
23 #include <GaudiKernel/SmartIF.h>
25 #include <Rtypes.h>
26 #include <ThreadLocalStorage.h>
27 #include <boost/callable_traits.hpp>
28 #include <mutex>
29 #include <tbb/concurrent_queue.h>
30 #include <utility>
31 
32 // Interfaces
40 #include <GaudiKernel/IRegistry.h>
43 
44 namespace {
45  struct Partition final {
46  SmartIF<IDataProviderSvc> dataProvider;
47  SmartIF<IDataManagerSvc> dataManager;
48  int eventNumber = -1;
49 
50  // allow acces 'by type' -- used in fwd
51  template <typename T>
52  T* get();
53  };
54  template <>
55  IDataProviderSvc* Partition::get<IDataProviderSvc>() {
56  return dataProvider.get();
57  }
58  template <>
59  IDataManagerSvc* Partition::get<IDataManagerSvc>() {
60  return dataManager.get();
61  }
62 
63  // C++20: replace with http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0290r2.html
64  // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4033.html
65 
66  template <typename T, typename Mutex = std::recursive_mutex, typename ReadLock = std::scoped_lock<Mutex>,
67  typename WriteLock = ReadLock>
68  class Synced {
69  T m_obj;
70  mutable Mutex m_mtx;
71 
72  public:
73  template <typename F>
74  decltype( auto ) with_lock( F&& f ) {
75  WriteLock lock{ m_mtx };
76  return f( m_obj );
77  }
78  template <typename F>
79  decltype( auto ) with_lock( F&& f ) const {
80  ReadLock lock{ m_mtx };
81  return f( m_obj );
82  }
83  };
84  // transform an f(T) into an f(Synced<T>)
85  template <typename Fun>
86  auto with_lock( Fun&& f ) {
87  return [f = std::forward<Fun>( f )]( auto& p ) -> decltype( auto ) { return p.with_lock( f ); };
88  }
89  // call f(T) for each element in a container of Synced<T>
90  template <typename ContainerOfSynced, typename Fun>
91  void for_( ContainerOfSynced& c, Fun&& f ) {
92  std::for_each( begin( c ), end( c ), with_lock( std::forward<Fun>( f ) ) );
93  }
94 } // namespace
95 
96 TTHREAD_TLS( Synced<Partition>* ) s_current = nullptr;
97 
98 namespace {
99  namespace detail {
100  // given a callable F(Arg_t,...)
101  // argument_t<F> will be equal to Arg_t
102  template <typename F>
103  using argument_t = std::tuple_element_t<0, boost::callable_traits::args_t<F>>;
104  } // namespace detail
105 
106  template <typename Fun>
107  StatusCode fwd( Fun f ) {
108  if ( !s_current ) return IDataProviderSvc::Status::INVALID_ROOT;
109  return s_current->with_lock( [&]( Partition& p ) {
110  auto* svc = p.get<std::decay_t<detail::argument_t<Fun>>>();
111  return svc ? f( *svc ) : IDataProviderSvc::Status::INVALID_ROOT;
112  } );
113  }
114 } // namespace
115 
128 class HiveWhiteBoard : public extends<Service, IDataProviderSvc, IDataManagerSvc, IHiveWhiteBoard> {
129 protected:
130  Gaudi::Property<CLID> m_rootCLID{ this, "RootCLID", 110 /*CLID_Event*/, "CLID of root entry" };
131  Gaudi::Property<std::string> m_rootName{ this, "RootName", "/Event", "name of root entry" };
132  Gaudi::Property<std::string> m_loader{ this, "DataLoader", "EventPersistencySvc", "" };
133  Gaudi::Property<size_t> m_slots{ this, "EventSlots", 1, "number of event slots" };
134  Gaudi::Property<bool> m_forceLeaves{ this, "ForceLeaves", false,
135  "force creation of default leaves on registerObject" };
136  Gaudi::Property<bool> m_enableFaultHdlr{ this, "EnableFaultHandler", false,
137  "enable incidents on data creation requests" };
138  Gaudi::Property<std::vector<std::string>> m_inhibitPathes{ this, "InhibitPathes", {}, "inhibited leaves" };
139 
147  tbb::concurrent_queue<size_t> m_freeSlots;
148 
149 public:
151  using extends::extends;
152 
154  ~HiveWhiteBoard() override {
155  setDataLoader( 0 ).ignore();
156  resetPreLoad().ignore();
157  clearStore().ignore();
158  for_( m_partitions, []( Partition& p ) {
159  p.dataManager->release();
160  p.dataProvider->release();
161  } );
163  }
164 
166  size_t freeSlots() override { return m_freeSlots.unsafe_size(); }
167 
169  CLID rootCLID() const override { return (CLID)m_rootCLID; }
171  const std::string& rootName() const override { return m_rootName; }
172 
174  StatusCode registerAddress( std::string_view path, IOpaqueAddress* pAddr ) override {
175  return fwd( [&]( IDataManagerSvc& p ) { return p.registerAddress( path, pAddr ); } );
176  }
178  StatusCode registerAddress( IRegistry* parent, std::string_view path, IOpaqueAddress* pAdd ) override {
179  return fwd( [&]( IDataManagerSvc& p ) { return p.registerAddress( parent, path, pAdd ); } );
180  }
182  StatusCode unregisterAddress( std::string_view path ) override {
183  return fwd( [&]( IDataManagerSvc& p ) { return p.unregisterAddress( path ); } );
184  }
186  StatusCode unregisterAddress( IRegistry* pParent, std::string_view path ) override {
187  return fwd( [&]( IDataManagerSvc& p ) { return p.unregisterAddress( pParent, path ); } );
188  }
190  StatusCode objectLeaves( const DataObject* pObject, std::vector<IRegistry*>& leaves ) override {
191  return fwd( [&]( IDataManagerSvc& p ) { return p.objectLeaves( pObject, leaves ); } );
192  }
194  StatusCode objectLeaves( const IRegistry* pObject, std::vector<IRegistry*>& leaves ) override {
195  return fwd( [&]( IDataManagerSvc& p ) { return p.objectLeaves( pObject, leaves ); } );
196  }
198  StatusCode objectParent( const DataObject* pObject, IRegistry*& refpParent ) override {
199  return fwd( [&]( IDataManagerSvc& p ) { return p.objectParent( pObject, refpParent ); } );
200  }
202  StatusCode objectParent( const IRegistry* pObject, IRegistry*& refpParent ) override {
203  return fwd( [&]( IDataManagerSvc& p ) { return p.objectParent( pObject, refpParent ); } );
204  }
206  StatusCode clearSubTree( std::string_view path ) override {
207  return fwd( [&]( IDataManagerSvc& p ) { return p.clearSubTree( path ); } );
208  }
210  StatusCode clearSubTree( DataObject* pObject ) override {
211  return fwd( [&]( IDataManagerSvc& p ) { return p.clearSubTree( pObject ); } );
212  }
214  StatusCode clearStore() override {
215  for_( m_partitions, []( Partition& p ) { p.dataManager->clearStore().ignore(); } );
216  return StatusCode::SUCCESS;
217  }
218 
220  StatusCode traverseSubTree( std::string_view path, IDataStoreAgent* pAgent ) override {
221  return fwd( [&]( IDataManagerSvc& p ) { return p.traverseSubTree( path, pAgent ); } );
222  }
224  StatusCode traverseSubTree( DataObject* pObject, IDataStoreAgent* pAgent ) override {
225  return fwd( [&]( IDataManagerSvc& p ) { return p.traverseSubTree( pObject, pAgent ); } );
226  }
229  return fwd( [&]( IDataManagerSvc& p ) { return p.traverseTree( pAgent ); } );
230  }
234  return fwd(
235  [pObj, path = std::move( path )]( IDataManagerSvc& p ) { return p.setRoot( std::move( path ), pObj ); } );
236  }
237 
241  return fwd(
242  [pAddr, path = std::move( path )]( IDataManagerSvc& p ) { return p.setRoot( std::move( path ), pAddr ); } );
243  }
244 
249  StatusCode setDataLoader( IConversionSvc* pDataLoader, IDataProviderSvc* = nullptr ) override {
250  if ( pDataLoader ) pDataLoader->addRef();
251  if ( pDataLoader ) pDataLoader->setDataProvider( this ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
252  m_dataLoader = pDataLoader;
253  for_( m_partitions, [&]( Partition& p ) { p.dataManager->setDataLoader( m_dataLoader, this ).ignore(); } );
254  return StatusCode::SUCCESS;
255  }
257  StatusCode addPreLoadItem( const DataStoreItem& item ) override {
258  for_( m_partitions, [&]( Partition& p ) {
259  p.dataProvider->addPreLoadItem( item ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
260  } );
261  return StatusCode::SUCCESS;
262  }
264  StatusCode removePreLoadItem( const DataStoreItem& item ) override {
265  for_( m_partitions, [&]( Partition& p ) {
266  p.dataProvider->removePreLoadItem( item ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
267  } );
268  return StatusCode::SUCCESS;
269  }
272  for_( m_partitions, [&]( Partition& p ) {
273  p.dataProvider->resetPreLoad().ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
274  } );
275  return StatusCode::SUCCESS;
276  }
278  StatusCode preLoad() override {
279  return fwd( [&]( IDataProviderSvc& p ) { return p.preLoad(); } );
280  }
282  StatusCode registerObject( std::string_view parent, std::string_view obj, DataObject* pObj ) override {
283  return fwd( [&]( IDataProviderSvc& p ) { return p.registerObject( parent, obj, pObj ); } );
284  }
286  StatusCode registerObject( DataObject* parent, std::string_view obj, DataObject* pObj ) override {
287  return fwd( [&]( IDataProviderSvc& p ) { return p.registerObject( parent, obj, pObj ); } );
288  }
290  StatusCode unregisterObject( std::string_view path ) override {
291  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( path ); } );
292  }
295  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( pObj ); } );
296  }
298  StatusCode unregisterObject( DataObject* pObj, std::string_view path ) override {
299  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( pObj, path ); } );
300  }
302  StatusCode retrieveObject( IRegistry* parent, std::string_view path, DataObject*& pObj ) override {
303  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( parent, path, pObj ); } );
304  }
306  StatusCode findObject( std::string_view path, DataObject*& pObj ) override {
307  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( path, pObj ); } );
308  }
310  StatusCode findObject( IRegistry* parent, std::string_view path, DataObject*& pObj ) override {
311  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( parent, path, pObj ); } );
312  }
314  StatusCode linkObject( IRegistry* from, std::string_view objPath, DataObject* to ) override {
315  return fwd( [&]( IDataProviderSvc& p ) { return p.linkObject( from, objPath, to ); } );
316  }
318  StatusCode linkObject( std::string_view fullPath, DataObject* to ) override {
319  return fwd( [&]( IDataProviderSvc& p ) { return p.linkObject( fullPath, to ); } );
320  }
322  StatusCode unlinkObject( IRegistry* from, std::string_view objPath ) override {
323  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( from, objPath ); } );
324  }
326  StatusCode unlinkObject( DataObject* from, std::string_view objPath ) override {
327  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( from, objPath ); } );
328  }
330  StatusCode unlinkObject( std::string_view path ) override {
331  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( path ); } );
332  }
334  StatusCode updateObject( IRegistry* pDirectory ) override {
335  return fwd( [&]( IDataProviderSvc& p ) { return p.updateObject( pDirectory ); } );
336  }
338  StatusCode updateObject( DataObject* pObj ) override {
339  return fwd( [&]( IDataProviderSvc& p ) { return p.updateObject( pObj ); } );
340  }
341 
342  //
343  //---IHiveWhiteBard implemenation--------------------------------------------------
344  //
345 
347  StatusCode clearStore( size_t partition ) override {
348  return m_partitions[partition].with_lock( []( Partition& p ) { return p.dataManager->clearStore(); } );
349  }
350 
352  StatusCode selectStore( size_t partition ) override {
353  s_current = &m_partitions[partition];
354  return StatusCode::SUCCESS;
355  }
356 
358  StatusCode setNumberOfStores( size_t slots ) override {
360  warning() << "Too late to change the number of slots!" << endmsg;
361  return StatusCode::FAILURE;
362  }
363  m_slots = slots;
365  return StatusCode::SUCCESS;
366  }
367 
369  size_t getNumberOfStores() const override { return m_slots; }
370 
372  bool exists( const DataObjID& id ) override {
373  DataObject* pObject{ nullptr };
374  return findObject( id.fullKey(), pObject ).isSuccess();
375  }
376 
378  size_t allocateStore( int evtnumber ) override {
379  // take next free slot in the list
380  size_t slot = std::string::npos;
381  if ( m_freeSlots.try_pop( slot ) ) {
382  assert( slot != std::string::npos );
383  assert( slot < m_partitions.size() );
384  m_partitions[slot].with_lock( [evtnumber]( Partition& p ) {
385  assert( p.eventNumber == -1 ); // or whatever value represents 'free'
386  p.eventNumber = evtnumber;
387  } );
388  }
389  return slot;
390  }
391 
393  StatusCode freeStore( size_t partition ) override {
394  assert( partition < m_partitions.size() );
395  auto prev = m_partitions[partition].with_lock( []( Partition& p ) { return std::exchange( p.eventNumber, -1 ); } );
396  if ( prev == -1 ) return StatusCode::FAILURE; // double free -- should never happen!
397  m_freeSlots.push( partition );
398  return StatusCode::SUCCESS;
399  }
400 
402  size_t getPartitionNumber( int eventnumber ) const override {
404  with_lock( [eventnumber]( const Partition& p ) { return p.eventNumber == eventnumber; } ) );
405  return i != end( m_partitions ) ? std::distance( begin( m_partitions ), i ) : std::string::npos;
406  }
407 
409  m_addrCreator = service( m_loader, true );
410  if ( !m_addrCreator ) {
411  error() << "Failed to retrieve data loader "
412  << "\"" << m_loader << "\"" << endmsg;
413  return StatusCode::FAILURE;
414  }
415  SmartIF<IConversionSvc> dataLoader{ service( m_loader, true ) };
416  if ( !dataLoader ) {
417  error() << MSG::ERROR << "Failed to retrieve data loader "
418  << "\"" << m_loader << "\"" << endmsg;
419  return StatusCode::FAILURE;
420  }
421  StatusCode sc = setDataLoader( dataLoader );
422  if ( !sc.isSuccess() ) {
423  error() << MSG::ERROR << "Failed to set data loader "
424  << "\"" << m_loader << "\"" << endmsg;
425  return sc;
426  }
427  return sc;
428  }
429 
433  return StatusCode::SUCCESS;
434  }
435 
436  //
437  //---IService implemenation---------------------------------------------------------
438  //
439 
441  StatusCode initialize() override {
443  if ( !sc.isSuccess() ) {
444  error() << "Unable to initialize base class" << endmsg;
445  return sc;
446  }
447  if ( m_slots < (size_t)1 ) {
448  error() << "Invalid number of slots (" << m_slots << ")" << endmsg;
449  return StatusCode::FAILURE;
450  }
451 
452  if ( !setNumberOfStores( m_slots ).isSuccess() ) {
453  error() << "Cannot set number of slots" << endmsg;
454  return StatusCode::FAILURE;
455  }
456 
458  for ( size_t i = 0; i < m_slots; i++ ) {
459  DataSvc* svc = new DataSvc( name() + "_" + std::to_string( i ), serviceLocator() );
460  // Percolate properties
461  svc->setProperty( m_rootCLID ).ignore();
462  svc->setProperty( m_rootName ).ignore();
463  svc->setProperty( m_forceLeaves ).ignore();
465  // make sure that CommonMessaging is initialized
466  svc->setProperty( m_outputLevel ).ignore();
468 
469  sc = svc->initialize();
470  if ( !sc.isSuccess() ) {
471  error() << "Failed to instantiate DataSvc as store partition" << endmsg;
472  return sc;
473  }
474  m_partitions[i].with_lock( [&]( Partition& p ) {
475  p.dataProvider = svc;
476  p.dataManager = svc;
477  } );
478  m_freeSlots.push( i );
479  }
480  selectStore( 0 ).ignore();
481  return attachServices();
482  }
483 
487  if ( !sc.isSuccess() ) {
488  error() << "Unable to reinitialize base class" << endmsg;
489  return sc;
490  }
491  detachServices().ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
492  sc = attachServices();
493  if ( !sc.isSuccess() ) {
494  error() << "Failed to attach necessary services." << endmsg;
495  return sc;
496  }
497  return StatusCode::SUCCESS;
498  }
499 
501  StatusCode finalize() override {
502  setDataLoader( 0 ).ignore();
503  clearStore().ignore();
504  return Service::finalize();
505  }
506 };
507 
508 // Instantiation of a static factory class used by clients to create
509 // instances of this service
HiveWhiteBoard::linkObject
StatusCode linkObject(std::string_view fullPath, DataObject *to) override
Add a link to another object.
Definition: HiveWhiteBoard.cpp:318
HiveWhiteBoard::linkObject
StatusCode linkObject(IRegistry *from, std::string_view objPath, DataObject *to) override
Add a link to another object.
Definition: HiveWhiteBoard.cpp:314
HiveWhiteBoard::traverseTree
StatusCode traverseTree(IDataStoreAgent *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects in the data store.
Definition: HiveWhiteBoard.cpp:228
HiveWhiteBoard::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: HiveWhiteBoard.cpp:131
IDataManagerSvc::objectParent
virtual StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent)=0
IDataManagerSvc: Explore the object store: retrieve the object's parent.
HiveWhiteBoard::reinitialize
StatusCode reinitialize() override
Service initialisation.
Definition: HiveWhiteBoard.cpp:485
HiveWhiteBoard::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: HiveWhiteBoard.cpp:334
std::lock
T lock(T... args)
std::for_each
T for_each(T... args)
HiveWhiteBoard::~HiveWhiteBoard
~HiveWhiteBoard() override
Standard Destructor.
Definition: HiveWhiteBoard.cpp:154
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:118
HiveWhiteBoard::findObject
StatusCode findObject(std::string_view path, DataObject *&pObj) override
Find object identified by its full path in the data store.
Definition: HiveWhiteBoard.cpp:306
IDataProviderSvc::unregisterObject
virtual StatusCode unregisterObject(std::string_view fullPath)=0
Unregister object from the data store.
std::string
STL class.
HiveWhiteBoard::registerAddress
StatusCode registerAddress(std::string_view path, IOpaqueAddress *pAddr) override
IDataManagerSvc: Register object address with the data store.
Definition: HiveWhiteBoard.cpp:174
HiveWhiteBoard::m_loader
Gaudi::Property< std::string > m_loader
Definition: HiveWhiteBoard.cpp:132
HiveWhiteBoard::allocateStore
size_t allocateStore(int evtnumber) override
Allocate a store partition for a given event number.
Definition: HiveWhiteBoard.cpp:378
IDataProviderSvc::unlinkObject
virtual StatusCode unlinkObject(IRegistry *from, std::string_view objPath)=0
Remove a link to another object.
HiveWhiteBoard::unlinkObject
StatusCode unlinkObject(IRegistry *from, std::string_view objPath) override
Remove a link to another object.
Definition: HiveWhiteBoard.cpp:322
IDataManagerSvc
Definition: IDataManagerSvc.h:55
std::move
T move(T... args)
AtlasMCRecoFullPrecedenceDump.path
path
Definition: AtlasMCRecoFullPrecedenceDump.py:49
HiveWhiteBoard::finalize
StatusCode finalize() override
Service initialisation.
Definition: HiveWhiteBoard.cpp:501
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:314
HiveWhiteBoard::updateObject
StatusCode updateObject(DataObject *pObj) override
Update object.
Definition: HiveWhiteBoard.cpp:338
HiveWhiteBoard::setNumberOfStores
StatusCode setNumberOfStores(size_t slots) override
Set the number of event slots (copies of DataSvc objects).
Definition: HiveWhiteBoard.cpp:358
HiveWhiteBoard::m_dataLoader
SmartIF< IConversionSvc > m_dataLoader
Pointer to data loader service.
Definition: HiveWhiteBoard.cpp:141
IOpaqueAddress
Definition: IOpaqueAddress.h:33
HiveWhiteBoard::unregisterAddress
StatusCode unregisterAddress(IRegistry *pParent, std::string_view path) override
IDataManagerSvc: Unregister object address from the data store.
Definition: HiveWhiteBoard.cpp:186
std::vector
STL class.
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:96
std::find_if
T find_if(T... args)
std::vector::size
T size(T... args)
IAddressCreator.h
HiveWhiteBoard::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: HiveWhiteBoard.cpp:271
PropertyHolder::setProperty
StatusCode setProperty(const std::string &name, const Gaudi::Details::PropertyBase &p) override
set the property from another property with a different name
Definition: PropertyHolder.h:157
GaudiPartProp.decorators.get
get
decorate the vector of properties
Definition: decorators.py:283
HiveWhiteBoard::clearSubTree
StatusCode clearSubTree(DataObject *pObject) override
Remove all data objects below the sub tree identified.
Definition: HiveWhiteBoard.cpp:210
IDataManagerSvc::objectLeaves
virtual StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &refLeaves)=0
Explore the object store: retrieve all leaves attached to the object The object is identified by its ...
HiveWhiteBoard::unregisterObject
StatusCode unregisterObject(DataObject *pObj) override
Unregister object from the data store.
Definition: HiveWhiteBoard.cpp:294
HiveWhiteBoard::traverseSubTree
StatusCode traverseSubTree(std::string_view path, IDataStoreAgent *pAgent) override
Analyze by traversing all data objects below the sub tree.
Definition: HiveWhiteBoard.cpp:220
HiveWhiteBoard::getPartitionNumber
size_t getPartitionNumber(int eventnumber) const override
Get the partition number corresponding to a given event.
Definition: HiveWhiteBoard.cpp:402
std::distance
T distance(T... args)
detail
Definition: HistogramSvc.h:46
ConcurrencyFlags.h
HiveWhiteBoard::m_partitions
std::vector< Synced< Partition > > m_partitions
Datastore partitions.
Definition: HiveWhiteBoard.cpp:145
gaudirun.c
c
Definition: gaudirun.py:525
IRegistry
Definition: IRegistry.h:32
DataObjID.h
HiveWhiteBoard::unregisterAddress
StatusCode unregisterAddress(std::string_view path) override
IDataManagerSvc: Unregister object address from the data store.
Definition: HiveWhiteBoard.cpp:182
HiveWhiteBoard::freeStore
StatusCode freeStore(size_t partition) override
Free a store partition.
Definition: HiveWhiteBoard.cpp:393
HiveWhiteBoard::unregisterObject
StatusCode unregisterObject(std::string_view path) override
Unregister object from the data store.
Definition: HiveWhiteBoard.cpp:290
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:222
IDataProviderSvc.h
Service::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: Service.h:62
HiveWhiteBoard::clearStore
StatusCode clearStore(size_t partition) override
Remove all data objects in one 'slot' of the data store.
Definition: HiveWhiteBoard.cpp:347
std::vector::clear
T clear(T... args)
IDataManagerSvc::traverseSubTree
virtual StatusCode traverseSubTree(std::string_view sub_tree_path, IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects below the sub tree identified by its full path name.
IDataProviderSvc::registerObject
StatusCode registerObject(std::string_view fullPath, DataObject *pObject)
Register object with the data store.
Definition: IDataProviderSvc.h:72
IConverter::setDataProvider
virtual StatusCode setDataProvider(IDataProviderSvc *pService)=0
Set Data provider service.
HiveWhiteBoard::clearSubTree
StatusCode clearSubTree(std::string_view path) override
Remove all data objects below the sub tree identified.
Definition: HiveWhiteBoard.cpp:206
HiveWhiteBoard::freeSlots
size_t freeSlots() override
Get free slots number.
Definition: HiveWhiteBoard.cpp:166
IDataProviderSvc::linkObject
virtual StatusCode linkObject(IRegistry *from, std::string_view objPath, DataObject *toObj)=0
Add a link to another object.
HiveWhiteBoard::objectLeaves
StatusCode objectLeaves(const IRegistry *pObject, std::vector< IRegistry * > &leaves) override
Explore the object store: retrieve all leaves attached to the object.
Definition: HiveWhiteBoard.cpp:194
HiveWhiteBoard::detachServices
StatusCode detachServices()
Definition: HiveWhiteBoard.cpp:430
SmartIF.h
HiveWhiteBoard::removePreLoadItem
StatusCode removePreLoadItem(const DataStoreItem &item) override
Remove an item from the preload list.
Definition: HiveWhiteBoard.cpp:264
HiveWhiteBoard::objectParent
StatusCode objectParent(const IRegistry *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object's parent.
Definition: HiveWhiteBoard.cpp:202
HiveWhiteBoard::addPreLoadItem
StatusCode addPreLoadItem(const DataStoreItem &item) override
Add an item to the preload list.
Definition: HiveWhiteBoard.cpp:257
IDataProviderSvc::Status::INVALID_ROOT
@ INVALID_ROOT
Invalid root path object cannot be retrieved or stored.
HiveWhiteBoard::selectStore
StatusCode selectStore(size_t partition) override
Activate a partition object. The identifies the partition uniquely.
Definition: HiveWhiteBoard.cpp:352
Gaudi::Utils::begin
AttribStringParser::Iterator begin(const AttribStringParser &parser)
Definition: AttribStringParser.h:136
HiveWhiteBoard::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: HiveWhiteBoard.cpp:214
Service::name
const std::string & name() const override
Retrieve name of the service
Definition: Service.cpp:332
StatusCode
Definition: StatusCode.h:65
HiveWhiteBoard::preLoad
StatusCode preLoad() override
load all preload items of the list
Definition: HiveWhiteBoard.cpp:278
IDataManagerSvc::registerAddress
virtual StatusCode registerAddress(std::string_view fullPath, IOpaqueAddress *pAddress)=0
Register object address with the data store.
HiveWhiteBoard::getNumberOfStores
size_t getNumberOfStores() const override
Get the number of event slots (copies of DataSvc objects).
Definition: HiveWhiteBoard.cpp:369
DataStoreItem
Definition: DataStoreItem.h:27
IDataProviderSvc::retrieveObject
virtual StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
IOpaqueAddress.h
HiveWhiteBoard::unlinkObject
StatusCode unlinkObject(std::string_view path) override
Remove a link to another object.
Definition: HiveWhiteBoard.cpp:330
std::to_string
T to_string(T... args)
IDataManagerSvc::unregisterAddress
virtual StatusCode unregisterAddress(std::string_view fullPath)=0
Unregister object address from the data store.
IDataProviderSvc::preLoad
virtual StatusCode preLoad()=0
Load all preload items of the list.
HiveWhiteBoard::m_slots
Gaudi::Property< size_t > m_slots
Definition: HiveWhiteBoard.cpp:133
IDataManagerSvc::traverseTree
virtual StatusCode traverseTree(IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects in the data store.
details::argument_t
typename arg_helper< lambda >::type argument_t
Definition: EventIDBase.h:43
SmartIF< IDataProviderSvc >
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:18
IHiveWhiteBoard.h
HiveWhiteBoard::registerAddress
StatusCode registerAddress(IRegistry *parent, std::string_view path, IOpaqueAddress *pAdd) override
IDataManagerSvc: Register object address with the data store.
Definition: HiveWhiteBoard.cpp:178
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:20
HiveWhiteBoard::m_rootCLID
Gaudi::Property< CLID > m_rootCLID
Definition: HiveWhiteBoard.cpp:130
IRegistry.h
Gaudi::StateMachine::RUNNING
@ RUNNING
Definition: StateMachine.h:26
TypeNameString.h
DataObjID
Definition: DataObjID.h:47
HiveWhiteBoard::objectParent
StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object's parent.
Definition: HiveWhiteBoard.cpp:198
HiveWhiteBoard::unlinkObject
StatusCode unlinkObject(DataObject *from, std::string_view objPath) override
Remove a link to another object.
Definition: HiveWhiteBoard.cpp:326
StatusCode::ignore
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Definition: StatusCode.h:139
Service.h
Gaudi::Functional::details::for_
decltype(auto) for_(F &&f)
Definition: MergingTransformer.h:36
TTHREAD_TLS
TTHREAD_TLS(Synced< Partition > *) s_current
HiveWhiteBoard::setRoot
StatusCode setRoot(std::string path, DataObject *pObj) override
Initialize data store for new event by giving new event path and root object.
Definition: HiveWhiteBoard.cpp:233
HiveWhiteBoard::traverseSubTree
StatusCode traverseSubTree(DataObject *pObject, IDataStoreAgent *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects below the sub tree.
Definition: HiveWhiteBoard.cpp:224
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
DataSvc
Definition: DataSvc.h:52
HiveWhiteBoard::rootCLID
CLID rootCLID() const override
IDataManagerSvc: Accessor for root event CLID.
Definition: HiveWhiteBoard.cpp:169
HiveWhiteBoard::m_inhibitPathes
Gaudi::Property< std::vector< std::string > > m_inhibitPathes
Definition: HiveWhiteBoard.cpp:138
DataObject.h
HiveWhiteBoard::m_forceLeaves
Gaudi::Property< bool > m_forceLeaves
Definition: HiveWhiteBoard.cpp:134
HiveWhiteBoard::objectLeaves
StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &leaves) override
Explore the object store: retrieve all leaves attached to the object.
Definition: HiveWhiteBoard.cpp:190
HiveWhiteBoard::m_addrCreator
SmartIF< IAddressCreator > m_addrCreator
Reference to address creator.
Definition: HiveWhiteBoard.cpp:143
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginServiceV1.h:46
HiveWhiteBoard::initialize
StatusCode initialize() override
Service initialisation.
Definition: HiveWhiteBoard.cpp:441
Gaudi::StateMachine::INITIALIZED
@ INITIALIZED
Definition: StateMachine.h:25
MSG::ERROR
@ ERROR
Definition: IMessageSvc.h:25
DataObject
Definition: DataObject.h:36
HiveWhiteBoard::rootName
const std::string & rootName() const override
Name for root Event.
Definition: HiveWhiteBoard.cpp:171
Service::reinitialize
StatusCode reinitialize() override
Definition: Service.cpp:295
HiveWhiteBoard::attachServices
StatusCode attachServices()
Definition: HiveWhiteBoard.cpp:408
HiveWhiteBoard::setDataLoader
StatusCode setDataLoader(IConversionSvc *pDataLoader, IDataProviderSvc *=nullptr) override
IDataManagerSvc: Pass a default data loader to the service.
Definition: HiveWhiteBoard.cpp:249
HiveWhiteBoard::setRoot
StatusCode setRoot(std::string path, IOpaqueAddress *pAddr) override
Initialize data store for new event by giving new event path and address of root object.
Definition: HiveWhiteBoard.cpp:240
DataSvc::initialize
StatusCode initialize() override
Service initialization.
Definition: DataSvc.cpp:821
IDataManagerSvc::clearSubTree
virtual StatusCode clearSubTree(std::string_view sub_path)=0
Remove all data objects below the sub tree identified by its full path name.
Gaudi::Concurrency::ConcurrencyFlags::setNumConcEvents
static GAUDI_API void setNumConcEvents(const std::size_t &nE)
Definition: ConcurrencyFlags.h:69
IDataProviderSvc
Definition: IDataProviderSvc.h:53
IOTest.end
end
Definition: IOTest.py:125
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
HiveWhiteBoard::m_freeSlots
tbb::concurrent_queue< size_t > m_freeSlots
fifo queue of free slots
Definition: HiveWhiteBoard.cpp:147
IConversionSvc.h
ISvcLocator.h
HiveWhiteBoard::findObject
StatusCode findObject(IRegistry *parent, std::string_view path, DataObject *&pObj) override
Find object identified by its full path in the data store.
Definition: HiveWhiteBoard.cpp:310
HiveWhiteBoard::retrieveObject
StatusCode retrieveObject(IRegistry *parent, std::string_view path, DataObject *&pObj) override
Retrieve object from data store.
Definition: HiveWhiteBoard.cpp:302
HiveWhiteBoard::exists
bool exists(const DataObjID &id) override
check if a data object exists in the current store
Definition: HiveWhiteBoard.cpp:372
DataSvc.h
HiveWhiteBoard
Definition: HiveWhiteBoard.cpp:128
IDataStoreAgent.h
Service::service
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Service.h:89
Service::m_outputLevel
Gaudi::Property< int > m_outputLevel
flag indicating whether ToolHandle tools have been added to m_tools
Definition: Service.h:232
HiveWhiteBoard::m_enableFaultHdlr
Gaudi::Property< bool > m_enableFaultHdlr
Definition: HiveWhiteBoard.cpp:136
HiveWhiteBoard::registerObject
StatusCode registerObject(DataObject *parent, std::string_view obj, DataObject *pObj) override
Register object with the data store.
Definition: HiveWhiteBoard.cpp:286
IInterface::addRef
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
Gaudi::cxx::with_lock
auto with_lock(Fun &&f)
Definition: SynchronizedValue.h:98
Gaudi::Property< CLID >
IDataManagerSvc.h
IDataManagerSvc::setRoot
virtual StatusCode setRoot(std::string root_name, DataObject *pObject)=0
Initialize data store for new event by giving new event path.
IDataProviderSvc::updateObject
virtual StatusCode updateObject(IRegistry *pDirectory)=0
Update object identified by its directory entry.
ISvcManager.h
MsgStream.h
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator
Definition: Service.cpp:335
IDataStoreAgent
Definition: IDataStoreAgent.h:27
HiveWhiteBoard::registerObject
StatusCode registerObject(std::string_view parent, std::string_view obj, DataObject *pObj) override
Register object with the data store.
Definition: HiveWhiteBoard.cpp:282
HiveWhiteBoard::unregisterObject
StatusCode unregisterObject(DataObject *pObj, std::string_view path) override
Unregister object from the data store.
Definition: HiveWhiteBoard.cpp:298
IConversionSvc
Definition: IConversionSvc.h:47