The Gaudi Framework  v32r0 (3325bb39)
HiveWhiteBoard.cpp
Go to the documentation of this file.
1 //====================================================================
2 // WhiteBoard (Concurrent Event Data Store)
3 //--------------------------------------------------------------------
4 //
5 //====================================================================
6 // Include files
10 #include "GaudiKernel/DataSvc.h"
11 #include "GaudiKernel/MsgStream.h"
12 #include "GaudiKernel/Service.h"
13 #include "GaudiKernel/SmartIF.h"
15 #include "Rtypes.h"
16 #include "ThreadLocalStorage.h"
17 #include "boost/callable_traits.hpp"
18 #include "tbb/concurrent_queue.h"
19 #include "tbb/mutex.h"
20 #include "tbb/recursive_mutex.h"
21 #include <utility>
22 
23 // Interfaces
31 #include "GaudiKernel/IRegistry.h"
34 
35 namespace {
36  struct Partition final {
37  SmartIF<IDataProviderSvc> dataProvider;
38  SmartIF<IDataManagerSvc> dataManager;
39  int eventNumber = -1;
40 
41  // allow acces 'by type' -- used in fwd
42  template <typename T>
43  T* get();
44  };
45  template <>
46  IDataProviderSvc* Partition::get<IDataProviderSvc>() {
47  return dataProvider.get();
48  }
49  template <>
50  IDataManagerSvc* Partition::get<IDataManagerSvc>() {
51  return dataManager.get();
52  }
53 
54  // C++20: replace with http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0290r2.html
55  // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4033.html
56 
57  template <typename T, typename Mutex = tbb::recursive_mutex, typename ReadLock = typename Mutex::scoped_lock,
58  typename WriteLock = ReadLock>
59  class Synced {
60  T m_obj;
61  mutable Mutex m_mtx;
62 
63  public:
64  template <typename F>
65  decltype( auto ) with_lock( F&& f ) {
66  WriteLock lock{m_mtx};
67  return f( m_obj );
68  }
69  template <typename F>
70  decltype( auto ) with_lock( F&& f ) const {
71  ReadLock lock{m_mtx};
72  return f( m_obj );
73  }
74  };
75  // transform an f(T) into an f(Synced<T>)
76  template <typename Fun>
77  auto with_lock( Fun&& f ) {
78  return [f = std::forward<Fun>( f )]( auto& p ) -> decltype( auto ) { return p.with_lock( f ); };
79  }
80  // call f(T) for each element in a container of Synced<T>
81  template <typename ContainerOfSynced, typename Fun>
82  void for_( ContainerOfSynced& c, Fun&& f ) {
83  std::for_each( begin( c ), end( c ), with_lock( std::forward<Fun>( f ) ) );
84  }
85 } // namespace
86 
87 TTHREAD_TLS( Synced<Partition>* ) s_current = nullptr;
88 
89 namespace {
90  namespace detail {
91  // given a callable F(Arg_t,...)
92  // argument_t<F> will be equal to Arg_t
93  template <typename F>
94  using argument_t = std::tuple_element_t<0, boost::callable_traits::args_t<F>>;
95  } // namespace detail
96 
97  template <typename Fun>
98  StatusCode fwd( Fun f ) {
99  if ( !s_current ) return IDataProviderSvc::Status::INVALID_ROOT;
100  return s_current->with_lock( [&]( Partition& p ) {
101  auto* svc = p.get<std::decay_t<detail::argument_t<Fun>>>();
102  return svc ? f( *svc ) : IDataProviderSvc::Status::INVALID_ROOT;
103  } );
104  }
105 } // namespace
106 
119 class HiveWhiteBoard : public extends<Service, IDataProviderSvc, IDataManagerSvc, IHiveWhiteBoard> {
120 protected:
121  Gaudi::Property<CLID> m_rootCLID{this, "RootCLID", 110 /*CLID_Event*/, "CLID of root entry"};
122  Gaudi::Property<std::string> m_rootName{this, "RootName", "/Event", "name of root entry"};
123  Gaudi::Property<std::string> m_loader{this, "DataLoader", "EventPersistencySvc", ""};
124  Gaudi::Property<size_t> m_slots{this, "EventSlots", 1, "number of event slots"};
125  Gaudi::Property<bool> m_forceLeaves{this, "ForceLeaves", false, "force creation of default leaves on registerObject"};
126  Gaudi::Property<bool> m_enableFaultHdlr{this, "EnableFaultHandler", false,
127  "enable incidents on data creation requests"};
128 
130  IConversionSvc* m_dataLoader = nullptr;
132  IAddressCreator* m_addrCreator = nullptr;
136  tbb::concurrent_queue<size_t> m_freeSlots;
137 
138 public:
140  using extends::extends;
141 
143  ~HiveWhiteBoard() override {
144  setDataLoader( 0 ).ignore();
145  resetPreLoad().ignore();
146  clearStore().ignore();
147  for_( m_partitions, []( Partition& p ) {
148  p.dataManager->release();
149  p.dataProvider->release();
150  } );
151  m_partitions.clear();
152  }
153 
155  size_t freeSlots() override { return m_freeSlots.unsafe_size(); }
156 
158  CLID rootCLID() const override { return (CLID)m_rootCLID; }
160  const std::string& rootName() const override { return m_rootName; }
161 
163  StatusCode registerAddress( std::string_view path, IOpaqueAddress* pAddr ) override {
164  return fwd( [&]( IDataManagerSvc& p ) { return p.registerAddress( path, pAddr ); } );
165  }
167  StatusCode registerAddress( IRegistry* parent, std::string_view path, IOpaqueAddress* pAdd ) override {
168  return fwd( [&]( IDataManagerSvc& p ) { return p.registerAddress( parent, path, pAdd ); } );
169  }
171  StatusCode unregisterAddress( std::string_view path ) override {
172  return fwd( [&]( IDataManagerSvc& p ) { return p.unregisterAddress( path ); } );
173  }
175  StatusCode unregisterAddress( IRegistry* pParent, std::string_view path ) override {
176  return fwd( [&]( IDataManagerSvc& p ) { return p.unregisterAddress( pParent, path ); } );
177  }
179  StatusCode objectLeaves( const DataObject* pObject, std::vector<IRegistry*>& leaves ) override {
180  return fwd( [&]( IDataManagerSvc& p ) { return p.objectLeaves( pObject, leaves ); } );
181  }
183  StatusCode objectLeaves( const IRegistry* pObject, std::vector<IRegistry*>& leaves ) override {
184  return fwd( [&]( IDataManagerSvc& p ) { return p.objectLeaves( pObject, leaves ); } );
185  }
187  StatusCode objectParent( const DataObject* pObject, IRegistry*& refpParent ) override {
188  return fwd( [&]( IDataManagerSvc& p ) { return p.objectParent( pObject, refpParent ); } );
189  }
191  StatusCode objectParent( const IRegistry* pObject, IRegistry*& refpParent ) override {
192  return fwd( [&]( IDataManagerSvc& p ) { return p.objectParent( pObject, refpParent ); } );
193  }
195  StatusCode clearSubTree( std::string_view path ) override {
196  return fwd( [&]( IDataManagerSvc& p ) { return p.clearSubTree( path ); } );
197  }
199  StatusCode clearSubTree( DataObject* pObject ) override {
200  return fwd( [&]( IDataManagerSvc& p ) { return p.clearSubTree( pObject ); } );
201  }
203  StatusCode clearStore() override {
204  for_( m_partitions, []( Partition& p ) { p.dataManager->clearStore().ignore(); } );
205  return StatusCode::SUCCESS;
206  }
207 
209  StatusCode traverseSubTree( std::string_view path, IDataStoreAgent* pAgent ) override {
210  return fwd( [&]( IDataManagerSvc& p ) { return p.traverseSubTree( path, pAgent ); } );
211  }
213  StatusCode traverseSubTree( DataObject* pObject, IDataStoreAgent* pAgent ) override {
214  return fwd( [&]( IDataManagerSvc& p ) { return p.traverseSubTree( pObject, pAgent ); } );
215  }
218  return fwd( [&]( IDataManagerSvc& p ) { return p.traverseTree( pAgent ); } );
219  }
223  return fwd(
224  [pObj, path = std::move( path )]( IDataManagerSvc& p ) { return p.setRoot( std::move( path ), pObj ); } );
225  }
226 
230  return fwd(
231  [pAddr, path = std::move( path )]( IDataManagerSvc& p ) { return p.setRoot( std::move( path ), pAddr ); } );
232  }
233 
238  StatusCode setDataLoader( IConversionSvc* pDataLoader, IDataProviderSvc* = nullptr ) override {
239  if ( pDataLoader ) pDataLoader->addRef();
240  if ( m_dataLoader ) m_dataLoader->release();
241  if ( pDataLoader ) pDataLoader->setDataProvider( this );
242  m_dataLoader = pDataLoader;
243  for_( m_partitions, [&]( Partition& p ) { p.dataManager->setDataLoader( m_dataLoader, this ).ignore(); } );
244  return StatusCode::SUCCESS;
245  }
247  StatusCode addPreLoadItem( const DataStoreItem& item ) override {
248  for_( m_partitions, [&]( Partition& p ) { p.dataProvider->addPreLoadItem( item ); } );
249  return StatusCode::SUCCESS;
250  }
252  StatusCode removePreLoadItem( const DataStoreItem& item ) override {
253  for_( m_partitions, [&]( Partition& p ) { p.dataProvider->removePreLoadItem( item ); } );
254  return StatusCode::SUCCESS;
255  }
258  for_( m_partitions, [&]( Partition& p ) { p.dataProvider->resetPreLoad(); } );
259  return StatusCode::SUCCESS;
260  }
262  StatusCode preLoad() override {
263  return fwd( [&]( IDataProviderSvc& p ) { return p.preLoad(); } );
264  }
266  StatusCode registerObject( std::string_view parent, std::string_view obj, DataObject* pObj ) override {
267  return fwd( [&]( IDataProviderSvc& p ) { return p.registerObject( parent, obj, pObj ); } );
268  }
270  StatusCode registerObject( DataObject* parent, std::string_view obj, DataObject* pObj ) override {
271  return fwd( [&]( IDataProviderSvc& p ) { return p.registerObject( parent, obj, pObj ); } );
272  }
274  StatusCode unregisterObject( std::string_view path ) override {
275  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( path ); } );
276  }
279  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( pObj ); } );
280  }
282  StatusCode unregisterObject( DataObject* pObj, std::string_view path ) override {
283  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( pObj, path ); } );
284  }
286  StatusCode retrieveObject( IRegistry* parent, std::string_view path, DataObject*& pObj ) override {
287  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( parent, path, pObj ); } );
288  }
290  StatusCode findObject( std::string_view path, DataObject*& pObj ) override {
291  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( path, pObj ); } );
292  }
294  StatusCode findObject( IRegistry* parent, std::string_view path, DataObject*& pObj ) override {
295  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( parent, path, pObj ); } );
296  }
298  StatusCode linkObject( IRegistry* from, std::string_view objPath, DataObject* to ) override {
299  return fwd( [&]( IDataProviderSvc& p ) { return p.linkObject( from, objPath, to ); } );
300  }
302  StatusCode linkObject( std::string_view fullPath, DataObject* to ) override {
303  return fwd( [&]( IDataProviderSvc& p ) { return p.linkObject( fullPath, to ); } );
304  }
306  StatusCode unlinkObject( IRegistry* from, std::string_view objPath ) override {
307  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( from, objPath ); } );
308  }
310  StatusCode unlinkObject( DataObject* from, std::string_view objPath ) override {
311  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( from, objPath ); } );
312  }
314  StatusCode unlinkObject( std::string_view path ) override {
315  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( path ); } );
316  }
318  StatusCode updateObject( IRegistry* pDirectory ) override {
319  return fwd( [&]( IDataProviderSvc& p ) { return p.updateObject( pDirectory ); } );
320  }
322  StatusCode updateObject( DataObject* pObj ) override {
323  return fwd( [&]( IDataProviderSvc& p ) { return p.updateObject( pObj ); } );
324  }
325 
326  //
327  //---IHiveWhiteBard implemenation--------------------------------------------------
328  //
329 
331  StatusCode clearStore( size_t partition ) override {
332  return m_partitions[partition].with_lock( []( Partition& p ) { return p.dataManager->clearStore(); } );
333  }
334 
336  StatusCode selectStore( size_t partition ) override {
337  s_current = &m_partitions[partition];
338  return StatusCode::SUCCESS;
339  }
340 
342  StatusCode setNumberOfStores( size_t slots ) override {
343  if ( FSMState() == Gaudi::StateMachine::INITIALIZED || FSMState() == Gaudi::StateMachine::RUNNING ) {
344  warning() << "Too late to change the number of slots!" << endmsg;
345  return StatusCode::FAILURE;
346  }
347  m_slots = slots;
349  return StatusCode::SUCCESS;
350  }
351 
353  size_t getNumberOfStores() const override { return m_slots; }
354 
356  bool exists( const DataObjID& id ) override {
357  DataObject* pObject{nullptr};
358  return findObject( id.fullKey(), pObject ).isSuccess();
359  }
360 
362  size_t allocateStore( int evtnumber ) override {
363  // take next free slot in the list
364  size_t slot = std::string::npos;
365  if ( m_freeSlots.try_pop( slot ) ) {
366  assert( slot != std::string::npos );
367  assert( slot < m_partitions.size() );
368  m_partitions[slot].with_lock( [evtnumber]( Partition& p ) {
369  assert( p.eventNumber == -1 ); // or whatever value represents 'free'
370  p.eventNumber = evtnumber;
371  } );
372  }
373  return slot;
374  }
375 
377  StatusCode freeStore( size_t partition ) override {
378  assert( partition < m_partitions.size() );
379  auto prev = m_partitions[partition].with_lock( []( Partition& p ) { return std::exchange( p.eventNumber, -1 ); } );
380  if ( UNLIKELY( prev == -1 ) ) return StatusCode::FAILURE; // double free -- should never happen!
381  m_freeSlots.push( partition );
382  return StatusCode::SUCCESS;
383  }
384 
386  size_t getPartitionNumber( int eventnumber ) const override {
387  auto i = std::find_if( begin( m_partitions ), end( m_partitions ),
388  with_lock( [eventnumber]( const Partition& p ) { return p.eventNumber == eventnumber; } ) );
389  return i != end( m_partitions ) ? std::distance( begin( m_partitions ), i ) : std::string::npos;
390  }
391 
393  StatusCode sc = service( m_loader, m_addrCreator, true );
394  if ( !sc.isSuccess() ) {
395  error() << "Failed to retrieve data loader "
396  << "\"" << m_loader << "\"" << endmsg;
397  return sc;
398  }
399  IConversionSvc* dataLoader = nullptr;
400  sc = service( m_loader, dataLoader, true );
401  if ( !sc.isSuccess() ) {
402  error() << MSG::ERROR << "Failed to retrieve data loader "
403  << "\"" << m_loader << "\"" << endmsg;
404  return sc;
405  }
406  sc = setDataLoader( dataLoader );
407  dataLoader->release();
408  if ( !sc.isSuccess() ) {
409  error() << MSG::ERROR << "Failed to set data loader "
410  << "\"" << m_loader << "\"" << endmsg;
411  return sc;
412  }
413  return sc;
414  }
415 
417  if ( m_addrCreator ) m_addrCreator->release();
418  if ( m_dataLoader ) m_dataLoader->release();
419  m_addrCreator = nullptr;
420  m_dataLoader = nullptr;
421  return StatusCode::SUCCESS;
422  }
423 
424  //
425  //---IService implemenation---------------------------------------------------------
426  //
427 
429  StatusCode initialize() override {
431  if ( !sc.isSuccess() ) {
432  error() << "Unable to initialize base class" << endmsg;
433  return sc;
434  }
435  if ( m_slots < (size_t)1 ) {
436  error() << "Invalid number of slots (" << m_slots << ")" << endmsg;
437  return StatusCode::FAILURE;
438  }
439 
440  if ( !setNumberOfStores( m_slots ).isSuccess() ) {
441  error() << "Cannot set number of slots" << endmsg;
442  return StatusCode::FAILURE;
443  }
444 
445  m_partitions = std::vector<Synced<Partition>>( m_slots );
446  for ( size_t i = 0; i < m_slots; i++ ) {
447  DataSvc* svc = new DataSvc( name() + "_" + std::to_string( i ), serviceLocator() );
448  // Percolate properties
449  svc->setProperty( m_rootCLID ).ignore();
450  svc->setProperty( m_rootName ).ignore();
451  svc->setProperty( m_forceLeaves ).ignore();
452  svc->setProperty( m_enableFaultHdlr ).ignore();
453  // make sure that CommonMessaging is initialized
454  svc->setProperty( m_outputLevel ).ignore();
455 
456  sc = svc->initialize();
457  if ( !sc.isSuccess() ) {
458  error() << "Failed to instantiate DataSvc as store partition" << endmsg;
459  return sc;
460  }
461  m_partitions[i].with_lock( [&]( Partition& p ) {
462  p.dataProvider = svc;
463  p.dataManager = svc;
464  } );
465  m_freeSlots.push( i );
466  }
467  selectStore( 0 ).ignore();
468  return attachServices();
469  }
470 
474  if ( !sc.isSuccess() ) {
475  error() << "Unable to reinitialize base class" << endmsg;
476  return sc;
477  }
478  detachServices();
479  sc = attachServices();
480  if ( !sc.isSuccess() ) {
481  error() << "Failed to attach necessary services." << endmsg;
482  return sc;
483  }
484  return StatusCode::SUCCESS;
485  }
486 
488  StatusCode finalize() override {
489  setDataLoader( 0 ).ignore();
490  clearStore().ignore();
491  return Service::finalize();
492  }
493 };
494 
495 // Instantiation of a static factory class used by clients to create
496 // instances of this service
virtual StatusCode traverseTree(IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects in the data store.
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
#define UNLIKELY(x)
Definition: Kernel.h:89
StatusCode initialize() override
Definition: Service.cpp:60
StatusCode unregisterObject(DataObject *pObj) override
Unregister object from the data store.
StatusCode registerAddress(std::string_view path, IOpaqueAddress *pAddr) override
IDataManagerSvc: Register object address with the data store.
StatusCode retrieveObject(IRegistry *parent, std::string_view path, DataObject *&pObj) override
Retrieve object from data store.
size_t allocateStore(int evtnumber) override
Allocate a store partition for a given event number.
virtual StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &refLeaves)=0
Explore the object store: retrieve all leaves attached to the object The object is identified by its ...
T distance(T...args)
virtual StatusCode registerAddress(std::string_view fullPath, IOpaqueAddress *pAddress)=0
Register object address with the data store.
virtual StatusCode linkObject(IRegistry *from, std::string_view objPath, DataObject *toObj)=0
Add a link to another object.
StatusCode finalize() override
Definition: Service.cpp:164
Implementation of property with value of concrete type.
Definition: Property.h:352
StatusCode setProperty(const Gaudi::Details::PropertyBase &p) override
set the property form another property
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...
StatusCode freeStore(size_t partition) override
Free a store partition.
StatusCode registerObject(std::string_view parent, std::string_view obj, DataObject *pObj) override
Register object with the data store.
StatusCode traverseSubTree(std::string_view path, IDataStoreAgent *pAgent) override
Analyze by traversing all data objects below the sub tree.
StatusCode unregisterObject(std::string_view path) override
Unregister object from the data store.
size_t getPartitionNumber(int eventnumber) const override
Get the partition number corresponding to a given event.
StatusCode clearStore(size_t partition) override
Remove all data objects in one &#39;slot&#39; of the data store.
StatusCode linkObject(std::string_view fullPath, DataObject *to) override
Add a link to another object.
StatusCode linkObject(IRegistry *from, std::string_view objPath, DataObject *to) override
Add a link to another object.
bool isSuccess() const
Definition: StatusCode.h:267
StatusCode unregisterObject(DataObject *pObj, std::string_view path) override
Unregister object from the data store.
virtual StatusCode setRoot(std::string root_name, DataObject *pObject)=0
Initialize data store for new event by giving new event path.
virtual StatusCode unregisterAddress(std::string_view fullPath)=0
Unregister object address from the data store.
T to_string(T...args)
IAddressCreator interface definition.
virtual StatusCode setDataProvider(IDataProviderSvc *pService)=0
Set Data provider service.
StatusCode unregisterAddress(IRegistry *pParent, std::string_view path) override
IDataManagerSvc: Unregister object address from the data store.
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
virtual StatusCode preLoad()=0
Load all preload items of the list.
StatusCode resetPreLoad() override
Clear the preload list.
StatusCode finalize() override
Service initialisation.
StatusCode clearSubTree(DataObject *pObject) override
Remove all data objects below the sub tree identified.
size_t getNumberOfStores() const override
Get the number of event slots (copies of DataSvc objects).
StatusCode objectParent(const IRegistry *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object&#39;s parent.
StatusCode addPreLoadItem(const DataStoreItem &item) override
Add an item to the preload list.
StatusCode updateObject(DataObject *pObj) override
Update object.
std::vector< Synced< Partition > > m_partitions
Datastore partitions.
StatusCode clearSubTree(std::string_view path) override
Remove all data objects below the sub tree identified.
Data provider interface definition.
StatusCode preLoad() override
load all preload items of the list
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
StatusCode unregisterAddress(std::string_view path) override
IDataManagerSvc: Unregister object address from the data store.
StatusCode unlinkObject(std::string_view path) override
Remove a link to another object.
size_t freeSlots() override
Get free slots number.
virtual StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent)=0
IDataManagerSvc: Explore the object store: retrieve the object&#39;s parent.
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
virtual StatusCode unlinkObject(IRegistry *from, std::string_view objPath)=0
Remove a link to another object.
StatusCode selectStore(size_t partition) override
Activate a partition object. The identifies the partition uniquely.
Invalid root path object cannot be retrieved or stored.
STL class.
#define DECLARE_COMPONENT(type)
StatusCode registerAddress(IRegistry *parent, std::string_view path, IOpaqueAddress *pAdd) override
IDataManagerSvc: Register object address with the data store.
virtual StatusCode unregisterObject(std::string_view fullPath)=0
Unregister object from the data store.
virtual StatusCode clearSubTree(std::string_view sub_path)=0
Remove all data objects below the sub tree identified by its full path name.
StatusCode detachServices()
TupleObj.h GaudiAlg/TupleObj.h namespace with few technical implementations.
StatusCode objectLeaves(const IRegistry *pObject, std::vector< IRegistry * > &leaves) override
Explore the object store: retrieve all leaves attached to the object.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
typename arg_helper< lambda >::type argument_t
Definition: EventIDBase.h:33
virtual StatusCode updateObject(IRegistry *pDirectory)=0
Update object identified by its directory entry.
T lock(T...args)
StatusCode removePreLoadItem(const DataStoreItem &item) override
Remove an item from the preload list.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
StatusCode reinitialize() override
Definition: Service.cpp:237
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
T clear(T...args)
T move(T...args)
Data service base class.
TTHREAD_TLS(Synced< Partition > *) s_current
StatusCode attachServices()
StatusCode traverseSubTree(DataObject *pObject, IDataStoreAgent *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects below the sub tree.
T find_if(T...args)
T size(T...args)
StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object&#39;s parent.
StatusCode setRoot(std::string path, IOpaqueAddress *pAddr) override
Initialize data store for new event by giving new event path and address of root object.
STL class.
StatusCode unlinkObject(DataObject *from, std::string_view objPath) override
Remove a link to another object.
virtual StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
virtual unsigned long release()=0
Release Interface instance.
Generic data agent interface.
StatusCode registerObject(std::string_view fullPath, DataObject *pObject)
Register object with the data store.
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
StatusCode initialize() override
Service initialization.
Definition: DataSvc.cpp:812
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:153
StatusCode setRoot(std::string path, DataObject *pObj) override
Initialize data store for new event by giving new event path and root object.
CLID rootCLID() const override
IDataManagerSvc: Accessor for root event CLID.
Data service base class.
Definition: DataSvc.h:42
StatusCode setDataLoader(IConversionSvc *pDataLoader, IDataProviderSvc *=nullptr) override
IDataManagerSvc: Pass a default data loader to the service.
constexpr static const auto FAILURE
Definition: StatusCode.h:86
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &leaves) override
Explore the object store: retrieve all leaves attached to the object.
StatusCode initialize() override
Service initialisation.
StatusCode traverseTree(IDataStoreAgent *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects in the data store.
AttribStringParser::Iterator begin(const AttribStringParser &parser)
Opaque address interface definition.
StatusCode findObject(std::string_view path, DataObject *&pObj) override
Find object identified by its full path in the data store.
T for_each(T...args)
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
StatusCode findObject(IRegistry *parent, std::string_view path, DataObject *&pObj) override
Find object identified by its full path in the data store.
tbb::concurrent_queue< size_t > m_freeSlots
fifo queue of free slots
StatusCode unlinkObject(IRegistry *from, std::string_view objPath) override
Remove a link to another object.
bool exists(const DataObjID &id) override
check if a data object exists in the current store
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
const std::string & rootName() const override
Name for root Event.
static GAUDI_API void setNumConcEvents(const std::size_t &nE)
StatusCode reinitialize() override
Service initialisation.
StatusCode setNumberOfStores(size_t slots) override
Set the number of event slots (copies of DataSvc objects).
~HiveWhiteBoard() override
Standard Destructor.
StatusCode registerObject(DataObject *parent, std::string_view obj, DataObject *pObj) override
Register object with the data store.