The Gaudi Framework  v30r4 (9b837755)
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 "tbb/concurrent_queue.h"
18 #include "tbb/mutex.h"
19 #include "tbb/recursive_mutex.h"
20 #include <utility>
21 
22 // Interfaces
30 #include "GaudiKernel/IRegistry.h"
33 
34 namespace
35 {
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  {
48  return dataProvider.get();
49  }
50  template <>
51  IDataManagerSvc* Partition::get<IDataManagerSvc>()
52  {
53  return dataManager.get();
54  }
55 
56  // C++20: replace with http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0290r2.html
57  // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4033.html
58 
59  template <typename T, typename Mutex = tbb::recursive_mutex, typename ReadLock = typename Mutex::scoped_lock,
60  typename WriteLock = ReadLock>
61  class Synced
62  {
63  T m_obj;
64  mutable Mutex m_mtx;
65 
66  public:
67  template <typename F>
68  decltype( auto ) with_lock( F&& f )
69  {
70  WriteLock lock{m_mtx};
71  return f( m_obj );
72  }
73  template <typename F>
74  decltype( auto ) with_lock( F&& f ) const
75  {
76  ReadLock lock{m_mtx};
77  return f( m_obj );
78  }
79  };
80  // transform an f(T) into an f(Synced<T>)
81  template <typename Fun>
82  auto with_lock( Fun&& f )
83  {
84  return [f = std::forward<Fun>( f )]( auto& p )->decltype( auto ) { return p.with_lock( f ); };
85  }
86  // call f(T) for each element in a container of Synced<T>
87  template <typename ContainerOfSynced, typename Fun>
88  void for_( ContainerOfSynced& c, Fun&& f )
89  {
90  std::for_each( begin( c ), end( c ), with_lock( std::forward<Fun>( f ) ) );
91  }
92 }
93 
94 TTHREAD_TLS( Synced<Partition>* ) s_current = nullptr;
95 
96 namespace
97 {
98  namespace detail
99  {
100  template <typename lambda>
101  struct arg_helper : public arg_helper<decltype( &lambda::operator() )> {
102  };
103  template <typename T, typename Ret, typename Arg>
104  struct arg_helper<Ret ( T::* )( Arg ) const> {
105  using type = Arg;
106  };
107 
108  // given a unary lambda whose argument is of type Arg_t,
109  // argument_t<lambda> will be equal to Arg_t
110  template <typename lambda>
111  using argument_t = typename arg_helper<lambda>::type;
112  }
113 
114  template <typename Fun>
115  StatusCode fwd( Fun f )
116  {
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 }
124 
137 class HiveWhiteBoard : public extends<Service, IDataProviderSvc, IDataManagerSvc, IHiveWhiteBoard>
138 {
139 protected:
140  Gaudi::Property<CLID> m_rootCLID{this, "RootCLID", 110 /*CLID_Event*/, "CLID of root entry"};
141  Gaudi::Property<std::string> m_rootName{this, "RootName", "/Event", "name of root entry"};
142  Gaudi::Property<std::string> m_loader{this, "DataLoader", "EventPersistencySvc", ""};
143  Gaudi::Property<size_t> m_slots{this, "EventSlots", 1, "number of event slots"};
144  Gaudi::Property<bool> m_forceLeaves{this, "ForceLeaves", false, "force creation of default leaves on registerObject"};
145  Gaudi::Property<bool> m_enableFaultHdlr{this, "EnableFaultHandler", false,
146  "enable incidents on data creation requests"};
147 
149  IConversionSvc* m_dataLoader = nullptr;
151  IAddressCreator* m_addrCreator = nullptr;
155  tbb::concurrent_queue<size_t> m_freeSlots;
156 
157 public:
159  using extends::extends;
160 
162  ~HiveWhiteBoard() override
163  {
164  setDataLoader( 0 ).ignore();
165  resetPreLoad().ignore();
166  clearStore().ignore();
167  for_( m_partitions, []( Partition& p ) {
168  p.dataManager->release();
169  p.dataProvider->release();
170  } );
171  m_partitions.clear();
172  }
173 
175  size_t freeSlots() override { return m_freeSlots.unsafe_size(); }
176 
178  CLID rootCLID() const override { return (CLID)m_rootCLID; }
180  const std::string& rootName() const override { return m_rootName; }
181 
183  StatusCode registerAddress( boost::string_ref path, IOpaqueAddress* pAddr ) override
184  {
185  return fwd( [&]( IDataManagerSvc& p ) { return p.registerAddress( path, pAddr ); } );
186  }
188  StatusCode registerAddress( IRegistry* parent, boost::string_ref path, IOpaqueAddress* pAdd ) override
189  {
190  return fwd( [&]( IDataManagerSvc& p ) { return p.registerAddress( parent, path, pAdd ); } );
191  }
193  StatusCode unregisterAddress( boost::string_ref path ) override
194  {
195  return fwd( [&]( IDataManagerSvc& p ) { return p.unregisterAddress( path ); } );
196  }
198  StatusCode unregisterAddress( IRegistry* pParent, boost::string_ref path ) override
199  {
200  return fwd( [&]( IDataManagerSvc& p ) { return p.unregisterAddress( pParent, path ); } );
201  }
203  StatusCode objectLeaves( const DataObject* pObject, std::vector<IRegistry*>& leaves ) override
204  {
205  return fwd( [&]( IDataManagerSvc& p ) { return p.objectLeaves( pObject, leaves ); } );
206  }
208  StatusCode objectLeaves( const IRegistry* pObject, std::vector<IRegistry*>& leaves ) override
209  {
210  return fwd( [&]( IDataManagerSvc& p ) { return p.objectLeaves( pObject, leaves ); } );
211  }
213  StatusCode objectParent( const DataObject* pObject, IRegistry*& refpParent ) override
214  {
215  return fwd( [&]( IDataManagerSvc& p ) { return p.objectParent( pObject, refpParent ); } );
216  }
218  StatusCode objectParent( const IRegistry* pObject, IRegistry*& refpParent ) override
219  {
220  return fwd( [&]( IDataManagerSvc& p ) { return p.objectParent( pObject, refpParent ); } );
221  }
223  StatusCode clearSubTree( boost::string_ref path ) override
224  {
225  return fwd( [&]( IDataManagerSvc& p ) { return p.clearSubTree( path ); } );
226  }
228  StatusCode clearSubTree( DataObject* pObject ) override
229  {
230  return fwd( [&]( IDataManagerSvc& p ) { return p.clearSubTree( pObject ); } );
231  }
234  {
235  for_( m_partitions, []( Partition& p ) { p.dataManager->clearStore().ignore(); } );
236  return StatusCode::SUCCESS;
237  }
238 
240  StatusCode traverseSubTree( boost::string_ref path, IDataStoreAgent* pAgent ) override
241  {
242  return fwd( [&]( IDataManagerSvc& p ) { return p.traverseSubTree( path, pAgent ); } );
243  }
245  StatusCode traverseSubTree( DataObject* pObject, IDataStoreAgent* pAgent ) override
246  {
247  return fwd( [&]( IDataManagerSvc& p ) { return p.traverseSubTree( pObject, pAgent ); } );
248  }
251  {
252  return fwd( [&]( IDataManagerSvc& p ) { return p.traverseTree( pAgent ); } );
253  }
257  {
258  return fwd(
259  [ pObj, path = std::move( path ) ]( IDataManagerSvc & p ) { return p.setRoot( std::move( path ), pObj ); } );
260  }
261 
265  {
266  return fwd(
267  [ pAddr, path = std::move( path ) ]( IDataManagerSvc & p ) { return p.setRoot( std::move( path ), pAddr ); } );
268  }
269 
275  IDataProviderSvc* dpsvc __attribute__( ( unused ) ) = nullptr ) override
276  {
277  if ( pDataLoader ) pDataLoader->addRef();
278  if ( m_dataLoader ) m_dataLoader->release();
279  if ( pDataLoader ) pDataLoader->setDataProvider( this );
280  m_dataLoader = pDataLoader;
281  for_( m_partitions, [&]( Partition& p ) { p.dataManager->setDataLoader( m_dataLoader, this ).ignore(); } );
282  return StatusCode::SUCCESS;
283  }
285  StatusCode addPreLoadItem( const DataStoreItem& item ) override
286  {
287  for_( m_partitions, [&]( Partition& p ) { p.dataProvider->addPreLoadItem( item ); } );
288  return StatusCode::SUCCESS;
289  }
292  {
293  for_( m_partitions, [&]( Partition& p ) { p.dataProvider->removePreLoadItem( item ); } );
294  return StatusCode::SUCCESS;
295  }
298  {
299  for_( m_partitions, [&]( Partition& p ) { p.dataProvider->resetPreLoad(); } );
300  return StatusCode::SUCCESS;
301  }
303  StatusCode preLoad() override
304  {
305  return fwd( [&]( IDataProviderSvc& p ) { return p.preLoad(); } );
306  }
308  StatusCode registerObject( boost::string_ref parent, boost::string_ref obj, DataObject* pObj ) override
309  {
310  return fwd( [&]( IDataProviderSvc& p ) { return p.registerObject( parent, obj, pObj ); } );
311  }
313  StatusCode registerObject( DataObject* parent, boost::string_ref obj, DataObject* pObj ) override
314  {
315  return fwd( [&]( IDataProviderSvc& p ) { return p.registerObject( parent, obj, pObj ); } );
316  }
318  StatusCode unregisterObject( boost::string_ref path ) override
319  {
320  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( path ); } );
321  }
324  {
325  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( pObj ); } );
326  }
328  StatusCode unregisterObject( DataObject* pObj, boost::string_ref path ) override
329  {
330  return fwd( [&]( IDataProviderSvc& p ) { return p.unregisterObject( pObj, path ); } );
331  }
333  StatusCode retrieveObject( IRegistry* parent, boost::string_ref path, DataObject*& pObj ) override
334  {
335  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( parent, path, pObj ); } );
336  }
338  StatusCode findObject( boost::string_ref path, DataObject*& pObj ) override
339  {
340  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( path, pObj ); } );
341  }
343  StatusCode findObject( IRegistry* parent, boost::string_ref path, DataObject*& pObj ) override
344  {
345  return fwd( [&]( IDataProviderSvc& p ) { return p.retrieveObject( parent, path, pObj ); } );
346  }
348  StatusCode linkObject( IRegistry* from, boost::string_ref objPath, DataObject* to ) override
349  {
350  return fwd( [&]( IDataProviderSvc& p ) { return p.linkObject( from, objPath, to ); } );
351  }
353  StatusCode linkObject( boost::string_ref fullPath, DataObject* to ) override
354  {
355  return fwd( [&]( IDataProviderSvc& p ) { return p.linkObject( fullPath, to ); } );
356  }
358  StatusCode unlinkObject( IRegistry* from, boost::string_ref objPath ) override
359  {
360  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( from, objPath ); } );
361  }
363  StatusCode unlinkObject( DataObject* from, boost::string_ref objPath ) override
364  {
365  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( from, objPath ); } );
366  }
368  StatusCode unlinkObject( boost::string_ref path ) override
369  {
370  return fwd( [&]( IDataProviderSvc& p ) { return p.unlinkObject( path ); } );
371  }
373  StatusCode updateObject( IRegistry* pDirectory ) override
374  {
375  return fwd( [&]( IDataProviderSvc& p ) { return p.updateObject( pDirectory ); } );
376  }
379  {
380  return fwd( [&]( IDataProviderSvc& p ) { return p.updateObject( pObj ); } );
381  }
382 
383  //
384  //---IHiveWhiteBard implemenation--------------------------------------------------
385  //
386 
388  StatusCode clearStore( size_t partition ) override
389  {
390  return m_partitions[partition].with_lock( []( Partition& p ) { return p.dataManager->clearStore(); } );
391  }
392 
394  StatusCode selectStore( size_t partition ) override
395  {
396  s_current = &m_partitions[partition];
397  return StatusCode::SUCCESS;
398  }
399 
401  StatusCode setNumberOfStores( size_t slots ) override
402  {
403  if ( FSMState() == Gaudi::StateMachine::INITIALIZED || FSMState() == Gaudi::StateMachine::RUNNING ) {
404  warning() << "Too late to change the number of slots!" << endmsg;
405  return StatusCode::FAILURE;
406  }
407  m_slots = slots;
409  return StatusCode::SUCCESS;
410  }
411 
413  size_t getNumberOfStores() const override { return m_slots; }
414 
416  bool exists( const DataObjID& id ) override
417  {
418  DataObject* pObject{nullptr};
419  return findObject( id.fullKey(), pObject ).isSuccess();
420  }
421 
423  size_t allocateStore( int evtnumber ) override
424  {
425  // take next free slot in the list
426  size_t slot = std::string::npos;
427  if ( m_freeSlots.try_pop( slot ) ) {
428  assert( slot != std::string::npos );
429  assert( slot < m_partitions.size() );
430  m_partitions[slot].with_lock( [evtnumber]( Partition& p ) {
431  assert( p.eventNumber == -1 ); // or whatever value represents 'free'
432  p.eventNumber = evtnumber;
433  } );
434  }
435  return slot;
436  }
437 
439  StatusCode freeStore( size_t partition ) override
440  {
441  assert( partition < m_partitions.size() );
442  auto prev = m_partitions[partition].with_lock( []( Partition& p ) { return std::exchange( p.eventNumber, -1 ); } );
443  if ( UNLIKELY( prev == -1 ) ) return StatusCode::FAILURE; // double free -- should never happen!
444  m_freeSlots.push( partition );
445  return StatusCode::SUCCESS;
446  }
447 
449  size_t getPartitionNumber( int eventnumber ) const override
450  {
451  auto i = std::find_if( begin( m_partitions ), end( m_partitions ),
452  with_lock( [eventnumber]( const Partition& p ) { return p.eventNumber == eventnumber; } ) );
453  return i != end( m_partitions ) ? std::distance( begin( m_partitions ), i ) : std::string::npos;
454  }
455 
457  {
458  StatusCode sc = service( m_loader, m_addrCreator, true );
459  if ( !sc.isSuccess() ) {
460  error() << "Failed to retrieve data loader "
461  << "\"" << m_loader << "\"" << endmsg;
462  return sc;
463  }
464  IConversionSvc* dataLoader = nullptr;
465  sc = service( m_loader, dataLoader, true );
466  if ( !sc.isSuccess() ) {
467  error() << MSG::ERROR << "Failed to retrieve data loader "
468  << "\"" << m_loader << "\"" << endmsg;
469  return sc;
470  }
471  sc = setDataLoader( dataLoader );
472  dataLoader->release();
473  if ( !sc.isSuccess() ) {
474  error() << MSG::ERROR << "Failed to set data loader "
475  << "\"" << m_loader << "\"" << endmsg;
476  return sc;
477  }
478  return sc;
479  }
480 
482  {
483  if ( m_addrCreator ) m_addrCreator->release();
484  if ( m_dataLoader ) m_dataLoader->release();
485  m_addrCreator = nullptr;
486  m_dataLoader = nullptr;
487  return StatusCode::SUCCESS;
488  }
489 
490  //
491  //---IService implemenation---------------------------------------------------------
492  //
493 
496  {
498  if ( !sc.isSuccess() ) {
499  error() << "Unable to initialize base class" << endmsg;
500  return sc;
501  }
502  if ( m_slots < (size_t)1 ) {
503  error() << "Invalid number of slots (" << m_slots << ")" << endmsg;
504  return StatusCode::FAILURE;
505  }
506 
507  if ( !setNumberOfStores( m_slots ).isSuccess() ) {
508  error() << "Cannot set number of slots" << endmsg;
509  return StatusCode::FAILURE;
510  }
511 
512  m_partitions = std::vector<Synced<Partition>>( m_slots );
513  for ( size_t i = 0; i < m_slots; i++ ) {
514  DataSvc* svc = new DataSvc( name() + "_" + std::to_string( i ), serviceLocator() );
515  // Percolate properties
516  svc->setProperty( m_rootCLID ).ignore();
517  svc->setProperty( m_rootName ).ignore();
518  svc->setProperty( m_forceLeaves ).ignore();
519  svc->setProperty( m_enableFaultHdlr ).ignore();
520  // make sure that CommonMessaging is initialized
521  svc->setProperty( m_outputLevel ).ignore();
522 
523  sc = svc->initialize();
524  if ( !sc.isSuccess() ) {
525  error() << "Failed to instantiate DataSvc as store partition" << endmsg;
526  return sc;
527  }
528  m_partitions[i].with_lock( [&]( Partition& p ) {
529  p.dataProvider = svc;
530  p.dataManager = svc;
531  } );
532  m_freeSlots.push( i );
533  }
534  selectStore( 0 ).ignore();
535  return attachServices();
536  }
537 
540  {
542  if ( !sc.isSuccess() ) {
543  error() << "Unable to reinitialize base class" << endmsg;
544  return sc;
545  }
546  detachServices();
547  sc = attachServices();
548  if ( !sc.isSuccess() ) {
549  error() << "Failed to attach necessary services." << endmsg;
550  return sc;
551  }
552  return StatusCode::SUCCESS;
553  }
554 
556  StatusCode finalize() override
557  {
558  setDataLoader( 0 ).ignore();
559  clearStore().ignore();
560  return Service::finalize();
561  }
562 };
563 
564 // Instantiation of a static factory class used by clients to create
565 // 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
constexpr static const auto FAILURE
Definition: StatusCode.h:88
StatusCode initialize() override
Definition: Service.cpp:63
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:173
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:383
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:287
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.
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:51
typename arg_helper< lambda >::type argument_t
Definition: EventIDBase.h:35
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:249
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.
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
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:900
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:165
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:43
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.
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:209
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.