| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

HiveWhiteBoard.cpp
Go to the documentation of this file.
1 //====================================================================
2 // WhiteBoard (Concurrent Event Data Store)
3 //--------------------------------------------------------------------
4 //
5 //====================================================================
6 #define WHITEBOARD_CPP
7
8 // Include files
9 #include "GaudiKernel/DataObjID.h"
10 #include "GaudiKernel/DataObject.h"
11 #include "GaudiKernel/DataSvc.h"
12 #include "GaudiKernel/MsgStream.h"
13 #include "GaudiKernel/Service.h"
14 #include "GaudiKernel/SmartIF.h"
15 #include "GaudiKernel/SvcFactory.h"
16 #include "GaudiKernel/TypeNameString.h"
17 #include "Rtypes.h"
18 #include "ThreadLocalStorage.h"
19 #include "tbb/recursive_mutex.h"
20 #include "tbb/spin_mutex.h"
21
22 // Interfaces
23 #include "GaudiKernel/IAddressCreator.h"
24 #include "GaudiKernel/IConversionSvc.h"
25 #include "GaudiKernel/IDataManagerSvc.h"
26 #include "GaudiKernel/IDataProviderSvc.h"
27 #include "GaudiKernel/IDataStoreAgent.h"
28 #include "GaudiKernel/IHiveWhiteBoard.h"
29 #include "GaudiKernel/IOpaqueAddress.h"
30 #include "GaudiKernel/IRegistry.h"
31 #include "GaudiKernel/ISvcLocator.h"
32 #include "GaudiKernel/ISvcManager.h"
33
34 // Forward declarations
35
36 typedef tbb::recursive_mutex wbMutex;
37 // typedef tbb::spin_mutex wbMutex;
38
39 namespace
40 {
41 struct Partition {
42
43 SmartIF<IDataProviderSvc> dataProvider;
44 SmartIF<IDataManagerSvc> dataManager;
45 wbMutex storeMutex;
46 DataObjIDColl newDataObjects;
47 int eventNumber;
48 Partition() : dataProvider( 0 ), dataManager( 0 ), eventNumber( -1 ) {}
49 Partition( IDataProviderSvc* dp, IDataManagerSvc* dm ) : dataProvider( dp ), dataManager( dm ), eventNumber( -1 ) {}
50 Partition( const Partition& entry )
51 : dataProvider( entry.dataProvider ), dataManager( entry.dataManager ), eventNumber( entry.eventNumber )
52 {
53 }
54 Partition& operator=( const Partition& entry )
55 {
56 dataProvider = entry.dataProvider;
57 dataManager = entry.dataManager;
58 return *this;
59 }
60 };
61 class DataAgent : virtual public IDataStoreAgent
62 {
63 private:
64 DataObjIDColl& m_dataObjects;
65
66 public:
67 DataAgent( DataObjIDColl& objs ) : m_dataObjects( objs ) {}
68 ~DataAgent() override {}
69 bool analyse( IRegistry* pReg, int ) override
70 {
71 if ( 0 != pReg->object() ) {
72 m_dataObjects.insert( DataObjID( pReg->identifier() ) );
73 return true;
74 } else {
75 return false;
76 }
77 }
78 };
79 }
80
81 TTHREAD_TLS( Partition* ) s_current( 0 );
82
95 class HiveWhiteBoard : public extends<Service, IDataProviderSvc, IDataManagerSvc, IHiveWhiteBoard>
96 {
97 protected:
98 typedef std::vector<Partition> Partitions;
99
100 Gaudi::Property<CLID> m_rootCLID{this, "RootCLID", 110 /*CLID_Event*/, "CLID of root entry"};
101 Gaudi::Property<std::string> m_rootName{this, "RootName", "/Event", "name of root entry"};
102 Gaudi::Property<std::string> m_loader{this, "DataLoader", "EventPersistencySvc", ""};
103 Gaudi::Property<int> m_slots{this, "EventSlots", 1, "number of event slots"};
104 Gaudi::Property<bool> m_forceLeaves{this, "ForceLeaves", false, "force creation of default leaves on registerObject"};
105 Gaudi::Property<bool> m_enableFaultHdlr{this, "EnableFaultHandler", false,
106 "enable incidents on data creation requests"};
107
109 IConversionSvc* m_dataLoader = nullptr;
111 IAddressCreator* m_addrCreator = nullptr;
113 Partitions m_partitions;
114
115 public:
117 CLID rootCLID() const override { return (CLID)m_rootCLID; }
119 const std::string& rootName() const override { return m_rootName; }
120
121 // macro to help writing the function calls
122 #define _CALL( P, F, ARGS ) \
123 if ( s_current ) { \
124 wbMutex::scoped_lock lock; \
125 lock.acquire( s_current->storeMutex ); \
126 return s_current->P ? s_current->P->F ARGS : IDataProviderSvc::INVALID_ROOT; \
127 } \
128 return IDataProviderSvc::INVALID_ROOT;
129
131 StatusCode registerAddress( const std::string& path, IOpaqueAddress* pAddr ) override
132 {
133 _CALL( dataManager, registerAddress, ( path, pAddr ) );
134 }
136 StatusCode registerAddress( DataObject* parent, const std::string& path, IOpaqueAddress* pAddr ) override
137 {
138 _CALL( dataManager, registerAddress, ( parent, path, pAddr ) );
139 }
141 StatusCode registerAddress( IRegistry* parent, const std::string& path, IOpaqueAddress* pAdd ) override
142 {
143 _CALL( dataManager, registerAddress, ( parent, path, pAdd ) );
144 }
146 StatusCode unregisterAddress( const std::string& path ) override
147 {
148 _CALL( dataManager, unregisterAddress, ( path ) );
149 }
151 StatusCode unregisterAddress( DataObject* pParent, const std::string& path ) override
152 {
153 _CALL( dataManager, unregisterAddress, ( pParent, path ) );
154 }
156 StatusCode unregisterAddress( IRegistry* pParent, const std::string& path ) override
157 {
158 _CALL( dataManager, unregisterAddress, ( pParent, path ) );
159 }
161 StatusCode objectLeaves( const DataObject* pObject, std::vector<IRegistry*>& leaves ) override
162 {
163 _CALL( dataManager, objectLeaves, ( pObject, leaves ) );
164 }
166 StatusCode objectLeaves( const IRegistry* pObject, std::vector<IRegistry*>& leaves ) override
167 {
168 _CALL( dataManager, objectLeaves, ( pObject, leaves ) );
169 }
171 StatusCode objectParent( const DataObject* pObject, IRegistry*& refpParent ) override
172 {
173 _CALL( dataManager, objectParent, ( pObject, refpParent ) );
174 }
176 StatusCode objectParent( const IRegistry* pObject, IRegistry*& refpParent ) override
177 {
178 _CALL( dataManager, objectParent, ( pObject, refpParent ) );
179 }
181 StatusCode clearSubTree( const std::string& path ) override { _CALL( dataManager, clearSubTree, ( path ) ); }
183 StatusCode clearSubTree( DataObject* pObject ) override { _CALL( dataManager, clearSubTree, ( pObject ) ); }
185 StatusCode clearStore() override
186 {
187 for ( auto& p : m_partitions ) p.dataManager->clearStore().ignore();
188 return StatusCode::SUCCESS;
189 }
190
192 StatusCode traverseSubTree( const std::string& path, IDataStoreAgent* pAgent ) override
193 {
194 _CALL( dataManager, traverseSubTree, ( path, pAgent ) );
195 }
197 StatusCode traverseSubTree( DataObject* pObject, IDataStoreAgent* pAgent ) override
198 {
199 _CALL( dataManager, traverseSubTree, ( pObject, pAgent ) );
200 }
202 StatusCode traverseTree( IDataStoreAgent* pAgent ) override { _CALL( dataManager, traverseTree, ( pAgent ) ); }
205 StatusCode setRoot( std::string path, DataObject* pObj ) override { _CALL( dataManager, setRoot, ( path, pObj ) ); }
206
209 StatusCode setRoot( std::string path, IOpaqueAddress* pAddr ) override
210 {
211 _CALL( dataManager, setRoot, ( path, pAddr ) );
212 }
213
218 StatusCode setDataLoader( IConversionSvc* pDataLoader,
219 IDataProviderSvc* dpsvc __attribute__( ( unused ) ) = nullptr ) override
220 {
221 if ( 0 != pDataLoader ) pDataLoader->addRef();
222 if ( 0 != m_dataLoader ) m_dataLoader->release();
223 if ( 0 != pDataLoader ) {
224 pDataLoader->setDataProvider( this );
225 }
226 m_dataLoader = pDataLoader;
227 for ( auto& p : m_partitions ) {
228 p.dataManager->setDataLoader( m_dataLoader, this ).ignore();
229 }
230 return SUCCESS;
231 }
233 StatusCode addPreLoadItem( const DataStoreItem& item ) override
234 {
235 for ( auto& p : m_partitions ) p.dataProvider->addPreLoadItem( item );
236 return StatusCode::SUCCESS;
237 }
239 StatusCode addPreLoadItem( const std::string& item ) override
240 {
241 for ( auto& p : m_partitions ) p.dataProvider->addPreLoadItem( item );
242 return StatusCode::SUCCESS;
243 }
245 StatusCode removePreLoadItem( const DataStoreItem& item ) override
246 {
247 for ( auto& p : m_partitions ) p.dataProvider->removePreLoadItem( item );
248 return StatusCode::SUCCESS;
249 }
251 StatusCode removePreLoadItem( const std::string& item ) override
252 {
253 for ( auto& p : m_partitions ) p.dataProvider->removePreLoadItem( item );
254 return StatusCode::SUCCESS;
255 }
257 StatusCode resetPreLoad() override
258 {
259 for ( auto& p : m_partitions ) p.dataProvider->resetPreLoad();
260 return StatusCode::SUCCESS;
261 }
263 StatusCode preLoad() override
264 {
265 wbMutex::scoped_lock lock;
266 lock.acquire( s_current->storeMutex );
267 StatusCode sc = s_current->dataProvider->preLoad();
268 DataAgent da( s_current->newDataObjects );
269 s_current->dataManager->traverseTree( &da );
270 return sc;
271 }
273 StatusCode registerObject( const std::string& path, DataObject* pObj ) override
274 {
275 wbMutex::scoped_lock lock;
276 lock.acquire( s_current->storeMutex );
277 StatusCode sc = s_current->dataProvider->registerObject( path, pObj );
278 if ( sc.isSuccess() ) {
279 s_current->newDataObjects.insert( DataObjID( path ) );
280 }
281 return sc;
282 }
284 StatusCode registerObject( const std::string& parent, const std::string& obj, DataObject* pObj ) override
285 {
286 _CALL( dataProvider, registerObject, ( parent, obj, pObj ) );
287 }
289 StatusCode registerObject( const std::string& parent, int item, DataObject* pObj ) override
290 {
291 _CALL( dataProvider, registerObject, ( parent, item, pObj ) );
292 }
294 StatusCode registerObject( DataObject* parent, const std::string& obj, DataObject* pObj ) override
295 {
296 _CALL( dataProvider, registerObject, ( parent, obj, pObj ) );
297 }
299 StatusCode registerObject( DataObject* parent, int obj, DataObject* pObj ) override
300 {
301 _CALL( dataProvider, registerObject, ( parent, obj, pObj ) );
302 }
304 StatusCode unregisterObject( const std::string& path ) override { _CALL( dataProvider, unregisterObject, ( path ) ); }
306 StatusCode unregisterObject( const std::string& parent, const std::string& obj ) override
307 {
308 _CALL( dataProvider, unregisterObject, ( parent, obj ) );
309 }
311 StatusCode unregisterObject( const std::string& parent, int obj ) override
312 {
313 _CALL( dataProvider, unregisterObject, ( parent, obj ) );
314 }
316 StatusCode unregisterObject( DataObject* pObj ) override { _CALL( dataProvider, unregisterObject, ( pObj ) ); }
318 StatusCode unregisterObject( DataObject* pObj, const std::string& path ) override
319 {
320 _CALL( dataProvider, unregisterObject, ( pObj, path ) );
321 }
323 StatusCode unregisterObject( DataObject* pObj, int item ) override
324 {
325 _CALL( dataProvider, unregisterObject, ( pObj, item ) );
326 }
328 StatusCode retrieveObject( IRegistry* parent, const std::string& path, DataObject*& pObj ) override
329 {
330 _CALL( dataProvider, retrieveObject, ( parent, path, pObj ) );
331 }
333 StatusCode retrieveObject( const std::string& path, DataObject*& pObj ) override
334 {
335 _CALL( dataProvider, retrieveObject, ( path, pObj ) );
336 }
338 StatusCode retrieveObject( const std::string& parent, const std::string& path, DataObject*& pObj ) override
339 {
340 _CALL( dataProvider, retrieveObject, ( parent, path, pObj ) );
341 }
343 StatusCode retrieveObject( const std::string& parent, int item, DataObject*& pObj ) override
344 {
345 _CALL( dataProvider, retrieveObject, ( parent, item, pObj ) );
346 }
348 StatusCode retrieveObject( DataObject* parent, const std::string& path, DataObject*& pObj ) override
349 {
350 _CALL( dataProvider, retrieveObject, ( parent, path, pObj ) );
351 }
353 StatusCode retrieveObject( DataObject* parent, int item, DataObject*& pObj ) override
354 {
355 _CALL( dataProvider, retrieveObject, ( parent, item, pObj ) );
356 }
358 StatusCode findObject( const std::string& path, DataObject*& pObj ) override
359 {
360 _CALL( dataProvider, retrieveObject, ( path, pObj ) );
361 }
363 StatusCode findObject( IRegistry* parent, const std::string& path, DataObject*& pObj ) override
364 {
365 _CALL( dataProvider, retrieveObject, ( parent, path, pObj ) );
366 }
368 StatusCode findObject( const std::string& parent, const std::string& path, DataObject*& pObj ) override
369 {
370 _CALL( dataProvider, retrieveObject, ( parent, path, pObj ) );
371 }
373 StatusCode findObject( const std::string& parent, int item, DataObject*& pObject ) override
374 {
375 _CALL( dataProvider, findObject, ( parent, item, pObject ) );
376 }
378 StatusCode findObject( DataObject* parent, const std::string& path, DataObject*& pObject ) override
379 {
380 _CALL( dataProvider, findObject, ( parent, path, pObject ) );
381 }
383 StatusCode findObject( DataObject* parent, int item, DataObject*& pObject ) override
384 {
385 _CALL( dataProvider, findObject, ( parent, item, pObject ) );
386 }
388 StatusCode linkObject( IRegistry* from, const std::string& objPath, DataObject* to ) override
389 {
390 _CALL( dataProvider, linkObject, ( from, objPath, to ) );
391 }
393 StatusCode linkObject( const std::string& from, const std::string& objPath, DataObject* to ) override
394 {
395 _CALL( dataProvider, linkObject, ( from, objPath, to ) );
396 }
398 StatusCode linkObject( DataObject* from, const std::string& objPath, DataObject* to ) override
399 {
400 _CALL( dataProvider, linkObject, ( from, objPath, to ) );
401 }
403 StatusCode linkObject( const std::string& fullPath, DataObject* to ) override
404 {
405 _CALL( dataProvider, linkObject, ( fullPath, to ) );
406 }
408 StatusCode unlinkObject( IRegistry* from, const std::string& objPath ) override
409 {
410 _CALL( dataProvider, unlinkObject, ( from, objPath ) );
411 }
413 StatusCode unlinkObject( const std::string& from, const std::string& objPath ) override
414 {
415 _CALL( dataProvider, unlinkObject, ( from, objPath ) );
416 }
418 StatusCode unlinkObject( DataObject* from, const std::string& objPath ) override
419 {
420 _CALL( dataProvider, unlinkObject, ( from, objPath ) );
421 }
423 StatusCode unlinkObject( const std::string& path ) override { _CALL( dataProvider, unlinkObject, ( path ) ); }
425 StatusCode updateObject( IRegistry* pDirectory ) override { _CALL( dataProvider, updateObject, ( pDirectory ) ); }
427 StatusCode updateObject( const std::string& path ) override { _CALL( dataProvider, updateObject, ( path ) ); }
429 StatusCode updateObject( DataObject* pObj ) override { _CALL( dataProvider, updateObject, ( pObj ) ); }
431 StatusCode updateObject( const std::string& parent, const std::string& updatePath ) override
432 {
433 _CALL( dataProvider, updateObject, ( parent, updatePath ) );
434 }
436 StatusCode updateObject( DataObject* parent, const std::string& updatePath ) override
437 {
438 _CALL( dataProvider, updateObject, ( parent, updatePath ) );
439 }
440
441 //
442 //---IHiveWhiteBard implemenation--------------------------------------------------
443 //
444
446 StatusCode clearStore( size_t partition ) override { return m_partitions[partition].dataManager->clearStore(); }
447
449 StatusCode selectStore( size_t partition ) override
450 {
451 s_current = &m_partitions[partition];
452 return StatusCode::SUCCESS;
453 }
454
456 StatusCode setNumberOfStores( size_t slots ) override
457 {
458 if ( (int)slots != m_slots and FSMState() == Gaudi::StateMachine::INITIALIZED ) {
459 warning() << "Too late to change the number of slots!" << endmsg;
460 return StatusCode::FAILURE;
461 }
462 m_slots = slots;
463 return StatusCode::SUCCESS;
464 }
465
467 size_t getNumberOfStores() const override { return m_slots; }
468
470 StatusCode getNewDataObjects( DataObjIDColl& products ) override
471 {
472 wbMutex::scoped_lock lock;
473 lock.acquire( s_current->storeMutex );
474 products = s_current->newDataObjects;
475 s_current->newDataObjects.clear();
476 return StatusCode::SUCCESS;
477 }
478
480 bool newDataObjectsPresent() override
481 {
482 wbMutex::scoped_lock lock;
483 lock.acquire( s_current->storeMutex );
484 return s_current->newDataObjects.size() != 0;
485 }
486
488 size_t allocateStore( int evtnumber ) override
489 {
490 // size_t free = std::string::npos;
491 size_t index = 0;
492 for ( auto& p : m_partitions ) {
493 if ( p.eventNumber == evtnumber ) {
494 error() << "Attempt to allocate a store partition for an event that is still active" << endmsg;
495 return std::string::npos;
496 } else if ( p.eventNumber == -1 ) {
497 p.eventNumber = evtnumber;
498 // info() << "Got allocated slot..." << index << endmsg;
499 return index;
500 }
501 index++;
502 }
503 return std::string::npos;
504 }
505
507 StatusCode freeStore( size_t partition ) override
508 {
509 m_partitions[partition].eventNumber = -1;
510 // info() << "Freed slot..." << partition << endmsg;
511 return StatusCode::SUCCESS;
512 }
513
515 size_t getPartitionNumber( int eventnumber ) const override
516 {
517 size_t index{};
518 for ( auto& p : m_partitions ) {
519 if ( p.eventNumber == eventnumber ) return index;
520 ++index;
521 }
522 return std::string::npos;
523 }
524
525 StatusCode attachServices()
526 {
527 StatusCode sc = service( m_loader, m_addrCreator, true );
528 if ( !sc.isSuccess() ) {
529 error() << "Failed to retrieve data loader "
530 << "\"" << m_loader << "\"" << endmsg;
531 return sc;
532 }
533 IConversionSvc* dataLoader = 0;
534 sc = service( m_loader, dataLoader, true );
535 if ( !sc.isSuccess() ) {
536 error() << MSG::ERROR << "Failed to retrieve data loader "
537 << "\"" << m_loader << "\"" << endmsg;
538 return sc;
539 }
540 sc = setDataLoader( dataLoader );
541 dataLoader->release();
542 if ( !sc.isSuccess() ) {
543 error() << MSG::ERROR << "Failed to set data loader "
544 << "\"" << m_loader << "\"" << endmsg;
545 return sc;
546 }
547 return sc;
548 }
549
550 StatusCode detachServices()
551 {
552 if ( m_addrCreator ) m_addrCreator->release();
553 if ( m_dataLoader ) m_dataLoader->release();
554 m_addrCreator = 0;
555 m_dataLoader = 0;
556 return StatusCode::SUCCESS;
557 }
558
559 //
560 //---IService implemenation---------------------------------------------------------
561 //
562
564 StatusCode initialize() override
565 {
566 StatusCode sc = Service::initialize();
567 if ( !sc.isSuccess() ) {
568 error() << "Unable to initialize base class" << endmsg;
569 return sc;
570 }
571
572 if ( 1 > m_slots ) {
573 error() << "Invalid number of slots (" << m_slots << ")" << endmsg;
574 return StatusCode::FAILURE;
575 }
576
577 for ( int i = 0; i < m_slots; i++ ) {
578 std::ostringstream oss;
579 oss << name() << "_" << i;
580 DataSvc* svc = new DataSvc( oss.str(), serviceLocator() );
581 // Percolate properties
582 svc->setProperty( m_rootCLID ).ignore();
583 svc->setProperty( m_rootName ).ignore();
584 svc->setProperty( m_forceLeaves ).ignore();
585 svc->setProperty( m_enableFaultHdlr ).ignore();
586 // make sure that CommonMessaging is initialized
587 svc->setProperty( m_outputLevel ).ignore();
588
589 sc = svc->initialize();
590 if ( !sc.isSuccess() ) {
591 error() << "Failed to instantiate DataSvc as store partition" << endmsg;
592 return sc;
593 }
594 m_partitions.push_back( Partition( svc, svc ) );
595 }
596 selectStore( 0 ).ignore();
597 return attachServices();
598 }
599
601 StatusCode reinitialize() override
602 {
603 StatusCode sc = Service::reinitialize();
604 if ( !sc.isSuccess() ) {
605 error() << "Unable to reinitialize base class" << endmsg;
606 return sc;
607 }
608 detachServices();
609 sc = attachServices();
610 if ( !sc.isSuccess() ) {
611 error() << "Failed to attach necessary services." << endmsg;
612 return sc;
613 }
614 return StatusCode::SUCCESS;
615 }
616
618 StatusCode finalize() override
619 {
620 setDataLoader( 0 ).ignore();
621 clearStore().ignore();
622 return Service::finalize();
623 }
624
626 using extends::extends;
627
629 virtual ~HiveWhiteBoard()
630 {
631 setDataLoader( 0 ).ignore();
632 resetPreLoad().ignore();
633 clearStore().ignore();
634
635 for ( Partitions::iterator i = m_partitions.begin(); i != m_partitions.end(); ++i ) {
636 ( *i ).dataManager->release();
637 ( *i ).dataProvider->release();
638 }
639 m_partitions.clear();
640 }
641 };
642
643 // Instantiation of a static factory class used by clients to create
644 // instances of this service
645 DECLARE_SERVICE_FACTORY( HiveWhiteBoard )
HiveWhiteBoard::unlinkObject
StatusCode unlinkObject(const std::string &path) override
Remove a link to another object.
Definition: HiveWhiteBoard.cpp:423
HiveWhiteBoard::unlinkObject
StatusCode unlinkObject(IRegistry *from, const std::string &objPath) override
Remove a link to another object.
Definition: HiveWhiteBoard.cpp:408
HiveWhiteBoard::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: HiveWhiteBoard.cpp:425
HiveWhiteBoard::retrieveObject
StatusCode retrieveObject(const std::string &parent, const std::string &path, DataObject *&pObj) override
Retrieve object from data store.
Definition: HiveWhiteBoard.cpp:338
HiveWhiteBoard::registerAddress
StatusCode registerAddress(IRegistry *parent, const std::string &path, IOpaqueAddress *pAdd) override
IDataManagerSvc: Register object address with the data store.
Definition: HiveWhiteBoard.cpp:141
HiveWhiteBoard::linkObject
StatusCode linkObject(DataObject *from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: HiveWhiteBoard.cpp:398
HiveWhiteBoard::retrieveObject
StatusCode retrieveObject(const std::string &parent, int item, DataObject *&pObj) override
Retrieve object from data store.
Definition: HiveWhiteBoard.cpp:343
HiveWhiteBoard::registerObject
StatusCode registerObject(const std::string &path, DataObject *pObj) override
Register object with the data store. (The most common one is the only monitored one for the time bein...
Definition: HiveWhiteBoard.cpp:273
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:64
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:17
StatusCode::SUCCESS
Definition: StatusCode.h:31
HiveWhiteBoard::registerObject
StatusCode registerObject(const std::string &parent, int item, DataObject *pObj) override
Register object with the data store.
Definition: HiveWhiteBoard.cpp:289
HiveWhiteBoard::unregisterObject
StatusCode unregisterObject(DataObject *pObj) override
Unregister object from the data store.
Definition: HiveWhiteBoard.cpp:316
SmartIF< IDataProviderSvc >
__attribute__
#define __attribute__(x)
Definition: System.cpp:79
HiveWhiteBoard::allocateStore
size_t allocateStore(int evtnumber) override
Allocate a store partition for a given event number.
Definition: HiveWhiteBoard.cpp:488
HiveWhiteBoard::traverseSubTree
StatusCode traverseSubTree(const std::string &path, IDataStoreAgent *pAgent) override
Analyze by traversing all data objects below the sub tree.
Definition: HiveWhiteBoard.cpp:192
HiveWhiteBoard::unregisterAddress
StatusCode unregisterAddress(const std::string &path) override
IDataManagerSvc: Unregister object address from the data store.
Definition: HiveWhiteBoard.cpp:146
HiveWhiteBoard::setDataLoader
StatusCode setDataLoader(IConversionSvc *pDataLoader, IDataProviderSvc *dpsvc __attribute__((unused))=nullptr) override
IDataManagerSvc: Pass a default data loader to the service.
Definition: HiveWhiteBoard.cpp:218
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
StatusCode::FAILURE
Definition: StatusCode.h:31
HiveWhiteBoard::registerAddress
StatusCode registerAddress(const std::string &path, IOpaqueAddress *pAddr) override
IDataManagerSvc: Register object address with the data store.
Definition: HiveWhiteBoard.cpp:131
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:174
IConversionSvc
Definition: IConversionSvc.h:37
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:319
PropertyHolder::setProperty
StatusCode setProperty(const Gaudi::Details::PropertyBase &p) override
set the property form another property
Definition: PropertyHolder.h:208
DataObjID
Definition: DataObjID.h:37
MsgStream.h
HiveWhiteBoard::retrieveObject
StatusCode retrieveObject(DataObject *parent, const std::string &path, DataObject *&pObj) override
Retrieve object from data store.
Definition: HiveWhiteBoard.cpp:348
HiveWhiteBoard::freeStore
StatusCode freeStore(size_t partition) override
Free a store partition.
Definition: HiveWhiteBoard.cpp:507
HiveWhiteBoard::getPartitionNumber
size_t getPartitionNumber(int eventnumber) const override
Get the partition number corresponding to a given event.
Definition: HiveWhiteBoard.cpp:515
HiveWhiteBoard::clearStore
StatusCode clearStore(size_t partition) override
Remove all data objects in one &#39;slot&#39; of the data store.
Definition: HiveWhiteBoard.cpp:446
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
HiveWhiteBoard::retrieveObject
StatusCode retrieveObject(const std::string &path, DataObject *&pObj) override
Retrieve object identified by its full path from the data store.
Definition: HiveWhiteBoard.cpp:333
HiveWhiteBoard::registerObject
StatusCode registerObject(const std::string &parent, const std::string &obj, DataObject *pObj) override
Register object with the data store.
Definition: HiveWhiteBoard.cpp:284
GaudiPython.Bindings.SUCCESS
SUCCESS
Definition: Bindings.py:56
HiveWhiteBoard::findObject
StatusCode findObject(DataObject *parent, int item, DataObject *&pObject) override
Find object in the data store.
Definition: HiveWhiteBoard.cpp:383
HiveWhiteBoard::unregisterObject
StatusCode unregisterObject(const std::string &parent, const std::string &obj) override
Unregister object from the data store.
Definition: HiveWhiteBoard.cpp:306
IAddressCreator
IAddressCreator interface definition.
Definition: IAddressCreator.h:28
IConverter::setDataProvider
virtual StatusCode setDataProvider(IDataProviderSvc *pService)=0
Set Data provider service.
HiveWhiteBoard::unregisterObject
StatusCode unregisterObject(DataObject *pObj, const std::string &path) override
Unregister object from the data store.
Definition: HiveWhiteBoard.cpp:318
HiveWhiteBoard::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: HiveWhiteBoard.cpp:257
HiveWhiteBoard::addPreLoadItem
StatusCode addPreLoadItem(const std::string &item) override
Add an item to the preload list.
Definition: HiveWhiteBoard.cpp:239
HiveWhiteBoard::finalize
StatusCode finalize() override
Service initialisation.
Definition: HiveWhiteBoard.cpp:618
HiveWhiteBoard::clearSubTree
StatusCode clearSubTree(DataObject *pObject) override
Remove all data objects below the sub tree identified.
Definition: HiveWhiteBoard.cpp:183
_CALL
#define _CALL(P, F, ARGS)
Definition: HiveWhiteBoard.cpp:122
HiveWhiteBoard::clearSubTree
StatusCode clearSubTree(const std::string &path) override
Remove all data objects below the sub tree identified.
Definition: HiveWhiteBoard.cpp:181
HiveWhiteBoard::getNumberOfStores
size_t getNumberOfStores() const override
Get the number of event slots (copies of DataSvc objects).
Definition: HiveWhiteBoard.cpp:467
HiveWhiteBoard::objectParent
StatusCode objectParent(const IRegistry *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object&#39;s parent.
Definition: HiveWhiteBoard.cpp:176
std::vector::end
T end(T...args)
HiveWhiteBoard::addPreLoadItem
StatusCode addPreLoadItem(const DataStoreItem &item) override
Add an item to the preload list.
Definition: HiveWhiteBoard.cpp:233
HiveWhiteBoard::updateObject
StatusCode updateObject(DataObject *pObj) override
Update object.
Definition: HiveWhiteBoard.cpp:429
HiveWhiteBoard::registerAddress
StatusCode registerAddress(DataObject *parent, const std::string &path, IOpaqueAddress *pAddr) override
IDataManagerSvc: Register object address with the data store.
Definition: HiveWhiteBoard.cpp:136
IDataProviderSvc
Data provider interface definition.
Definition: IDataProviderSvc.h:45
HiveWhiteBoard::preLoad
StatusCode preLoad() override
load all preload items of the list
Definition: HiveWhiteBoard.cpp:263
DataStoreItem
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
HiveWhiteBoard::unregisterObject
StatusCode unregisterObject(DataObject *pObj, int item) override
Unregister object from the data store.
Definition: HiveWhiteBoard.cpp:323
ISvcManager.h
HiveWhiteBoard::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: HiveWhiteBoard.cpp:185
HiveWhiteBoard::selectStore
StatusCode selectStore(size_t partition) override
Activate a partition object. The identifies the partition uniquely.
Definition: HiveWhiteBoard.cpp:449
operator=
PropertyMgr & operator=(const PropertyMgr &)=delete
std::string
STL class.
wbMutex
tbb::recursive_mutex wbMutex
Definition: HiveWhiteBoard.cpp:36
Service.h
DataSvc.h
HiveWhiteBoard::removePreLoadItem
StatusCode removePreLoadItem(const std::string &item) override
Add an item to the preload list.
Definition: HiveWhiteBoard.cpp:251
std::vector::push_back
T push_back(T...args)
SvcFactory.h
IDataManagerSvc.h
IDataProviderSvc.h
HiveWhiteBoard::detachServices
StatusCode detachServices()
Definition: HiveWhiteBoard.cpp:550
HiveWhiteBoard::findObject
StatusCode findObject(DataObject *parent, const std::string &path, DataObject *&pObject) override
Find object in the data store.
Definition: HiveWhiteBoard.cpp:378
HiveWhiteBoard::linkObject
StatusCode linkObject(const std::string &from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: HiveWhiteBoard.cpp:393
HiveWhiteBoard::findObject
StatusCode findObject(const std::string &path, DataObject *&pObj) override
Find object identified by its full path in the data store.
Definition: HiveWhiteBoard.cpp:358
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
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:166
HiveWhiteBoard::updateObject
StatusCode updateObject(const std::string &path) override
Update object.
Definition: HiveWhiteBoard.cpp:427
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
HiveWhiteBoard::linkObject
StatusCode linkObject(const std::string &fullPath, DataObject *to) override
Add a link to another object.
Definition: HiveWhiteBoard.cpp:403
std::ostringstream
STL class.
HiveWhiteBoard::unregisterObject
StatusCode unregisterObject(const std::string &path) override
Unregister object from the data store.
Definition: HiveWhiteBoard.cpp:304
SmartIF.h
HiveWhiteBoard::updateObject
StatusCode updateObject(const std::string &parent, const std::string &updatePath) override
Update object.
Definition: HiveWhiteBoard.cpp:431
HiveWhiteBoard::removePreLoadItem
StatusCode removePreLoadItem(const DataStoreItem &item) override
Remove an item from the preload list.
Definition: HiveWhiteBoard.cpp:245
HiveWhiteBoard::newDataObjectsPresent
bool newDataObjectsPresent() override
Check if new DataObjects are in the current store.
Definition: HiveWhiteBoard.cpp:480
std::ostringstream::str
T str(T...args)
IRegistry.h
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
std::unordered_set< DataObjID, DataObjID_Hasher >
Service::reinitialize
StatusCode reinitialize() override
Definition: Service.cpp:250
DECLARE_SERVICE_FACTORY
#define DECLARE_SERVICE_FACTORY(x)
Definition: Service.h:211
HiveWhiteBoard::linkObject
StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: HiveWhiteBoard.cpp:388
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
HiveWhiteBoard::registerObject
StatusCode registerObject(DataObject *parent, int obj, DataObject *pObj) override
Register object with the data store.
Definition: HiveWhiteBoard.cpp:299
std::unordered_set::clear
T clear(T...args)
HiveWhiteBoard::unlinkObject
StatusCode unlinkObject(DataObject *from, const std::string &objPath) override
Remove a link to another object.
Definition: HiveWhiteBoard.cpp:418
IDataStoreAgent.h
HiveWhiteBoard
Data service base class.
Definition: HiveWhiteBoard.cpp:95
IRegistry::object
virtual DataObject * object() const =0
Retrieve object behind the link.
DataObjID.h
IOpaqueAddress.h
HiveWhiteBoard::attachServices
StatusCode attachServices()
Definition: HiveWhiteBoard.cpp:525
HiveWhiteBoard::traverseSubTree
StatusCode traverseSubTree(DataObject *pObject, IDataStoreAgent *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects below the sub tree.
Definition: HiveWhiteBoard.cpp:197
std::unordered_set::insert
T insert(T...args)
HiveWhiteBoard::registerObject
StatusCode registerObject(DataObject *parent, const std::string &obj, DataObject *pObj) override
Register object with the data store.
Definition: HiveWhiteBoard.cpp:294
TTHREAD_TLS
TTHREAD_TLS(Partition *) s_current(0)
HiveWhiteBoard::objectParent
StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object&#39;s parent.
Definition: HiveWhiteBoard.cpp:171
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:209
HiveWhiteBoard::m_partitions
Partitions m_partitions
Datastore partitions.
Definition: HiveWhiteBoard.cpp:113
std::vector< Partition >
HiveWhiteBoard::findObject
StatusCode findObject(IRegistry *parent, const std::string &path, DataObject *&pObj) override
Find object identified by its full path in the data store.
Definition: HiveWhiteBoard.cpp:363
IInterface::release
virtual unsigned long release()=0
Release Interface instance.
IDataStoreAgent
Generic data agent interface.
Definition: IDataStoreAgent.h:16
HiveWhiteBoard::~HiveWhiteBoard
virtual ~HiveWhiteBoard()
Standard Destructor.
Definition: HiveWhiteBoard.cpp:629
IAddressCreator.h
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:1119
IDataManagerSvc
Definition: IDataManagerSvc.h:45
std::vector::begin
T begin(T...args)
HiveWhiteBoard::unregisterAddress
StatusCode unregisterAddress(IRegistry *pParent, const std::string &path) override
IDataManagerSvc: Unregister object address from the data store.
Definition: HiveWhiteBoard.cpp:156
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:205
HiveWhiteBoard::rootCLID
CLID rootCLID() const override
IDataManagerSvc: Accessor for root event CLID.
Definition: HiveWhiteBoard.cpp:117
DataSvc
Data service base class.
Definition: DataSvc.h:44
TypeNameString.h
HiveWhiteBoard::retrieveObject
StatusCode retrieveObject(DataObject *parent, int item, DataObject *&pObj) override
Retrieve object from data store.
Definition: HiveWhiteBoard.cpp:353
MSG::ERROR
Definition: IMessageSvc.h:16
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:161
HiveWhiteBoard::unregisterObject
StatusCode unregisterObject(const std::string &parent, int obj) override
Unregister object from the data store.
Definition: HiveWhiteBoard.cpp:311
HiveWhiteBoard::initialize
StatusCode initialize() override
Service initialisation.
Definition: HiveWhiteBoard.cpp:564
HiveWhiteBoard::updateObject
StatusCode updateObject(DataObject *parent, const std::string &updatePath) override
Update object.
Definition: HiveWhiteBoard.cpp:436
HiveWhiteBoard::findObject
StatusCode findObject(const std::string &parent, const std::string &path, DataObject *&pObj) override
Find object in the data store.
Definition: HiveWhiteBoard.cpp:368
HiveWhiteBoard::unlinkObject
StatusCode unlinkObject(const std::string &from, const std::string &objPath) override
Remove a link to another object.
Definition: HiveWhiteBoard.cpp:413
HiveWhiteBoard::traverseTree
StatusCode traverseTree(IDataStoreAgent *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects in the data store.
Definition: HiveWhiteBoard.cpp:202
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:109
HiveWhiteBoard::findObject
StatusCode findObject(const std::string &parent, int item, DataObject *&pObject) override
Find object in the data store.
Definition: HiveWhiteBoard.cpp:373
HiveWhiteBoard::Partitions
std::vector< Partition > Partitions
Definition: HiveWhiteBoard.cpp:98
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
ISvcLocator.h
HiveWhiteBoard::retrieveObject
StatusCode retrieveObject(IRegistry *parent, const std::string &path, DataObject *&pObj) override
Retrieve object from data store.
Definition: HiveWhiteBoard.cpp:328
HiveWhiteBoard::getNewDataObjects
StatusCode getNewDataObjects(DataObjIDColl &products) override
Get the list of new DataObjects in the current store.
Definition: HiveWhiteBoard.cpp:470
HiveWhiteBoard::unregisterAddress
StatusCode unregisterAddress(DataObject *pParent, const std::string &path) override
IDataManagerSvc: Unregister object address from the data store.
Definition: HiveWhiteBoard.cpp:151
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
HiveWhiteBoard::rootName
const std::string & rootName() const override
Name for root Event.
Definition: HiveWhiteBoard.cpp:119
HiveWhiteBoard::reinitialize
StatusCode reinitialize() override
Service initialisation.
Definition: HiveWhiteBoard.cpp:601
HiveWhiteBoard::setNumberOfStores
StatusCode setNumberOfStores(size_t slots) override
Set the number of event slots (copies of DataSvc objects).
Definition: HiveWhiteBoard.cpp:456
DataObject.h