| The Gaudi Framework v32r1 (f65d50dc)

HiveWhiteBoard.cpp
Go to the documentation of this file.
1 //====================================================================
2 // WhiteBoard (Concurrent Event Data Store)
3 //--------------------------------------------------------------------
4 //
5 //====================================================================
6 // Include files
7 #include "GaudiKernel/ConcurrencyFlags.h"
8 #include "GaudiKernel/DataObjID.h"
9 #include "GaudiKernel/DataObject.h"
10 #include "GaudiKernel/DataSvc.h"
11 #include "GaudiKernel/MsgStream.h"
12 #include "GaudiKernel/Service.h"
13 #include "GaudiKernel/SmartIF.h"
14 #include "GaudiKernel/TypeNameString.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
24 #include "GaudiKernel/IAddressCreator.h"
25 #include "GaudiKernel/IConversionSvc.h"
26 #include "GaudiKernel/IDataManagerSvc.h"
27 #include "GaudiKernel/IDataProviderSvc.h"
28 #include "GaudiKernel/IDataStoreAgent.h"
29 #include "GaudiKernel/IHiveWhiteBoard.h"
30 #include "GaudiKernel/IOpaqueAddress.h"
31 #include "GaudiKernel/IRegistry.h"
32 #include "GaudiKernel/ISvcLocator.h"
33 #include "GaudiKernel/ISvcManager.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;
134 std::vector<Synced<Partition>> m_partitions;
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 }
217 StatusCode traverseTree( IDataStoreAgent* pAgent ) override {
218 return fwd( [&]( IDataManagerSvc& p ) { return p.traverseTree( pAgent ); } );
219 }
222 StatusCode setRoot( std::string path, DataObject* pObj ) override {
223 return fwd(
224 [pObj, path = std::move( path )]( IDataManagerSvc& p ) { return p.setRoot( std::move( path ), pObj ); } );
225 }
226
229 StatusCode setRoot( std::string path, IOpaqueAddress* pAddr ) override {
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 }
257 StatusCode resetPreLoad() override {
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 }
278 StatusCode unregisterObject( DataObject* pObj ) override {
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;
348 Gaudi::Concurrency::ConcurrencyFlags::setNumConcEvents( 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
392 StatusCode attachServices() {
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
416 StatusCode detachServices() {
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 {
430 StatusCode sc = Service::initialize();
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
472 StatusCode reinitialize() override {
473 StatusCode sc = Service::reinitialize();
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
497 DECLARE_COMPONENT( HiveWhiteBoard )
IDataManagerSvc::traverseTree
virtual StatusCode traverseTree(IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects in the data store.
HiveWhiteBoard::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: HiveWhiteBoard.cpp:318
Service::m_outputLevel
Gaudi::Property< int > m_outputLevel
Definition: Service.h:176
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:96
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:60
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
HiveWhiteBoard::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: HiveWhiteBoard.cpp:122
HiveWhiteBoard::unregisterObject
StatusCode unregisterObject(DataObject *pObj) override
Unregister object from the data store.
Definition: HiveWhiteBoard.cpp:278
HiveWhiteBoard::registerAddress
StatusCode registerAddress(std::string_view path, IOpaqueAddress *pAddr) override
IDataManagerSvc: Register object address with the data store.
Definition: HiveWhiteBoard.cpp:163
SmartIF< IDataProviderSvc >
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:277
HiveWhiteBoard::retrieveObject
StatusCode retrieveObject(IRegistry *parent, std::string_view path, DataObject *&pObj) override
Retrieve object from data store.
Definition: HiveWhiteBoard.cpp:286
HiveWhiteBoard::allocateStore
size_t allocateStore(int evtnumber) override
Allocate a store partition for a given event number.
Definition: HiveWhiteBoard.cpp:362
IDataManagerSvc::objectLeaves
virtual StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &refLeaves)=0
Explore the object store: retrieve all leaves attached to the object The object is identified by its ...
std::distance
T distance(T... args)
gaudirun.c
c
Definition: gaudirun.py:487
IDataManagerSvc::registerAddress
virtual StatusCode registerAddress(std::string_view fullPath, IOpaqueAddress *pAddress)=0
Register object address with the data store.
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:932
IDataProviderSvc::linkObject
virtual StatusCode linkObject(IRegistry *from, std::string_view objPath, DataObject *toObj)=0
Add a link to another object.
HiveWhiteBoard::m_enableFaultHdlr
Gaudi::Property< bool > m_enableFaultHdlr
Definition: HiveWhiteBoard.cpp:126
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:164
IConversionSvc
Definition: IConversionSvc.h:37
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:352
Service::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: Service.h:52
PropertyHolder::setProperty
StatusCode setProperty(const Gaudi::Details::PropertyBase &p) override
set the property form another property
Definition: PropertyHolder.h:145
DataObjID
Definition: DataObjID.h:37
MsgStream.h
IDataManagerSvc::traverseSubTree
virtual StatusCode traverseSubTree(std::string_view sub_tree_path, IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects below the sub tree identified by its full path name.
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:101
HiveWhiteBoard::freeStore
StatusCode freeStore(size_t partition) override
Free a store partition.
Definition: HiveWhiteBoard.cpp:377
HiveWhiteBoard::registerObject
StatusCode registerObject(std::string_view parent, std::string_view obj, DataObject *pObj) override
Register object with the data store.
Definition: HiveWhiteBoard.cpp:266
IDataManagerSvc
Definition: IDataManagerSvc.h:45
HiveWhiteBoard::traverseSubTree
StatusCode traverseSubTree(std::string_view path, IDataStoreAgent *pAgent) override
Analyze by traversing all data objects below the sub tree.
Definition: HiveWhiteBoard.cpp:209
HiveWhiteBoard::unregisterObject
StatusCode unregisterObject(std::string_view path) override
Unregister object from the data store.
Definition: HiveWhiteBoard.cpp:274
HiveWhiteBoard::clearStore
StatusCode clearStore(size_t partition) override
Remove all data objects in one 'slot' of the data store.
Definition: HiveWhiteBoard.cpp:331
HiveWhiteBoard::linkObject
StatusCode linkObject(std::string_view fullPath, DataObject *to) override
Add a link to another object.
Definition: HiveWhiteBoard.cpp:302
HiveWhiteBoard::linkObject
StatusCode linkObject(IRegistry *from, std::string_view objPath, DataObject *to) override
Add a link to another object.
Definition: HiveWhiteBoard.cpp:298
HiveWhiteBoard::unregisterObject
StatusCode unregisterObject(DataObject *pObj, std::string_view path) override
Unregister object from the data store.
Definition: HiveWhiteBoard.cpp:282
IDataManagerSvc::setRoot
virtual StatusCode setRoot(std::string root_name, DataObject *pObject)=0
Initialize data store for new event by giving new event path.
IDataManagerSvc::unregisterAddress
virtual StatusCode unregisterAddress(std::string_view fullPath)=0
Unregister object address from the data store.
std::to_string
T to_string(T... args)
IAddressCreator
IAddressCreator interface definition.
Definition: IAddressCreator.h:28
IConverter::setDataProvider
virtual StatusCode setDataProvider(IDataProviderSvc *pService)=0
Set Data provider service.
HiveWhiteBoard::m_loader
Gaudi::Property< std::string > m_loader
Definition: HiveWhiteBoard.cpp:123
HiveWhiteBoard::unregisterAddress
StatusCode unregisterAddress(IRegistry *pParent, std::string_view path) override
IDataManagerSvc: Unregister object address from the data store.
Definition: HiveWhiteBoard.cpp:175
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
IDataProviderSvc::preLoad
virtual StatusCode preLoad()=0
Load all preload items of the list.
HiveWhiteBoard::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: HiveWhiteBoard.cpp:257
HiveWhiteBoard::finalize
StatusCode finalize() override
Service initialisation.
Definition: HiveWhiteBoard.cpp:488
HiveWhiteBoard::clearSubTree
StatusCode clearSubTree(DataObject *pObject) override
Remove all data objects below the sub tree identified.
Definition: HiveWhiteBoard.cpp:199
HiveWhiteBoard::objectParent
StatusCode objectParent(const IRegistry *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object's parent.
Definition: HiveWhiteBoard.cpp:191
HiveWhiteBoard::addPreLoadItem
StatusCode addPreLoadItem(const DataStoreItem &item) override
Add an item to the preload list.
Definition: HiveWhiteBoard.cpp:247
HiveWhiteBoard::updateObject
StatusCode updateObject(DataObject *pObj) override
Update object.
Definition: HiveWhiteBoard.cpp:322
HiveWhiteBoard::m_partitions
std::vector< Synced< Partition > > m_partitions
Datastore partitions.
Definition: HiveWhiteBoard.cpp:134
HiveWhiteBoard::clearSubTree
StatusCode clearSubTree(std::string_view path) override
Remove all data objects below the sub tree identified.
Definition: HiveWhiteBoard.cpp:195
IDataProviderSvc
Data provider interface definition.
Definition: IDataProviderSvc.h:43
HiveWhiteBoard::preLoad
StatusCode preLoad() override
load all preload items of the list
Definition: HiveWhiteBoard.cpp:262
DataStoreItem
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
HiveWhiteBoard::unregisterAddress
StatusCode unregisterAddress(std::string_view path) override
IDataManagerSvc: Unregister object address from the data store.
Definition: HiveWhiteBoard.cpp:171
HiveWhiteBoard::unlinkObject
StatusCode unlinkObject(std::string_view path) override
Remove a link to another object.
Definition: HiveWhiteBoard.cpp:314
ISvcManager.h
HiveWhiteBoard::freeSlots
size_t freeSlots() override
Get free slots number.
Definition: HiveWhiteBoard.cpp:155
IDataManagerSvc::objectParent
virtual StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent)=0
IDataManagerSvc: Explore the object store: retrieve the object's parent.
HiveWhiteBoard::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: HiveWhiteBoard.cpp:203
IDataProviderSvc::unlinkObject
virtual StatusCode unlinkObject(IRegistry *from, std::string_view objPath)=0
Remove a link to another object.
HiveWhiteBoard::getPartitionNumber
size_t getPartitionNumber(int eventnumber) const override
Get the partition number corresponding to a given event.
Definition: HiveWhiteBoard.cpp:386
HiveWhiteBoard::selectStore
StatusCode selectStore(size_t partition) override
Activate a partition object. The identifies the partition uniquely.
Definition: HiveWhiteBoard.cpp:336
IDataProviderSvc::Status::INVALID_ROOT
Invalid root path object cannot be retrieved or stored.
std::string
STL class.
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginServiceV1.h:46
HiveWhiteBoard::registerAddress
StatusCode registerAddress(IRegistry *parent, std::string_view path, IOpaqueAddress *pAdd) override
IDataManagerSvc: Register object address with the data store.
Definition: HiveWhiteBoard.cpp:167
Service.h
IDataProviderSvc::unregisterObject
virtual StatusCode unregisterObject(std::string_view fullPath)=0
Unregister object from the data store.
DataSvc.h
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:274
IDataManagerSvc::clearSubTree
virtual StatusCode clearSubTree(std::string_view sub_path)=0
Remove all data objects below the sub tree identified by its full path name.
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
IDataManagerSvc.h
IDataProviderSvc.h
HiveWhiteBoard::detachServices
StatusCode detachServices()
Definition: HiveWhiteBoard.cpp:416
HiveWhiteBoard::m_rootCLID
Gaudi::Property< CLID > m_rootCLID
Definition: HiveWhiteBoard.cpp:121
detail
TupleObj.h GaudiAlg/TupleObj.h namespace with few technical implementations.
HiveWhiteBoard::objectLeaves
StatusCode objectLeaves(const IRegistry *pObject, std::vector< IRegistry * > &leaves) override
Explore the object store: retrieve all leaves attached to the object.
Definition: HiveWhiteBoard.cpp:183
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
details::argument_t
typename arg_helper< lambda >::type argument_t
Definition: EventIDBase.h:33
IDataProviderSvc::updateObject
virtual StatusCode updateObject(IRegistry *pDirectory)=0
Update object identified by its directory entry.
SmartIF.h
HiveWhiteBoard::rootCLID
CLID rootCLID() const override
IDataManagerSvc: Accessor for root event CLID.
Definition: HiveWhiteBoard.cpp:158
std::lock
T lock(T... args)
HiveWhiteBoard::removePreLoadItem
StatusCode removePreLoadItem(const DataStoreItem &item) override
Remove an item from the preload list.
Definition: HiveWhiteBoard.cpp:252
IRegistry.h
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
Service::reinitialize
StatusCode reinitialize() override
Definition: Service.cpp:237
IOTest.end
def end
Definition: IOTest.py:112
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
std::vector::clear
T clear(T... args)
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
HiveWhiteBoard::getNumberOfStores
size_t getNumberOfStores() const override
Get the number of event slots (copies of DataSvc objects).
Definition: HiveWhiteBoard.cpp:353
HiveWhiteBoard::m_slots
Gaudi::Property< size_t > m_slots
Definition: HiveWhiteBoard.cpp:124
EventStatus::Status
Status
Definition: IAlgExecStateSvc.h:63
IDataStoreAgent.h
std::move
T move(T... args)
HiveWhiteBoard::rootName
const std::string & rootName() const override
Name for root Event.
Definition: HiveWhiteBoard.cpp:160
HiveWhiteBoard
Data service base class.
Definition: HiveWhiteBoard.cpp:119
TTHREAD_TLS
TTHREAD_TLS(Synced< Partition > *) s_current
DataObjID.h
IOpaqueAddress.h
HiveWhiteBoard::attachServices
StatusCode attachServices()
Definition: HiveWhiteBoard.cpp:392
HiveWhiteBoard::traverseSubTree
StatusCode traverseSubTree(DataObject *pObject, IDataStoreAgent *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects below the sub tree.
Definition: HiveWhiteBoard.cpp:213
std::find_if
T find_if(T... args)
std::vector::size
T size(T... args)
StatusCode::ignore
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:153
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:16
HiveWhiteBoard::objectParent
StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object's parent.
Definition: HiveWhiteBoard.cpp:187
HiveWhiteBoard::setRoot
StatusCode setRoot(std::string path, IOpaqueAddress *pAddr) override
Initialize data store for new event by giving new event path and address of root object.
Definition: HiveWhiteBoard.cpp:229
Gaudi::Functional::details::get
auto get(const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))
Definition: FunctionalDetails.h:332
std::vector
STL class.
HiveWhiteBoard::unlinkObject
StatusCode unlinkObject(DataObject *from, std::string_view objPath) override
Remove a link to another object.
Definition: HiveWhiteBoard.cpp:310
IDataProviderSvc::retrieveObject
virtual StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
IInterface::release
virtual unsigned long release()=0
Release Interface instance.
HiveWhiteBoard::m_addrCreator
IAddressCreator * m_addrCreator
Reference to address creator.
Definition: HiveWhiteBoard.cpp:132
IDataStoreAgent
Generic data agent interface.
Definition: IDataStoreAgent.h:17
IDataProviderSvc::registerObject
StatusCode registerObject(std::string_view fullPath, DataObject *pObject)
Register object with the data store.
Definition: IDataProviderSvc.h:62
IAddressCreator.h
HiveWhiteBoard::m_forceLeaves
Gaudi::Property< bool > m_forceLeaves
Definition: HiveWhiteBoard.cpp:125
IConversionSvc.h
IHiveWhiteBoard.h
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
DataSvc::initialize
StatusCode initialize() override
Service initialization.
Definition: DataSvc.cpp:812
HiveWhiteBoard::setRoot
StatusCode setRoot(std::string path, DataObject *pObj) override
Initialize data store for new event by giving new event path and root object.
Definition: HiveWhiteBoard.cpp:222
DataSvc
Data service base class.
Definition: DataSvc.h:42
ConcurrencyFlags.h
HiveWhiteBoard::setDataLoader
StatusCode setDataLoader(IConversionSvc *pDataLoader, IDataProviderSvc *=nullptr) override
IDataManagerSvc: Pass a default data loader to the service.
Definition: HiveWhiteBoard.cpp:238
TypeNameString.h
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
MSG::ERROR
Definition: IMessageSvc.h:15
IInterface::addRef
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
HiveWhiteBoard::objectLeaves
StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &leaves) override
Explore the object store: retrieve all leaves attached to the object.
Definition: HiveWhiteBoard.cpp:179
Service::service
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Service.h:83
HiveWhiteBoard::initialize
StatusCode initialize() override
Service initialisation.
Definition: HiveWhiteBoard.cpp:429
HiveWhiteBoard::traverseTree
StatusCode traverseTree(IDataStoreAgent *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects in the data store.
Definition: HiveWhiteBoard.cpp:217
Gaudi::Utils::begin
AttribStringParser::Iterator begin(const AttribStringParser &parser)
Definition: AttribStringParser.h:120
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
HiveWhiteBoard::m_dataLoader
IConversionSvc * m_dataLoader
Pointer to data loader service.
Definition: HiveWhiteBoard.cpp:130
HiveWhiteBoard::findObject
StatusCode findObject(std::string_view path, DataObject *&pObj) override
Find object identified by its full path in the data store.
Definition: HiveWhiteBoard.cpp:290
std::for_each
T for_each(T... args)
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
HiveWhiteBoard::findObject
StatusCode findObject(IRegistry *parent, std::string_view path, DataObject *&pObj) override
Find object identified by its full path in the data store.
Definition: HiveWhiteBoard.cpp:294
ISvcLocator.h
HiveWhiteBoard::m_freeSlots
tbb::concurrent_queue< size_t > m_freeSlots
fifo queue of free slots
Definition: HiveWhiteBoard.cpp:136
HiveWhiteBoard::unlinkObject
StatusCode unlinkObject(IRegistry *from, std::string_view objPath) override
Remove a link to another object.
Definition: HiveWhiteBoard.cpp:306
HiveWhiteBoard::exists
bool exists(const DataObjID &id) override
check if a data object exists in the current store
Definition: HiveWhiteBoard.cpp:356
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
Gaudi::Concurrency::ConcurrencyFlags::setNumConcEvents
static GAUDI_API void setNumConcEvents(const std::size_t &nE)
Definition: ConcurrencyFlags.h:59
HiveWhiteBoard::reinitialize
StatusCode reinitialize() override
Service initialisation.
Definition: HiveWhiteBoard.cpp:472
HiveWhiteBoard::setNumberOfStores
StatusCode setNumberOfStores(size_t slots) override
Set the number of event slots (copies of DataSvc objects).
Definition: HiveWhiteBoard.cpp:342
DataObject.h
HiveWhiteBoard::~HiveWhiteBoard
~HiveWhiteBoard() override
Standard Destructor.
Definition: HiveWhiteBoard.cpp:143
HiveWhiteBoard::registerObject
StatusCode registerObject(DataObject *parent, std::string_view obj, DataObject *pObj) override
Register object with the data store.
Definition: HiveWhiteBoard.cpp:270