The Gaudi Framework  v36r6 (b1ee9983)
HiveWhiteBoard.cpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 //====================================================================
12 // 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 "tbb/concurrent_queue.h"
29 #include <mutex>
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 
146  tbb::concurrent_queue<size_t> m_freeSlots;
147 
148 public:
150  using extends::extends;
151 
153  ~HiveWhiteBoard() override {
154  setDataLoader( 0 ).ignore();
155  resetPreLoad().ignore();
156  clearStore().ignore();
157  for_( m_partitions, []( Partition& p ) {
158  p.dataManager->release();
159  p.dataProvider->release();
160  } );
162  }
163 
165  size_t freeSlots() override { return m_freeSlots.unsafe_size(); }
166 
168  CLID rootCLID() const override { return (CLID)m_rootCLID; }
170  const std::string& rootName() const override { return m_rootName; }
171 
173  StatusCode registerAddress( std::string_view path, IOpaqueAddress* pAddr ) override {
174  return fwd( [&]( IDataManagerSvc& p ) { return p.registerAddress( path, pAddr ); } );
175  }
177  StatusCode registerAddress( IRegistry* parent, std::string_view path, IOpaqueAddress* pAdd ) override {
178  return fwd( [&]( IDataManagerSvc& p ) { return p.registerAddress( parent, path, pAdd ); } );
179  }
181  StatusCode unregisterAddress( std::string_view path ) override {
182  return fwd( [&]( IDataManagerSvc& p ) { return p.unregisterAddress( path ); } );
183  }
185  StatusCode unregisterAddress( IRegistry* pParent, std::string_view path ) override {
186  return fwd( [&]( IDataManagerSvc& p ) { return p.unregisterAddress( pParent, path ); } );
187  }
189  StatusCode objectLeaves( const DataObject* pObject, std::vector<IRegistry*>& leaves ) override {
190  return fwd( [&]( IDataManagerSvc& p ) { return p.objectLeaves( pObject, leaves ); } );
191  }
193  StatusCode objectLeaves( const IRegistry* pObject, std::vector<IRegistry*>& leaves ) override {
194  return fwd( [&]( IDataManagerSvc& p ) { return p.objectLeaves( pObject, leaves ); } );
195  }
197  StatusCode objectParent( const DataObject* pObject, IRegistry*& refpParent ) override {
198  return fwd( [&]( IDataManagerSvc& p ) { return p.objectParent( pObject, refpParent ); } );
199  }
201  StatusCode objectParent( const IRegistry* pObject, IRegistry*& refpParent ) override {
202  return fwd( [&]( IDataManagerSvc& p ) { return p.objectParent( pObject, refpParent ); } );
203  }
205  StatusCode clearSubTree( std::string_view path ) override {
206  return fwd( [&]( IDataManagerSvc& p ) { return p.clearSubTree( path ); } );
207  }
209  StatusCode clearSubTree( DataObject* pObject ) override {
210  return fwd( [&]( IDataManagerSvc& p ) { return p.clearSubTree( pObject ); } );
211  }
213  StatusCode clearStore() override {
214  for_( m_partitions, []( Partition& p ) { p.dataManager->clearStore().ignore(); } );
215  return StatusCode::SUCCESS;
216  }
217 
219  StatusCode traverseSubTree( std::string_view path, IDataStoreAgent* pAgent ) override {
220  return fwd( [&]( IDataManagerSvc& p ) { return p.traverseSubTree( path, pAgent ); } );
221  }
223  StatusCode traverseSubTree( DataObject* pObject, IDataStoreAgent* pAgent ) override {
224  return fwd( [&]( IDataManagerSvc& p ) { return p.traverseSubTree( pObject, pAgent ); } );
225  }
228  return fwd( [&]( IDataManagerSvc& p ) { return p.traverseTree( pAgent ); } );
229  }
233  return fwd(
234  [pObj, path = std::move( path )]( IDataManagerSvc& p ) { return p.setRoot( std::move( path ), pObj ); } );
235  }
236 
240  return fwd(
241  [pAddr, path = std::move( path )]( IDataManagerSvc& p ) { return p.setRoot( std::move( path ), pAddr ); } );
242  }
243 
248  StatusCode setDataLoader( IConversionSvc* pDataLoader, IDataProviderSvc* = nullptr ) override {
249  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  StatusCode sc = service( m_loader, m_addrCreator, true );
410  if ( !sc.isSuccess() ) {
411  error() << "Failed to retrieve data loader "
412  << "\"" << m_loader << "\"" << endmsg;
413  return sc;
414  }
415  IConversionSvc* dataLoader = nullptr;
416  sc = service( m_loader, dataLoader, true );
417  if ( !sc.isSuccess() ) {
418  error() << MSG::ERROR << "Failed to retrieve data loader "
419  << "\"" << m_loader << "\"" << endmsg;
420  return sc;
421  }
422  sc = setDataLoader( dataLoader );
423  dataLoader->release();
424  if ( !sc.isSuccess() ) {
425  error() << MSG::ERROR << "Failed to set data loader "
426  << "\"" << m_loader << "\"" << endmsg;
427  return sc;
428  }
429  return sc;
430  }
431 
435  m_addrCreator = nullptr;
436  m_dataLoader = nullptr;
437  return StatusCode::SUCCESS;
438  }
439 
440  //
441  //---IService implemenation---------------------------------------------------------
442  //
443 
445  StatusCode initialize() override {
447  if ( !sc.isSuccess() ) {
448  error() << "Unable to initialize base class" << endmsg;
449  return sc;
450  }
451  if ( m_slots < (size_t)1 ) {
452  error() << "Invalid number of slots (" << m_slots << ")" << endmsg;
453  return StatusCode::FAILURE;
454  }
455 
456  if ( !setNumberOfStores( m_slots ).isSuccess() ) {
457  error() << "Cannot set number of slots" << endmsg;
458  return StatusCode::FAILURE;
459  }
460 
462  for ( size_t i = 0; i < m_slots; i++ ) {
463  DataSvc* svc = new DataSvc( name() + "_" + std::to_string( i ), serviceLocator() );
464  // Percolate properties
465  svc->setProperty( m_rootCLID ).ignore();
466  svc->setProperty( m_rootName ).ignore();
467  svc->setProperty( m_forceLeaves ).ignore();
469  // make sure that CommonMessaging is initialized
470  svc->setProperty( m_outputLevel ).ignore();
471 
472  sc = svc->initialize();
473  if ( !sc.isSuccess() ) {
474  error() << "Failed to instantiate DataSvc as store partition" << endmsg;
475  return sc;
476  }
477  m_partitions[i].with_lock( [&]( Partition& p ) {
478  p.dataProvider = svc;
479  p.dataManager = svc;
480  } );
481  m_freeSlots.push( i );
482  }
483  selectStore( 0 ).ignore();
484  return attachServices();
485  }
486 
490  if ( !sc.isSuccess() ) {
491  error() << "Unable to reinitialize base class" << endmsg;
492  return sc;
493  }
494  detachServices().ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
495  sc = attachServices();
496  if ( !sc.isSuccess() ) {
497  error() << "Failed to attach necessary services." << endmsg;
498  return sc;
499  }
500  return StatusCode::SUCCESS;
501  }
502 
504  StatusCode finalize() override {
505  setDataLoader( 0 ).ignore();
506  clearStore().ignore();
507  return Service::finalize();
508  }
509 };
510 
511 // Instantiation of a static factory class used by clients to create
512 // 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:227
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:488
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:153
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:118
IAddressCreator
Definition: IAddressCreator.h:38
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:173
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)
HiveWhiteBoard::finalize
StatusCode finalize() override
Service initialisation.
Definition: HiveWhiteBoard.cpp:504
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
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:185
std::vector
STL class.
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
HiveWhiteBoard::clearSubTree
StatusCode clearSubTree(DataObject *pObject) override
Remove all data objects below the sub tree identified.
Definition: HiveWhiteBoard.cpp:209
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:219
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
ConcurrencyFlags.h
HiveWhiteBoard::m_partitions
std::vector< Synced< Partition > > m_partitions
Datastore partitions.
Definition: HiveWhiteBoard.cpp:144
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:181
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:205
HiveWhiteBoard::freeSlots
size_t freeSlots() override
Get free slots number.
Definition: HiveWhiteBoard.cpp:165
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:193
HiveWhiteBoard::detachServices
StatusCode detachServices()
Definition: HiveWhiteBoard.cpp:432
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:201
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
HiveWhiteBoard::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: HiveWhiteBoard.cpp:213
Gaudi::Functional::details::get
auto get(const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))
Definition: FunctionalDetails.h:444
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
CLHEP::begin
double * begin(CLHEP::HepVector &v)
Definition: TupleAlg.cpp:45
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)
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:961
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:177
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:203
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
IOTest.end
def end
Definition: IOTest.py:128
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:197
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:38
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:232
HiveWhiteBoard::traverseSubTree
StatusCode traverseSubTree(DataObject *pObject, IDataStoreAgent *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects below the sub tree.
Definition: HiveWhiteBoard.cpp:223
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:168
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:189
HiveWhiteBoard::m_addrCreator
IAddressCreator * m_addrCreator
Reference to address creator.
Definition: HiveWhiteBoard.cpp:142
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginServiceV1.h:46
HiveWhiteBoard::initialize
StatusCode initialize() override
Service initialisation.
Definition: HiveWhiteBoard.cpp:445
Gaudi::StateMachine::INITIALIZED
@ INITIALIZED
Definition: StateMachine.h:25
MSG::ERROR
@ ERROR
Definition: IMessageSvc.h:25
DataObject
Definition: DataObject.h:40
HiveWhiteBoard::rootName
const std::string & rootName() const override
Name for root Event.
Definition: HiveWhiteBoard.cpp:170
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:248
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:239
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
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:146
IConversionSvc.h
IInterface::release
virtual unsigned long release()=0
Release Interface instance.
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
HiveWhiteBoard::m_dataLoader
IConversionSvc * m_dataLoader
Pointer to data loader service.
Definition: HiveWhiteBoard.cpp:140
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:88
Service::m_outputLevel
Gaudi::Property< int > m_outputLevel
flag indicating whether ToolHandle tools have been added to m_tools
Definition: Service.h:229
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::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