Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
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 // 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( boost::string_ref path, IOpaqueAddress* pAddr ) override {
164  return fwd( [&]( IDataManagerSvc& p ) { return p.registerAddress( path, pAddr ); } );
165  }
167  StatusCode registerAddress( IRegistry* parent, boost::string_ref path, IOpaqueAddress* pAdd ) override {
168  return fwd( [&]( IDataManagerSvc& p ) { return p.registerAddress( parent, path, pAdd ); } );
169  }
171  StatusCode unregisterAddress( boost::string_ref path ) override {
172  return fwd( [&]( IDataManagerSvc& p ) { return p.unregisterAddress( path ); } );
173  }
175  StatusCode unregisterAddress( IRegistry* pParent, boost::string_ref 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( boost::string_ref 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( boost::string_ref 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 
239  IDataProviderSvc* dpsvc __attribute__( ( unused ) ) = nullptr ) override {
240  if ( pDataLoader ) pDataLoader->addRef();
241  if ( m_dataLoader ) m_dataLoader->release();
242  if ( pDataLoader ) pDataLoader->setDataProvider( this );
243  m_dataLoader = pDataLoader;
244  for_( m_partitions, [&]( Partition& p ) { p.dataManager->setDataLoader( m_dataLoader, this ).ignore(); } );
245  return StatusCode::SUCCESS;
246  }
248  StatusCode addPreLoadItem( const DataStoreItem& item ) override {
249  for_( m_partitions, [&]( Partition& p ) { p.dataProvider->addPreLoadItem( item ); } );
250  return StatusCode::SUCCESS;
251  }
253  StatusCode removePreLoadItem( const DataStoreItem& item ) override {
254  for_( m_partitions, [&]( Partition& p ) { p.dataProvider->removePreLoadItem( item ); } );
255  return StatusCode::SUCCESS;
256  }
259  for_( m_partitions, [&]( Partition& p ) { p.dataProvider->resetPreLoad(); } );
260  return StatusCode::SUCCESS;
261  }
263  StatusCode preLoad() override {
264  return fwd( [&]( IDataProviderSvc& p ) { return p.preLoad(); } );
265  }
267  StatusCode registerObject( boost::string_ref parent, boost::string_ref obj, DataObject* pObj ) override {
268  return fwd( [&]( IDataProviderSvc& p ) { return p.registerObject( parent, obj, pObj ); } );
269  }
271  StatusCode registerObject( DataObject* parent, boost::string_ref obj, DataObject* pObj ) override {
272  return fwd( [&]( IDataProviderSvc& p ) { return p.registerObject( parent, obj, pObj ); } );
273  }
275  StatusCode unregisterObject( boost::string_ref path ) override {
276  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( path ); } );
277  }
280  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( pObj ); } );
281  }
283  StatusCode unregisterObject( DataObject* pObj, boost::string_ref path ) override {
284  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( pObj, path ); } );
285  }
287  StatusCode retrieveObject( IRegistry* parent, boost::string_ref path, DataObject*& pObj ) override {
288  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( parent, path, pObj ); } );
289  }
291  StatusCode findObject( boost::string_ref path, DataObject*& pObj ) override {
292  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( path, pObj ); } );
293  }
295  StatusCode findObject( IRegistry* parent, boost::string_ref path, DataObject*& pObj ) override {
296  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( parent, path, pObj ); } );
297  }
299  StatusCode linkObject( IRegistry* from, boost::string_ref objPath, DataObject* to ) override {
300  return fwd( [&]( IDataProviderSvc& p ) { return p.linkObject( from, objPath, to ); } );
301  }
303  StatusCode linkObject( boost::string_ref fullPath, DataObject* to ) override {
304  return fwd( [&]( IDataProviderSvc& p ) { return p.linkObject( fullPath, to ); } );
305  }
307  StatusCode unlinkObject( IRegistry* from, boost::string_ref objPath ) override {
308  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( from, objPath ); } );
309  }
311  StatusCode unlinkObject( DataObject* from, boost::string_ref objPath ) override {
312  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( from, objPath ); } );
313  }
315  StatusCode unlinkObject( boost::string_ref path ) override {
316  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( path ); } );
317  }
319  StatusCode updateObject( IRegistry* pDirectory ) override {
320  return fwd( [&]( IDataProviderSvc& p ) { return p.updateObject( pDirectory ); } );
321  }
323  StatusCode updateObject( DataObject* pObj ) override {
324  return fwd( [&]( IDataProviderSvc& p ) { return p.updateObject( pObj ); } );
325  }
326 
327  //
328  //---IHiveWhiteBard implemenation--------------------------------------------------
329  //
330 
332  StatusCode clearStore( size_t partition ) override {
333  return m_partitions[partition].with_lock( []( Partition& p ) { return p.dataManager->clearStore(); } );
334  }
335 
337  StatusCode selectStore( size_t partition ) override {
338  s_current = &m_partitions[partition];
339  return StatusCode::SUCCESS;
340  }
341 
343  StatusCode setNumberOfStores( size_t slots ) override {
344  if ( FSMState() == Gaudi::StateMachine::INITIALIZED || FSMState() == Gaudi::StateMachine::RUNNING ) {
345  warning() << "Too late to change the number of slots!" << endmsg;
346  return StatusCode::FAILURE;
347  }
348  m_slots = slots;
350  return StatusCode::SUCCESS;
351  }
352 
354  size_t getNumberOfStores() const override { return m_slots; }
355 
357  bool exists( const DataObjID& id ) override {
358  DataObject* pObject{nullptr};
359  return findObject( id.fullKey(), pObject ).isSuccess();
360  }
361 
363  size_t allocateStore( int evtnumber ) override {
364  // take next free slot in the list
365  size_t slot = std::string::npos;
366  if ( m_freeSlots.try_pop( slot ) ) {
367  assert( slot != std::string::npos );
368  assert( slot < m_partitions.size() );
369  m_partitions[slot].with_lock( [evtnumber]( Partition& p ) {
370  assert( p.eventNumber == -1 ); // or whatever value represents 'free'
371  p.eventNumber = evtnumber;
372  } );
373  }
374  return slot;
375  }
376 
378  StatusCode freeStore( size_t partition ) override {
379  assert( partition < m_partitions.size() );
380  auto prev = m_partitions[partition].with_lock( []( Partition& p ) { return std::exchange( p.eventNumber, -1 ); } );
381  if ( UNLIKELY( prev == -1 ) ) return StatusCode::FAILURE; // double free -- should never happen!
382  m_freeSlots.push( partition );
383  return StatusCode::SUCCESS;
384  }
385 
387  size_t getPartitionNumber( int eventnumber ) const override {
388  auto i = std::find_if( begin( m_partitions ), end( m_partitions ),
389  with_lock( [eventnumber]( const Partition& p ) { return p.eventNumber == eventnumber; } ) );
390  return i != end( m_partitions ) ? std::distance( begin( m_partitions ), i ) : std::string::npos;
391  }
392 
394  StatusCode sc = service( m_loader, m_addrCreator, true );
395  if ( !sc.isSuccess() ) {
396  error() << "Failed to retrieve data loader "
397  << "\"" << m_loader << "\"" << endmsg;
398  return sc;
399  }
400  IConversionSvc* dataLoader = nullptr;
401  sc = service( m_loader, dataLoader, true );
402  if ( !sc.isSuccess() ) {
403  error() << MSG::ERROR << "Failed to retrieve data loader "
404  << "\"" << m_loader << "\"" << endmsg;
405  return sc;
406  }
407  sc = setDataLoader( dataLoader );
408  dataLoader->release();
409  if ( !sc.isSuccess() ) {
410  error() << MSG::ERROR << "Failed to set data loader "
411  << "\"" << m_loader << "\"" << endmsg;
412  return sc;
413  }
414  return sc;
415  }
416 
418  if ( m_addrCreator ) m_addrCreator->release();
419  if ( m_dataLoader ) m_dataLoader->release();
420  m_addrCreator = nullptr;
421  m_dataLoader = nullptr;
422  return StatusCode::SUCCESS;
423  }
424 
425  //
426  //---IService implemenation---------------------------------------------------------
427  //
428 
430  StatusCode initialize() override {
432  if ( !sc.isSuccess() ) {
433  error() << "Unable to initialize base class" << endmsg;
434  return sc;
435  }
436  if ( m_slots < (size_t)1 ) {
437  error() << "Invalid number of slots (" << m_slots << ")" << endmsg;
438  return StatusCode::FAILURE;
439  }
440 
441  if ( !setNumberOfStores( m_slots ).isSuccess() ) {
442  error() << "Cannot set number of slots" << endmsg;
443  return StatusCode::FAILURE;
444  }
445 
446  m_partitions = std::vector<Synced<Partition>>( m_slots );
447  for ( size_t i = 0; i < m_slots; i++ ) {
448  DataSvc* svc = new DataSvc( name() + "_" + std::to_string( i ), serviceLocator() );
449  // Percolate properties
450  svc->setProperty( m_rootCLID ).ignore();
451  svc->setProperty( m_rootName ).ignore();
452  svc->setProperty( m_forceLeaves ).ignore();
453  svc->setProperty( m_enableFaultHdlr ).ignore();
454  // make sure that CommonMessaging is initialized
455  svc->setProperty( m_outputLevel ).ignore();
456 
457  sc = svc->initialize();
458  if ( !sc.isSuccess() ) {
459  error() << "Failed to instantiate DataSvc as store partition" << endmsg;
460  return sc;
461  }
462  m_partitions[i].with_lock( [&]( Partition& p ) {
463  p.dataProvider = svc;
464  p.dataManager = svc;
465  } );
466  m_freeSlots.push( i );
467  }
468  selectStore( 0 ).ignore();
469  return attachServices();
470  }
471 
475  if ( !sc.isSuccess() ) {
476  error() << "Unable to reinitialize base class" << endmsg;
477  return sc;
478  }
479  detachServices();
480  sc = attachServices();
481  if ( !sc.isSuccess() ) {
482  error() << "Failed to attach necessary services." << endmsg;
483  return sc;
484  }
485  return StatusCode::SUCCESS;
486  }
487 
489  StatusCode finalize() override {
490  setDataLoader( 0 ).ignore();
491  clearStore().ignore();
492  return Service::finalize();
493  }
494 };
495 
496 // Instantiation of a static factory class used by clients to create
497 // 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.
#define __attribute__(x)
Definition: System.cpp:89
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 ...
virtual StatusCode unlinkObject(IRegistry *from, boost::string_ref objPath)=0
Remove a link to another object.
T distance(T...args)
StatusCode setDataLoader(IConversionSvc *pDataLoader, IDataProviderSvc *dpsvc __attribute__((unused))=nullptr) override
IDataManagerSvc: Pass a default data loader to the service.
StatusCode finalize() override
Definition: Service.cpp:164
StatusCode linkObject(boost::string_ref fullPath, DataObject *to) override
Add a link to another object.
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
StatusCode freeStore(size_t partition) override
Free a store partition.
StatusCode unlinkObject(IRegistry *from, boost::string_ref objPath) override
Remove a link to another object.
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.
bool isSuccess() const
Definition: StatusCode.h:267
StatusCode registerAddress(boost::string_ref path, IOpaqueAddress *pAddr) override
IDataManagerSvc: Register object address with the data store.
virtual StatusCode setRoot(std::string root_name, DataObject *pObject)=0
Initialize data store for new event by giving new event path.
T to_string(T...args)
IAddressCreator interface definition.
StatusCode unlinkObject(boost::string_ref path) override
Remove a link to another object.
virtual StatusCode setDataProvider(IDataProviderSvc *pService)=0
Set Data provider service.
StatusCode findObject(IRegistry *parent, boost::string_ref path, DataObject *&pObj) override
Find object identified by its full path in the data store.
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
virtual StatusCode preLoad()=0
Load all preload items of the list.
StatusCode unregisterAddress(boost::string_ref path) override
IDataManagerSvc: Unregister object address from the data store.
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.
Data provider interface definition.
StatusCode preLoad() override
load all preload items of the list
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
StatusCode unlinkObject(DataObject *from, boost::string_ref objPath) 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.
virtual StatusCode traverseSubTree(boost::string_ref sub_tree_path, IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects below the sub tree identified by its full path name...
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
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.
virtual StatusCode linkObject(IRegistry *from, boost::string_ref objPath, DataObject *toObj)=0
Add a link to another object.
#define DECLARE_COMPONENT(type)
StatusCode detachServices()
TupleObj.h GaudiAlg/TupleObj.h namespace with few technical implementations.
StatusCode unregisterAddress(IRegistry *pParent, boost::string_ref path) override
IDataManagerSvc: Unregister object address from the data store.
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.
StatusCode linkObject(IRegistry *from, boost::string_ref objPath, DataObject *to) override
Add a link to another object.
StatusCode unregisterObject(boost::string_ref path) override
Unregister object from the data store.
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
StatusCode traverseSubTree(boost::string_ref path, IDataStoreAgent *pAgent) override
Analyze by traversing all data objects below the sub tree.
virtual StatusCode retrieveObject(IRegistry *pDirectory, boost::string_ref path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
virtual StatusCode clearSubTree(boost::string_ref sub_path)=0
Remove all data objects below the sub tree identified by its full path name.
T clear(T...args)
StatusCode clearSubTree(boost::string_ref path) override
Remove all data objects below the sub tree identified.
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.
virtual StatusCode unregisterAddress(boost::string_ref fullPath)=0
Unregister object address from the data store.
T find_if(T...args)
T size(T...args)
StatusCode registerObject(boost::string_ref fullPath, DataObject *pObject)
Register object with the data store.
virtual StatusCode unregisterObject(boost::string_ref fullPath)=0
Unregister object from the data store.
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.
virtual unsigned long release()=0
Release Interface instance.
Generic data agent interface.
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
StatusCode initialize() override
Service initialization.
Definition: DataSvc.cpp:814
StatusCode unregisterObject(DataObject *pObj, boost::string_ref path) override
Unregister object from the data store.
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
virtual StatusCode registerAddress(boost::string_ref fullPath, IOpaqueAddress *pAddress)=0
Register object address with the data store.
StatusCode registerAddress(IRegistry *parent, boost::string_ref path, IOpaqueAddress *pAdd) override
IDataManagerSvc: Register object address with the data store.
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 registerObject(DataObject *parent, boost::string_ref obj, DataObject *pObj) override
Register object with the data store.
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)
StatusCode findObject(boost::string_ref path, DataObject *&pObj) override
Find object identified by its full path in the data store.
Opaque address interface definition.
StatusCode registerObject(boost::string_ref parent, boost::string_ref obj, DataObject *pObj) override
Register object with 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
tbb::concurrent_queue< size_t > m_freeSlots
fifo queue of free slots
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 retrieveObject(IRegistry *parent, boost::string_ref path, DataObject *&pObj) override
Retrieve object from data store.
StatusCode setNumberOfStores(size_t slots) override
Set the number of event slots (copies of DataSvc objects).
~HiveWhiteBoard() override
Standard Destructor.