The Gaudi Framework  v33r0 (d5ea422b)
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 "tbb/tbb_stddef.h"
30 #if TBB_INTERFACE_VERSION_MAJOR < 12
31 # include "tbb/recursive_mutex.h"
32 #endif // TBB_INTERFACE_VERSION_MAJOR < 12
33 #include <mutex>
34 #include <utility>
35 
36 // Interfaces
44 #include "GaudiKernel/IRegistry.h"
47 
48 namespace {
49  struct Partition final {
50  SmartIF<IDataProviderSvc> dataProvider;
51  SmartIF<IDataManagerSvc> dataManager;
52  int eventNumber = -1;
53 
54  // allow acces 'by type' -- used in fwd
55  template <typename T>
56  T* get();
57  };
58  template <>
59  IDataProviderSvc* Partition::get<IDataProviderSvc>() {
60  return dataProvider.get();
61  }
62  template <>
63  IDataManagerSvc* Partition::get<IDataManagerSvc>() {
64  return dataManager.get();
65  }
66 
67  // C++20: replace with http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0290r2.html
68  // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4033.html
69 
70 #if TBB_INTERFACE_VERSION_MAJOR < 12
71  template <typename T, typename Mutex = tbb::recursive_mutex, typename ReadLock = typename Mutex::scoped_lock,
72 #else
73  template <typename T, typename Mutex = std::recursive_mutex,
74  typename ReadLock = std::lock_guard<std::recursive_mutex>,
75 #endif // TBB_INTERFACE_VERSION_MAJOR < 12
76  typename WriteLock = ReadLock>
77  class Synced {
78  T m_obj;
79  mutable Mutex m_mtx;
80 
81  public:
82  template <typename F>
83  decltype( auto ) with_lock( F&& f ) {
84  WriteLock lock{m_mtx};
85  return f( m_obj );
86  }
87  template <typename F>
88  decltype( auto ) with_lock( F&& f ) const {
89  ReadLock lock{m_mtx};
90  return f( m_obj );
91  }
92  };
93  // transform an f(T) into an f(Synced<T>)
94  template <typename Fun>
95  auto with_lock( Fun&& f ) {
96  return [f = std::forward<Fun>( f )]( auto& p ) -> decltype( auto ) { return p.with_lock( f ); };
97  }
98  // call f(T) for each element in a container of Synced<T>
99  template <typename ContainerOfSynced, typename Fun>
100  void for_( ContainerOfSynced& c, Fun&& f ) {
101  std::for_each( begin( c ), end( c ), with_lock( std::forward<Fun>( f ) ) );
102  }
103 } // namespace
104 
105 TTHREAD_TLS( Synced<Partition>* ) s_current = nullptr;
106 
107 namespace {
108  namespace detail {
109  // given a callable F(Arg_t,...)
110  // argument_t<F> will be equal to Arg_t
111  template <typename F>
112  using argument_t = std::tuple_element_t<0, boost::callable_traits::args_t<F>>;
113  } // namespace detail
114 
115  template <typename Fun>
116  StatusCode fwd( Fun f ) {
117  if ( !s_current ) return IDataProviderSvc::Status::INVALID_ROOT;
118  return s_current->with_lock( [&]( Partition& p ) {
119  auto* svc = p.get<std::decay_t<detail::argument_t<Fun>>>();
120  return svc ? f( *svc ) : IDataProviderSvc::Status::INVALID_ROOT;
121  } );
122  }
123 } // namespace
124 
137 class HiveWhiteBoard : public extends<Service, IDataProviderSvc, IDataManagerSvc, IHiveWhiteBoard> {
138 protected:
139  Gaudi::Property<CLID> m_rootCLID{this, "RootCLID", 110 /*CLID_Event*/, "CLID of root entry"};
140  Gaudi::Property<std::string> m_rootName{this, "RootName", "/Event", "name of root entry"};
141  Gaudi::Property<std::string> m_loader{this, "DataLoader", "EventPersistencySvc", ""};
142  Gaudi::Property<size_t> m_slots{this, "EventSlots", 1, "number of event slots"};
143  Gaudi::Property<bool> m_forceLeaves{this, "ForceLeaves", false, "force creation of default leaves on registerObject"};
144  Gaudi::Property<bool> m_enableFaultHdlr{this, "EnableFaultHandler", false,
145  "enable incidents on data creation requests"};
146 
154  tbb::concurrent_queue<size_t> m_freeSlots;
155 
156 public:
158  using extends::extends;
159 
161  ~HiveWhiteBoard() override {
162  setDataLoader( 0 ).ignore();
163  resetPreLoad().ignore();
164  clearStore().ignore();
165  for_( m_partitions, []( Partition& p ) {
166  p.dataManager->release();
167  p.dataProvider->release();
168  } );
170  }
171 
173  size_t freeSlots() override { return m_freeSlots.unsafe_size(); }
174 
176  CLID rootCLID() const override { return (CLID)m_rootCLID; }
178  const std::string& rootName() const override { return m_rootName; }
179 
181  StatusCode registerAddress( std::string_view path, IOpaqueAddress* pAddr ) override {
182  return fwd( [&]( IDataManagerSvc& p ) { return p.registerAddress( path, pAddr ); } );
183  }
185  StatusCode registerAddress( IRegistry* parent, std::string_view path, IOpaqueAddress* pAdd ) override {
186  return fwd( [&]( IDataManagerSvc& p ) { return p.registerAddress( parent, path, pAdd ); } );
187  }
189  StatusCode unregisterAddress( std::string_view path ) override {
190  return fwd( [&]( IDataManagerSvc& p ) { return p.unregisterAddress( path ); } );
191  }
193  StatusCode unregisterAddress( IRegistry* pParent, std::string_view path ) override {
194  return fwd( [&]( IDataManagerSvc& p ) { return p.unregisterAddress( pParent, path ); } );
195  }
197  StatusCode objectLeaves( const DataObject* pObject, std::vector<IRegistry*>& leaves ) override {
198  return fwd( [&]( IDataManagerSvc& p ) { return p.objectLeaves( pObject, leaves ); } );
199  }
201  StatusCode objectLeaves( const IRegistry* pObject, std::vector<IRegistry*>& leaves ) override {
202  return fwd( [&]( IDataManagerSvc& p ) { return p.objectLeaves( pObject, leaves ); } );
203  }
205  StatusCode objectParent( const DataObject* pObject, IRegistry*& refpParent ) override {
206  return fwd( [&]( IDataManagerSvc& p ) { return p.objectParent( pObject, refpParent ); } );
207  }
209  StatusCode objectParent( const IRegistry* pObject, IRegistry*& refpParent ) override {
210  return fwd( [&]( IDataManagerSvc& p ) { return p.objectParent( pObject, refpParent ); } );
211  }
213  StatusCode clearSubTree( std::string_view path ) override {
214  return fwd( [&]( IDataManagerSvc& p ) { return p.clearSubTree( path ); } );
215  }
217  StatusCode clearSubTree( DataObject* pObject ) override {
218  return fwd( [&]( IDataManagerSvc& p ) { return p.clearSubTree( pObject ); } );
219  }
221  StatusCode clearStore() override {
222  for_( m_partitions, []( Partition& p ) { p.dataManager->clearStore().ignore(); } );
223  return StatusCode::SUCCESS;
224  }
225 
227  StatusCode traverseSubTree( std::string_view path, IDataStoreAgent* pAgent ) override {
228  return fwd( [&]( IDataManagerSvc& p ) { return p.traverseSubTree( path, pAgent ); } );
229  }
231  StatusCode traverseSubTree( DataObject* pObject, IDataStoreAgent* pAgent ) override {
232  return fwd( [&]( IDataManagerSvc& p ) { return p.traverseSubTree( pObject, pAgent ); } );
233  }
236  return fwd( [&]( IDataManagerSvc& p ) { return p.traverseTree( pAgent ); } );
237  }
241  return fwd(
242  [pObj, path = std::move( path )]( IDataManagerSvc& p ) { return p.setRoot( std::move( path ), pObj ); } );
243  }
244 
248  return fwd(
249  [pAddr, path = std::move( path )]( IDataManagerSvc& p ) { return p.setRoot( std::move( path ), pAddr ); } );
250  }
251 
256  StatusCode setDataLoader( IConversionSvc* pDataLoader, IDataProviderSvc* = nullptr ) override {
257  if ( pDataLoader ) pDataLoader->addRef();
259  if ( pDataLoader ) pDataLoader->setDataProvider( this );
260  m_dataLoader = pDataLoader;
261  for_( m_partitions, [&]( Partition& p ) { p.dataManager->setDataLoader( m_dataLoader, this ).ignore(); } );
262  return StatusCode::SUCCESS;
263  }
265  StatusCode addPreLoadItem( const DataStoreItem& item ) override {
266  for_( m_partitions, [&]( Partition& p ) { p.dataProvider->addPreLoadItem( item ); } );
267  return StatusCode::SUCCESS;
268  }
270  StatusCode removePreLoadItem( const DataStoreItem& item ) override {
271  for_( m_partitions, [&]( Partition& p ) { p.dataProvider->removePreLoadItem( item ); } );
272  return StatusCode::SUCCESS;
273  }
276  for_( m_partitions, [&]( Partition& p ) { p.dataProvider->resetPreLoad(); } );
277  return StatusCode::SUCCESS;
278  }
280  StatusCode preLoad() override {
281  return fwd( [&]( IDataProviderSvc& p ) { return p.preLoad(); } );
282  }
284  StatusCode registerObject( std::string_view parent, std::string_view obj, DataObject* pObj ) override {
285  return fwd( [&]( IDataProviderSvc& p ) { return p.registerObject( parent, obj, pObj ); } );
286  }
288  StatusCode registerObject( DataObject* parent, std::string_view obj, DataObject* pObj ) override {
289  return fwd( [&]( IDataProviderSvc& p ) { return p.registerObject( parent, obj, pObj ); } );
290  }
292  StatusCode unregisterObject( std::string_view path ) override {
293  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( path ); } );
294  }
297  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( pObj ); } );
298  }
300  StatusCode unregisterObject( DataObject* pObj, std::string_view path ) override {
301  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( pObj, path ); } );
302  }
304  StatusCode retrieveObject( IRegistry* parent, std::string_view path, DataObject*& pObj ) override {
305  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( parent, path, pObj ); } );
306  }
308  StatusCode findObject( std::string_view path, DataObject*& pObj ) override {
309  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( path, pObj ); } );
310  }
312  StatusCode findObject( IRegistry* parent, std::string_view path, DataObject*& pObj ) override {
313  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( parent, path, pObj ); } );
314  }
316  StatusCode linkObject( IRegistry* from, std::string_view objPath, DataObject* to ) override {
317  return fwd( [&]( IDataProviderSvc& p ) { return p.linkObject( from, objPath, to ); } );
318  }
320  StatusCode linkObject( std::string_view fullPath, DataObject* to ) override {
321  return fwd( [&]( IDataProviderSvc& p ) { return p.linkObject( fullPath, to ); } );
322  }
324  StatusCode unlinkObject( IRegistry* from, std::string_view objPath ) override {
325  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( from, objPath ); } );
326  }
328  StatusCode unlinkObject( DataObject* from, std::string_view objPath ) override {
329  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( from, objPath ); } );
330  }
332  StatusCode unlinkObject( std::string_view path ) override {
333  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( path ); } );
334  }
336  StatusCode updateObject( IRegistry* pDirectory ) override {
337  return fwd( [&]( IDataProviderSvc& p ) { return p.updateObject( pDirectory ); } );
338  }
340  StatusCode updateObject( DataObject* pObj ) override {
341  return fwd( [&]( IDataProviderSvc& p ) { return p.updateObject( pObj ); } );
342  }
343 
344  //
345  //---IHiveWhiteBard implemenation--------------------------------------------------
346  //
347 
349  StatusCode clearStore( size_t partition ) override {
350  return m_partitions[partition].with_lock( []( Partition& p ) { return p.dataManager->clearStore(); } );
351  }
352 
354  StatusCode selectStore( size_t partition ) override {
355  s_current = &m_partitions[partition];
356  return StatusCode::SUCCESS;
357  }
358 
360  StatusCode setNumberOfStores( size_t slots ) override {
362  warning() << "Too late to change the number of slots!" << endmsg;
363  return StatusCode::FAILURE;
364  }
365  m_slots = slots;
367  return StatusCode::SUCCESS;
368  }
369 
371  size_t getNumberOfStores() const override { return m_slots; }
372 
374  bool exists( const DataObjID& id ) override {
375  DataObject* pObject{nullptr};
376  return findObject( id.fullKey(), pObject ).isSuccess();
377  }
378 
380  size_t allocateStore( int evtnumber ) override {
381  // take next free slot in the list
382  size_t slot = std::string::npos;
383  if ( m_freeSlots.try_pop( slot ) ) {
384  assert( slot != std::string::npos );
385  assert( slot < m_partitions.size() );
386  m_partitions[slot].with_lock( [evtnumber]( Partition& p ) {
387  assert( p.eventNumber == -1 ); // or whatever value represents 'free'
388  p.eventNumber = evtnumber;
389  } );
390  }
391  return slot;
392  }
393 
395  StatusCode freeStore( size_t partition ) override {
396  assert( partition < m_partitions.size() );
397  auto prev = m_partitions[partition].with_lock( []( Partition& p ) { return std::exchange( p.eventNumber, -1 ); } );
398  if ( UNLIKELY( prev == -1 ) ) return StatusCode::FAILURE; // double free -- should never happen!
399  m_freeSlots.push( partition );
400  return StatusCode::SUCCESS;
401  }
402 
404  size_t getPartitionNumber( int eventnumber ) const override {
406  with_lock( [eventnumber]( const Partition& p ) { return p.eventNumber == eventnumber; } ) );
407  return i != end( m_partitions ) ? std::distance( begin( m_partitions ), i ) : std::string::npos;
408  }
409 
411  StatusCode sc = service( m_loader, m_addrCreator, true );
412  if ( !sc.isSuccess() ) {
413  error() << "Failed to retrieve data loader "
414  << "\"" << m_loader << "\"" << endmsg;
415  return sc;
416  }
417  IConversionSvc* dataLoader = nullptr;
418  sc = service( m_loader, dataLoader, true );
419  if ( !sc.isSuccess() ) {
420  error() << MSG::ERROR << "Failed to retrieve data loader "
421  << "\"" << m_loader << "\"" << endmsg;
422  return sc;
423  }
424  sc = setDataLoader( dataLoader );
425  dataLoader->release();
426  if ( !sc.isSuccess() ) {
427  error() << MSG::ERROR << "Failed to set data loader "
428  << "\"" << m_loader << "\"" << endmsg;
429  return sc;
430  }
431  return sc;
432  }
433 
437  m_addrCreator = nullptr;
438  m_dataLoader = nullptr;
439  return StatusCode::SUCCESS;
440  }
441 
442  //
443  //---IService implemenation---------------------------------------------------------
444  //
445 
447  StatusCode initialize() override {
449  if ( !sc.isSuccess() ) {
450  error() << "Unable to initialize base class" << endmsg;
451  return sc;
452  }
453  if ( m_slots < (size_t)1 ) {
454  error() << "Invalid number of slots (" << m_slots << ")" << endmsg;
455  return StatusCode::FAILURE;
456  }
457 
458  if ( !setNumberOfStores( m_slots ).isSuccess() ) {
459  error() << "Cannot set number of slots" << endmsg;
460  return StatusCode::FAILURE;
461  }
462 
464  for ( size_t i = 0; i < m_slots; i++ ) {
465  DataSvc* svc = new DataSvc( name() + "_" + std::to_string( i ), serviceLocator() );
466  // Percolate properties
467  svc->setProperty( m_rootCLID ).ignore();
468  svc->setProperty( m_rootName ).ignore();
469  svc->setProperty( m_forceLeaves ).ignore();
471  // make sure that CommonMessaging is initialized
472  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();
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
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.
Gaudi::Property< int > m_outputLevel
Definition: Service.h:186
#define UNLIKELY(x)
Definition: Kernel.h:106
StatusCode initialize() override
Definition: Service.cpp:70
Gaudi::Property< std::string > m_rootName
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.
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:287
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.
Gaudi::Property< bool > m_enableFaultHdlr
StatusCode finalize() override
Definition: Service.cpp:174
Implementation of property with value of concrete type.
Definition: Property.h:370
Gaudi::StateMachine::State FSMState() const override
Definition: Service.h:62
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.
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
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.
StatusCode clearStore(size_t partition) override
Remove all data objects in one 'slot' 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.
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.
Gaudi::Property< std::string > m_loader
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:96
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.
StatusCode objectParent(const IRegistry *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object'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.
auto get(const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))
Data provider interface definition.
StatusCode preLoad() override
load all preload items of the list
Description of the DataStoreItem class.
Definition: DataStoreItem.h:27
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'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.
size_t getPartitionNumber(int eventnumber) const override
Get the partition number corresponding to a given event.
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.
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:284
virtual StatusCode clearSubTree(std::string_view sub_path)=0
Remove all data objects below the sub tree identified by its full path name.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
StatusCode detachServices()
Gaudi::Property< CLID > m_rootCLID
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:61
typename arg_helper< lambda >::type argument_t
Definition: EventIDBase.h:43
virtual StatusCode updateObject(IRegistry *pDirectory)=0
Update object identified by its directory entry.
CLID rootCLID() const override
IDataManagerSvc: Accessor for root event CLID.
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:32
StatusCode reinitialize() override
Definition: Service.cpp:247
def end
Definition: IOTest.py:123
unsigned int CLID
Class ID definition.
Definition: ClassID.h:18
T clear(T... args)
bool isSuccess() const
Definition: StatusCode.h:361
size_t getNumberOfStores() const override
Get the number of event slots (copies of DataSvc objects).
Gaudi::Property< size_t > m_slots
T move(T... args)
const std::string & rootName() const override
Name for root Event.
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)
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:164
StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object'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.
IAddressCreator * m_addrCreator
Reference to address creator.
Generic data agent interface.
StatusCode registerObject(std::string_view fullPath, DataObject *pObject)
Register object with the data store.
Gaudi::Property< bool > m_forceLeaves
Base class used to extend a class implementing other interfaces.
Definition: extends.h:20
StatusCode initialize() override
Service initialization.
Definition: DataSvc.cpp:822
StatusCode setRoot(std::string path, DataObject *pObj) override
Initialize data store for new event by giving new event path and root object.
Data service base class.
Definition: DataSvc.h:52
StatusCode setDataLoader(IConversionSvc *pDataLoader, IDataProviderSvc *=nullptr) override
IDataManagerSvc: Pass a default data loader to the service.
constexpr static const auto FAILURE
Definition: StatusCode.h:97
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 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:93
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.
IConversionSvc * m_dataLoader
Pointer to data loader service.
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:40
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:202
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.