The Gaudi Framework  v36r1 (3e2fb5a8)
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, "force creation of default leaves on registerObject"};
135  Gaudi::Property<bool> m_enableFaultHdlr{this, "EnableFaultHandler", false,
136  "enable incidents on data creation requests"};
137 
145  tbb::concurrent_queue<size_t> m_freeSlots;
146 
147 public:
149  using extends::extends;
150 
152  ~HiveWhiteBoard() override {
153  setDataLoader( 0 ).ignore();
154  resetPreLoad().ignore();
155  clearStore().ignore();
156  for_( m_partitions, []( Partition& p ) {
157  p.dataManager->release();
158  p.dataProvider->release();
159  } );
161  }
162 
164  size_t freeSlots() override { return m_freeSlots.unsafe_size(); }
165 
167  CLID rootCLID() const override { return (CLID)m_rootCLID; }
169  const std::string& rootName() const override { return m_rootName; }
170 
172  StatusCode registerAddress( std::string_view path, IOpaqueAddress* pAddr ) override {
173  return fwd( [&]( IDataManagerSvc& p ) { return p.registerAddress( path, pAddr ); } );
174  }
176  StatusCode registerAddress( IRegistry* parent, std::string_view path, IOpaqueAddress* pAdd ) override {
177  return fwd( [&]( IDataManagerSvc& p ) { return p.registerAddress( parent, path, pAdd ); } );
178  }
180  StatusCode unregisterAddress( std::string_view path ) override {
181  return fwd( [&]( IDataManagerSvc& p ) { return p.unregisterAddress( path ); } );
182  }
184  StatusCode unregisterAddress( IRegistry* pParent, std::string_view path ) override {
185  return fwd( [&]( IDataManagerSvc& p ) { return p.unregisterAddress( pParent, path ); } );
186  }
188  StatusCode objectLeaves( const DataObject* pObject, std::vector<IRegistry*>& leaves ) override {
189  return fwd( [&]( IDataManagerSvc& p ) { return p.objectLeaves( pObject, leaves ); } );
190  }
192  StatusCode objectLeaves( const IRegistry* pObject, std::vector<IRegistry*>& leaves ) override {
193  return fwd( [&]( IDataManagerSvc& p ) { return p.objectLeaves( pObject, leaves ); } );
194  }
196  StatusCode objectParent( const DataObject* pObject, IRegistry*& refpParent ) override {
197  return fwd( [&]( IDataManagerSvc& p ) { return p.objectParent( pObject, refpParent ); } );
198  }
200  StatusCode objectParent( const IRegistry* pObject, IRegistry*& refpParent ) override {
201  return fwd( [&]( IDataManagerSvc& p ) { return p.objectParent( pObject, refpParent ); } );
202  }
204  StatusCode clearSubTree( std::string_view path ) override {
205  return fwd( [&]( IDataManagerSvc& p ) { return p.clearSubTree( path ); } );
206  }
208  StatusCode clearSubTree( DataObject* pObject ) override {
209  return fwd( [&]( IDataManagerSvc& p ) { return p.clearSubTree( pObject ); } );
210  }
212  StatusCode clearStore() override {
213  for_( m_partitions, []( Partition& p ) { p.dataManager->clearStore().ignore(); } );
214  return StatusCode::SUCCESS;
215  }
216 
218  StatusCode traverseSubTree( std::string_view path, IDataStoreAgent* pAgent ) override {
219  return fwd( [&]( IDataManagerSvc& p ) { return p.traverseSubTree( path, pAgent ); } );
220  }
222  StatusCode traverseSubTree( DataObject* pObject, IDataStoreAgent* pAgent ) override {
223  return fwd( [&]( IDataManagerSvc& p ) { return p.traverseSubTree( pObject, pAgent ); } );
224  }
227  return fwd( [&]( IDataManagerSvc& p ) { return p.traverseTree( pAgent ); } );
228  }
232  return fwd(
233  [pObj, path = std::move( path )]( IDataManagerSvc& p ) { return p.setRoot( std::move( path ), pObj ); } );
234  }
235 
239  return fwd(
240  [pAddr, path = std::move( path )]( IDataManagerSvc& p ) { return p.setRoot( std::move( path ), pAddr ); } );
241  }
242 
247  StatusCode setDataLoader( IConversionSvc* pDataLoader, IDataProviderSvc* = nullptr ) override {
248  if ( pDataLoader ) pDataLoader->addRef();
250  if ( pDataLoader ) pDataLoader->setDataProvider( this ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
251  m_dataLoader = pDataLoader;
252  for_( m_partitions, [&]( Partition& p ) { p.dataManager->setDataLoader( m_dataLoader, this ).ignore(); } );
253  return StatusCode::SUCCESS;
254  }
256  StatusCode addPreLoadItem( const DataStoreItem& item ) override {
257  for_( m_partitions, [&]( Partition& p ) {
258  p.dataProvider->addPreLoadItem( item ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
259  } );
260  return StatusCode::SUCCESS;
261  }
263  StatusCode removePreLoadItem( const DataStoreItem& item ) override {
264  for_( m_partitions, [&]( Partition& p ) {
265  p.dataProvider->removePreLoadItem( item ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
266  } );
267  return StatusCode::SUCCESS;
268  }
271  for_( m_partitions, [&]( Partition& p ) {
272  p.dataProvider->resetPreLoad().ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
273  } );
274  return StatusCode::SUCCESS;
275  }
277  StatusCode preLoad() override {
278  return fwd( [&]( IDataProviderSvc& p ) { return p.preLoad(); } );
279  }
281  StatusCode registerObject( std::string_view parent, std::string_view obj, DataObject* pObj ) override {
282  return fwd( [&]( IDataProviderSvc& p ) { return p.registerObject( parent, obj, pObj ); } );
283  }
285  StatusCode registerObject( DataObject* parent, std::string_view obj, DataObject* pObj ) override {
286  return fwd( [&]( IDataProviderSvc& p ) { return p.registerObject( parent, obj, pObj ); } );
287  }
289  StatusCode unregisterObject( std::string_view path ) override {
290  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( path ); } );
291  }
294  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( pObj ); } );
295  }
297  StatusCode unregisterObject( DataObject* pObj, std::string_view path ) override {
298  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( pObj, path ); } );
299  }
301  StatusCode retrieveObject( IRegistry* parent, std::string_view path, DataObject*& pObj ) override {
302  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( parent, path, pObj ); } );
303  }
305  StatusCode findObject( std::string_view path, DataObject*& pObj ) override {
306  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( path, pObj ); } );
307  }
309  StatusCode findObject( IRegistry* parent, std::string_view path, DataObject*& pObj ) override {
310  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( parent, path, pObj ); } );
311  }
313  StatusCode linkObject( IRegistry* from, std::string_view objPath, DataObject* to ) override {
314  return fwd( [&]( IDataProviderSvc& p ) { return p.linkObject( from, objPath, to ); } );
315  }
317  StatusCode linkObject( std::string_view fullPath, DataObject* to ) override {
318  return fwd( [&]( IDataProviderSvc& p ) { return p.linkObject( fullPath, to ); } );
319  }
321  StatusCode unlinkObject( IRegistry* from, std::string_view objPath ) override {
322  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( from, objPath ); } );
323  }
325  StatusCode unlinkObject( DataObject* from, std::string_view objPath ) override {
326  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( from, objPath ); } );
327  }
329  StatusCode unlinkObject( std::string_view path ) override {
330  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( path ); } );
331  }
333  StatusCode updateObject( IRegistry* pDirectory ) override {
334  return fwd( [&]( IDataProviderSvc& p ) { return p.updateObject( pDirectory ); } );
335  }
337  StatusCode updateObject( DataObject* pObj ) override {
338  return fwd( [&]( IDataProviderSvc& p ) { return p.updateObject( pObj ); } );
339  }
340 
341  //
342  //---IHiveWhiteBard implemenation--------------------------------------------------
343  //
344 
346  StatusCode clearStore( size_t partition ) override {
347  return m_partitions[partition].with_lock( []( Partition& p ) { return p.dataManager->clearStore(); } );
348  }
349 
351  StatusCode selectStore( size_t partition ) override {
352  s_current = &m_partitions[partition];
353  return StatusCode::SUCCESS;
354  }
355 
357  StatusCode setNumberOfStores( size_t slots ) override {
359  warning() << "Too late to change the number of slots!" << endmsg;
360  return StatusCode::FAILURE;
361  }
362  m_slots = slots;
364  return StatusCode::SUCCESS;
365  }
366 
368  size_t getNumberOfStores() const override { return m_slots; }
369 
371  bool exists( const DataObjID& id ) override {
372  DataObject* pObject{nullptr};
373  return findObject( id.fullKey(), pObject ).isSuccess();
374  }
375 
377  size_t allocateStore( int evtnumber ) override {
378  // take next free slot in the list
379  size_t slot = std::string::npos;
380  if ( m_freeSlots.try_pop( slot ) ) {
381  assert( slot != std::string::npos );
382  assert( slot < m_partitions.size() );
383  m_partitions[slot].with_lock( [evtnumber]( Partition& p ) {
384  assert( p.eventNumber == -1 ); // or whatever value represents 'free'
385  p.eventNumber = evtnumber;
386  } );
387  }
388  return slot;
389  }
390 
392  StatusCode freeStore( size_t partition ) override {
393  assert( partition < m_partitions.size() );
394  auto prev = m_partitions[partition].with_lock( []( Partition& p ) { return std::exchange( p.eventNumber, -1 ); } );
395  if ( UNLIKELY( prev == -1 ) ) return StatusCode::FAILURE; // double free -- should never happen!
396  m_freeSlots.push( partition );
397  return StatusCode::SUCCESS;
398  }
399 
401  size_t getPartitionNumber( int eventnumber ) const override {
403  with_lock( [eventnumber]( const Partition& p ) { return p.eventNumber == eventnumber; } ) );
404  return i != end( m_partitions ) ? std::distance( begin( m_partitions ), i ) : std::string::npos;
405  }
406 
408  StatusCode sc = service( m_loader, m_addrCreator, true );
409  if ( !sc.isSuccess() ) {
410  error() << "Failed to retrieve data loader "
411  << "\"" << m_loader << "\"" << endmsg;
412  return sc;
413  }
414  IConversionSvc* dataLoader = nullptr;
415  sc = service( m_loader, dataLoader, true );
416  if ( !sc.isSuccess() ) {
417  error() << MSG::ERROR << "Failed to retrieve data loader "
418  << "\"" << m_loader << "\"" << endmsg;
419  return sc;
420  }
421  sc = setDataLoader( dataLoader );
422  dataLoader->release();
423  if ( !sc.isSuccess() ) {
424  error() << MSG::ERROR << "Failed to set data loader "
425  << "\"" << m_loader << "\"" << endmsg;
426  return sc;
427  }
428  return sc;
429  }
430 
434  m_addrCreator = nullptr;
435  m_dataLoader = nullptr;
436  return StatusCode::SUCCESS;
437  }
438 
439  //
440  //---IService implemenation---------------------------------------------------------
441  //
442 
444  StatusCode initialize() override {
446  if ( !sc.isSuccess() ) {
447  error() << "Unable to initialize base class" << endmsg;
448  return sc;
449  }
450  if ( m_slots < (size_t)1 ) {
451  error() << "Invalid number of slots (" << m_slots << ")" << endmsg;
452  return StatusCode::FAILURE;
453  }
454 
455  if ( !setNumberOfStores( m_slots ).isSuccess() ) {
456  error() << "Cannot set number of slots" << endmsg;
457  return StatusCode::FAILURE;
458  }
459 
461  for ( size_t i = 0; i < m_slots; i++ ) {
462  DataSvc* svc = new DataSvc( name() + "_" + std::to_string( i ), serviceLocator() );
463  // Percolate properties
464  svc->setProperty( m_rootCLID ).ignore();
465  svc->setProperty( m_rootName ).ignore();
466  svc->setProperty( m_forceLeaves ).ignore();
468  // make sure that CommonMessaging is initialized
469  svc->setProperty( m_outputLevel ).ignore();
470 
471  sc = svc->initialize();
472  if ( !sc.isSuccess() ) {
473  error() << "Failed to instantiate DataSvc as store partition" << endmsg;
474  return sc;
475  }
476  m_partitions[i].with_lock( [&]( Partition& p ) {
477  p.dataProvider = svc;
478  p.dataManager = svc;
479  } );
480  m_freeSlots.push( i );
481  }
482  selectStore( 0 ).ignore();
483  return attachServices();
484  }
485 
489  if ( !sc.isSuccess() ) {
490  error() << "Unable to reinitialize base class" << endmsg;
491  return sc;
492  }
493  detachServices().ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
494  sc = attachServices();
495  if ( !sc.isSuccess() ) {
496  error() << "Failed to attach necessary services." << endmsg;
497  return sc;
498  }
499  return StatusCode::SUCCESS;
500  }
501 
503  StatusCode finalize() override {
504  setDataLoader( 0 ).ignore();
505  clearStore().ignore();
506  return Service::finalize();
507  }
508 };
509 
510 // Instantiation of a static factory class used by clients to create
511 // instances of this service
HiveWhiteBoard::linkObject
StatusCode linkObject(std::string_view fullPath, DataObject *to) override
Add a link to another object.
Definition: HiveWhiteBoard.cpp:317
HiveWhiteBoard::linkObject
StatusCode linkObject(IRegistry *from, std::string_view objPath, DataObject *to) override
Add a link to another object.
Definition: HiveWhiteBoard.cpp:313
HiveWhiteBoard::traverseTree
StatusCode traverseTree(IDataStoreAgent *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects in the data store.
Definition: HiveWhiteBoard.cpp:226
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:487
HiveWhiteBoard::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: HiveWhiteBoard.cpp:333
std::lock
T lock(T... args)
std::for_each
T for_each(T... args)
HiveWhiteBoard::~HiveWhiteBoard
~HiveWhiteBoard() override
Standard Destructor.
Definition: HiveWhiteBoard.cpp:152
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:305
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:172
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:377
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:321
IDataManagerSvc
Definition: IDataManagerSvc.h:55
std::move
T move(T... args)
HiveWhiteBoard::finalize
StatusCode finalize() override
Service initialisation.
Definition: HiveWhiteBoard.cpp:503
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:355
HiveWhiteBoard::updateObject
StatusCode updateObject(DataObject *pObj) override
Update object.
Definition: HiveWhiteBoard.cpp:337
HiveWhiteBoard::setNumberOfStores
StatusCode setNumberOfStores(size_t slots) override
Set the number of event slots (copies of DataSvc objects).
Definition: HiveWhiteBoard.cpp:357
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:184
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:270
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:208
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:293
HiveWhiteBoard::traverseSubTree
StatusCode traverseSubTree(std::string_view path, IDataStoreAgent *pAgent) override
Analyze by traversing all data objects below the sub tree.
Definition: HiveWhiteBoard.cpp:218
HiveWhiteBoard::getPartitionNumber
size_t getPartitionNumber(int eventnumber) const override
Get the partition number corresponding to a given event.
Definition: HiveWhiteBoard.cpp:401
std::distance
T distance(T... args)
detail
ConcurrencyFlags.h
HiveWhiteBoard::m_partitions
std::vector< Synced< Partition > > m_partitions
Datastore partitions.
Definition: HiveWhiteBoard.cpp:143
gaudirun.c
c
Definition: gaudirun.py:509
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:180
HiveWhiteBoard::freeStore
StatusCode freeStore(size_t partition) override
Free a store partition.
Definition: HiveWhiteBoard.cpp:392
HiveWhiteBoard::unregisterObject
StatusCode unregisterObject(std::string_view path) override
Unregister object from the data store.
Definition: HiveWhiteBoard.cpp:289
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:346
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:204
HiveWhiteBoard::freeSlots
size_t freeSlots() override
Get free slots number.
Definition: HiveWhiteBoard.cpp:164
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:192
HiveWhiteBoard::detachServices
StatusCode detachServices()
Definition: HiveWhiteBoard.cpp:431
SmartIF.h
HiveWhiteBoard::removePreLoadItem
StatusCode removePreLoadItem(const DataStoreItem &item) override
Remove an item from the preload list.
Definition: HiveWhiteBoard.cpp:263
HiveWhiteBoard::objectParent
StatusCode objectParent(const IRegistry *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object's parent.
Definition: HiveWhiteBoard.cpp:200
HiveWhiteBoard::addPreLoadItem
StatusCode addPreLoadItem(const DataStoreItem &item) override
Add an item to the preload list.
Definition: HiveWhiteBoard.cpp:256
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:351
HiveWhiteBoard::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: HiveWhiteBoard.cpp:212
Gaudi::Functional::details::get
auto get(const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))
Definition: FunctionalDetails.h:391
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:277
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:368
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:329
std::to_string
T to_string(T... args)
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:943
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:176
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
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:196
HiveWhiteBoard::unlinkObject
StatusCode unlinkObject(DataObject *from, std::string_view objPath) override
Remove a link to another object.
Definition: HiveWhiteBoard.cpp:325
StatusCode::ignore
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Definition: StatusCode.h:156
Service.h
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:231
HiveWhiteBoard::traverseSubTree
StatusCode traverseSubTree(DataObject *pObject, IDataStoreAgent *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects below the sub tree.
Definition: HiveWhiteBoard.cpp:222
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:167
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:188
HiveWhiteBoard::m_addrCreator
IAddressCreator * m_addrCreator
Reference to address creator.
Definition: HiveWhiteBoard.cpp:141
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginServiceV1.h:46
HiveWhiteBoard::initialize
StatusCode initialize() override
Service initialisation.
Definition: HiveWhiteBoard.cpp:444
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:169
Service::reinitialize
StatusCode reinitialize() override
Definition: Service.cpp:295
HiveWhiteBoard::attachServices
StatusCode attachServices()
Definition: HiveWhiteBoard.cpp:407
HiveWhiteBoard::setDataLoader
StatusCode setDataLoader(IConversionSvc *pDataLoader, IDataProviderSvc *=nullptr) override
IDataManagerSvc: Pass a default data loader to the service.
Definition: HiveWhiteBoard.cpp:247
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:238
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:123
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:145
IConversionSvc.h
IInterface::release
virtual unsigned long release()=0
Release Interface instance.
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:106
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:309
HiveWhiteBoard::retrieveObject
StatusCode retrieveObject(IRegistry *parent, std::string_view path, DataObject *&pObj) override
Retrieve object from data store.
Definition: HiveWhiteBoard.cpp:301
HiveWhiteBoard::exists
bool exists(const DataObjID &id) override
check if a data object exists in the current store
Definition: HiveWhiteBoard.cpp:371
DataSvc.h
HiveWhiteBoard
Definition: HiveWhiteBoard.cpp:128
IDataStoreAgent.h
HiveWhiteBoard::m_dataLoader
IConversionSvc * m_dataLoader
Pointer to data loader service.
Definition: HiveWhiteBoard.cpp:139
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:94
Service::m_outputLevel
Gaudi::Property< int > m_outputLevel
flag indicating whether ToolHandle tools have been added to m_tools
Definition: Service.h:235
HiveWhiteBoard::m_enableFaultHdlr
Gaudi::Property< bool > m_enableFaultHdlr
Definition: HiveWhiteBoard.cpp:135
HiveWhiteBoard::registerObject
StatusCode registerObject(DataObject *parent, std::string_view obj, DataObject *pObj) override
Register object with the data store.
Definition: HiveWhiteBoard.cpp:285
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:281
HiveWhiteBoard::unregisterObject
StatusCode unregisterObject(DataObject *pObj, std::string_view path) override
Unregister object from the data store.
Definition: HiveWhiteBoard.cpp:297
IConversionSvc
Definition: IConversionSvc.h:47