Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v36r16 (ea80daf8)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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  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();
252  if ( pDataLoader ) pDataLoader->setDataProvider( this ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
253  m_dataLoader = pDataLoader;
254  for_( m_partitions, [&]( Partition& p ) { p.dataManager->setDataLoader( m_dataLoader, this ).ignore(); } );
255  return StatusCode::SUCCESS;
256  }
258  StatusCode addPreLoadItem( const DataStoreItem& item ) override {
259  for_( m_partitions, [&]( Partition& p ) {
260  p.dataProvider->addPreLoadItem( item ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
261  } );
262  return StatusCode::SUCCESS;
263  }
265  StatusCode removePreLoadItem( const DataStoreItem& item ) override {
266  for_( m_partitions, [&]( Partition& p ) {
267  p.dataProvider->removePreLoadItem( item ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
268  } );
269  return StatusCode::SUCCESS;
270  }
273  for_( m_partitions, [&]( Partition& p ) {
274  p.dataProvider->resetPreLoad().ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
275  } );
276  return StatusCode::SUCCESS;
277  }
279  StatusCode preLoad() override {
280  return fwd( [&]( IDataProviderSvc& p ) { return p.preLoad(); } );
281  }
283  StatusCode registerObject( std::string_view parent, std::string_view obj, DataObject* pObj ) override {
284  return fwd( [&]( IDataProviderSvc& p ) { return p.registerObject( parent, obj, pObj ); } );
285  }
287  StatusCode registerObject( DataObject* parent, std::string_view obj, DataObject* pObj ) override {
288  return fwd( [&]( IDataProviderSvc& p ) { return p.registerObject( parent, obj, pObj ); } );
289  }
291  StatusCode unregisterObject( std::string_view path ) override {
292  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( path ); } );
293  }
296  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( pObj ); } );
297  }
299  StatusCode unregisterObject( DataObject* pObj, std::string_view path ) override {
300  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( pObj, path ); } );
301  }
303  StatusCode retrieveObject( IRegistry* parent, std::string_view path, DataObject*& pObj ) override {
304  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( parent, path, pObj ); } );
305  }
307  StatusCode findObject( std::string_view path, DataObject*& pObj ) override {
308  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( path, pObj ); } );
309  }
311  StatusCode findObject( IRegistry* parent, std::string_view path, DataObject*& pObj ) override {
312  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( parent, path, pObj ); } );
313  }
315  StatusCode linkObject( IRegistry* from, std::string_view objPath, DataObject* to ) override {
316  return fwd( [&]( IDataProviderSvc& p ) { return p.linkObject( from, objPath, to ); } );
317  }
319  StatusCode linkObject( std::string_view fullPath, DataObject* to ) override {
320  return fwd( [&]( IDataProviderSvc& p ) { return p.linkObject( fullPath, to ); } );
321  }
323  StatusCode unlinkObject( IRegistry* from, std::string_view objPath ) override {
324  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( from, objPath ); } );
325  }
327  StatusCode unlinkObject( DataObject* from, std::string_view objPath ) override {
328  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( from, objPath ); } );
329  }
331  StatusCode unlinkObject( std::string_view path ) override {
332  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( path ); } );
333  }
335  StatusCode updateObject( IRegistry* pDirectory ) override {
336  return fwd( [&]( IDataProviderSvc& p ) { return p.updateObject( pDirectory ); } );
337  }
339  StatusCode updateObject( DataObject* pObj ) override {
340  return fwd( [&]( IDataProviderSvc& p ) { return p.updateObject( pObj ); } );
341  }
342 
343  //
344  //---IHiveWhiteBard implemenation--------------------------------------------------
345  //
346 
348  StatusCode clearStore( size_t partition ) override {
349  return m_partitions[partition].with_lock( []( Partition& p ) { return p.dataManager->clearStore(); } );
350  }
351 
353  StatusCode selectStore( size_t partition ) override {
354  s_current = &m_partitions[partition];
355  return StatusCode::SUCCESS;
356  }
357 
359  StatusCode setNumberOfStores( size_t slots ) override {
361  warning() << "Too late to change the number of slots!" << endmsg;
362  return StatusCode::FAILURE;
363  }
364  m_slots = slots;
366  return StatusCode::SUCCESS;
367  }
368 
370  size_t getNumberOfStores() const override { return m_slots; }
371 
373  bool exists( const DataObjID& id ) override {
374  DataObject* pObject{ nullptr };
375  return findObject( id.fullKey(), pObject ).isSuccess();
376  }
377 
379  size_t allocateStore( int evtnumber ) override {
380  // take next free slot in the list
381  size_t slot = std::string::npos;
382  if ( m_freeSlots.try_pop( slot ) ) {
383  assert( slot != std::string::npos );
384  assert( slot < m_partitions.size() );
385  m_partitions[slot].with_lock( [evtnumber]( Partition& p ) {
386  assert( p.eventNumber == -1 ); // or whatever value represents 'free'
387  p.eventNumber = evtnumber;
388  } );
389  }
390  return slot;
391  }
392 
394  StatusCode freeStore( size_t partition ) override {
395  assert( partition < m_partitions.size() );
396  auto prev = m_partitions[partition].with_lock( []( Partition& p ) { return std::exchange( p.eventNumber, -1 ); } );
397  if ( prev == -1 ) return StatusCode::FAILURE; // double free -- should never happen!
398  m_freeSlots.push( partition );
399  return StatusCode::SUCCESS;
400  }
401 
403  size_t getPartitionNumber( int eventnumber ) const override {
405  with_lock( [eventnumber]( const Partition& p ) { return p.eventNumber == eventnumber; } ) );
406  return i != end( m_partitions ) ? std::distance( begin( m_partitions ), i ) : std::string::npos;
407  }
408 
410  StatusCode sc = service( m_loader, m_addrCreator, true );
411  if ( !sc.isSuccess() ) {
412  error() << "Failed to retrieve data loader "
413  << "\"" << m_loader << "\"" << endmsg;
414  return sc;
415  }
416  IConversionSvc* dataLoader = nullptr;
417  sc = service( m_loader, dataLoader, true );
418  if ( !sc.isSuccess() ) {
419  error() << MSG::ERROR << "Failed to retrieve data loader "
420  << "\"" << m_loader << "\"" << endmsg;
421  return sc;
422  }
423  sc = setDataLoader( dataLoader );
424  dataLoader->release();
425  if ( !sc.isSuccess() ) {
426  error() << MSG::ERROR << "Failed to set data loader "
427  << "\"" << m_loader << "\"" << endmsg;
428  return sc;
429  }
430  return sc;
431  }
432 
436  m_addrCreator = nullptr;
437  m_dataLoader = nullptr;
438  return StatusCode::SUCCESS;
439  }
440 
441  //
442  //---IService implemenation---------------------------------------------------------
443  //
444 
446  StatusCode initialize() override {
448  if ( !sc.isSuccess() ) {
449  error() << "Unable to initialize base class" << endmsg;
450  return sc;
451  }
452  if ( m_slots < (size_t)1 ) {
453  error() << "Invalid number of slots (" << m_slots << ")" << endmsg;
454  return StatusCode::FAILURE;
455  }
456 
457  if ( !setNumberOfStores( m_slots ).isSuccess() ) {
458  error() << "Cannot set number of slots" << endmsg;
459  return StatusCode::FAILURE;
460  }
461 
463  for ( size_t i = 0; i < m_slots; i++ ) {
464  DataSvc* svc = new DataSvc( name() + "_" + std::to_string( i ), serviceLocator() );
465  // Percolate properties
466  svc->setProperty( m_rootCLID ).ignore();
467  svc->setProperty( m_rootName ).ignore();
468  svc->setProperty( m_forceLeaves ).ignore();
470  // make sure that CommonMessaging is initialized
471  svc->setProperty( m_outputLevel ).ignore();
473 
474  sc = svc->initialize();
475  if ( !sc.isSuccess() ) {
476  error() << "Failed to instantiate DataSvc as store partition" << endmsg;
477  return sc;
478  }
479  m_partitions[i].with_lock( [&]( Partition& p ) {
480  p.dataProvider = svc;
481  p.dataManager = svc;
482  } );
483  m_freeSlots.push( i );
484  }
485  selectStore( 0 ).ignore();
486  return attachServices();
487  }
488 
492  if ( !sc.isSuccess() ) {
493  error() << "Unable to reinitialize base class" << endmsg;
494  return sc;
495  }
496  detachServices().ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
497  sc = attachServices();
498  if ( !sc.isSuccess() ) {
499  error() << "Failed to attach necessary services." << endmsg;
500  return sc;
501  }
502  return StatusCode::SUCCESS;
503  }
504 
506  StatusCode finalize() override {
507  setDataLoader( 0 ).ignore();
508  clearStore().ignore();
509  return Service::finalize();
510  }
511 };
512 
513 // Instantiation of a static factory class used by clients to create
514 // instances of this service
HiveWhiteBoard::linkObject
StatusCode linkObject(std::string_view fullPath, DataObject *to) override
Add a link to another object.
Definition: HiveWhiteBoard.cpp:319
HiveWhiteBoard::linkObject
StatusCode linkObject(IRegistry *from, std::string_view objPath, DataObject *to) override
Add a link to another object.
Definition: HiveWhiteBoard.cpp:315
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:490
HiveWhiteBoard::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: HiveWhiteBoard.cpp:335
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
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:307
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:379
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:323
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:506
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:314
HiveWhiteBoard::updateObject
StatusCode updateObject(DataObject *pObj) override
Update object.
Definition: HiveWhiteBoard.cpp:339
HiveWhiteBoard::setNumberOfStores
StatusCode setNumberOfStores(size_t slots) override
Set the number of event slots (copies of DataSvc objects).
Definition: HiveWhiteBoard.cpp:359
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.
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:272
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: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:295
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:403
std::distance
T distance(T... args)
detail
ConcurrencyFlags.h
HiveWhiteBoard::m_partitions
std::vector< Synced< Partition > > m_partitions
Datastore partitions.
Definition: HiveWhiteBoard.cpp:145
gaudirun.c
c
Definition: gaudirun.py:527
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:394
HiveWhiteBoard::unregisterObject
StatusCode unregisterObject(std::string_view path) override
Unregister object from the data store.
Definition: HiveWhiteBoard.cpp:291
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:348
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:433
SmartIF.h
HiveWhiteBoard::removePreLoadItem
StatusCode removePreLoadItem(const DataStoreItem &item) override
Remove an item from the preload list.
Definition: HiveWhiteBoard.cpp:265
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:258
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:353
HiveWhiteBoard::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: HiveWhiteBoard.cpp:214
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:279
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:370
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:331
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: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:198
HiveWhiteBoard::unlinkObject
StatusCode unlinkObject(DataObject *from, std::string_view objPath) override
Remove a link to another object.
Definition: HiveWhiteBoard.cpp:327
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: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
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:446
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:171
Service::reinitialize
StatusCode reinitialize() override
Definition: Service.cpp:295
HiveWhiteBoard::attachServices
StatusCode attachServices()
Definition: HiveWhiteBoard.cpp:409
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: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:147
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:311
HiveWhiteBoard::retrieveObject
StatusCode retrieveObject(IRegistry *parent, std::string_view path, DataObject *&pObj) override
Retrieve object from data store.
Definition: HiveWhiteBoard.cpp:303
HiveWhiteBoard::exists
bool exists(const DataObjID &id) override
check if a data object exists in the current store
Definition: HiveWhiteBoard.cpp:373
DataSvc.h
HiveWhiteBoard
Definition: HiveWhiteBoard.cpp:128
IDataStoreAgent.h
HiveWhiteBoard::m_dataLoader
IConversionSvc * m_dataLoader
Pointer to data loader service.
Definition: HiveWhiteBoard.cpp:141
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:287
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:283
HiveWhiteBoard::unregisterObject
StatusCode unregisterObject(DataObject *pObj, std::string_view path) override
Unregister object from the data store.
Definition: HiveWhiteBoard.cpp:299
IConversionSvc
Definition: IConversionSvc.h:47