| The Gaudi Framework v27r1

- 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/Service.h"
10 #include "GaudiKernel/SmartIF.h"
11 #include "GaudiKernel/TypeNameString.h"
12 #include "GaudiKernel/MsgStream.h"
13 #include "GaudiKernel/SvcFactory.h"
14 #include "GaudiKernel/DataObject.h"
15 #include "GaudiKernel/DataObjID.h"
16 #include "GaudiKernel/DataSvc.h"
17 #include "tbb/spin_mutex.h"
18 #include "tbb/recursive_mutex.h"
19
20
21 //Interfaces
22 #include "GaudiKernel/ISvcLocator.h"
23 #include "GaudiKernel/ISvcManager.h"
24 #include "GaudiKernel/IOpaqueAddress.h"
25 #include "GaudiKernel/IConversionSvc.h"
26 #include "GaudiKernel/IDataManagerSvc.h"
27 #include "GaudiKernel/IAddressCreator.h"
28 #include "GaudiKernel/IDataProviderSvc.h"
29 #include "GaudiKernel/IDataStoreAgent.h"
30 #include "GaudiKernel/IHiveWhiteBoard.h"
31 #include "GaudiKernel/IRegistry.h"
32
33 // Forward declarations
34
35 typedef tbb::recursive_mutex wbMutex;
36 //typedef tbb::spin_mutex wbMutex;
37
38 namespace {
39 struct Partition {
40
41 SmartIF<IDataProviderSvc> dataProvider;
42 SmartIF<IDataManagerSvc> dataManager;
43 wbMutex storeMutex;
44 DataObjIDColl newDataObjects;
45 int eventNumber;
46 Partition() : dataProvider(0), dataManager(0), eventNumber(-1) {}
47 Partition(IDataProviderSvc* dp, IDataManagerSvc* dm) : dataProvider(dp), dataManager(dm), eventNumber(-1) {}
48 Partition(const Partition& entry) : dataProvider(entry.dataProvider), dataManager(entry.dataManager), eventNumber(entry.eventNumber) {}
49 Partition& operator=(const Partition& entry) {
50 dataProvider = entry.dataProvider;
51 dataManager = entry.dataManager;
52 return *this;
53 }
54 };
55 class DataAgent : virtual public IDataStoreAgent {
56 private:
57 DataObjIDColl& m_dataObjects;
58 public:
59 DataAgent(DataObjIDColl& objs) : m_dataObjects(objs) {}
60 virtual ~DataAgent() {}
61 virtual bool analyse(IRegistry* pReg, int ) {
62 if (0 != pReg->object()) {
63 m_dataObjects.insert(DataObjID(pReg->identifier()));
64 return true;
65 }
66 else {
67 return false;
68 }
69 }
70 };
71 }
72
73 thread_local Partition* s_current(0);
74
87 class HiveWhiteBoard: public extends<Service,
88 IDataProviderSvc,
89 IDataManagerSvc,
90 IHiveWhiteBoard>
91 {
92 protected:
93 typedef std::vector<Partition> Partitions;
94
96 CLID m_rootCLID;
98 std::string m_rootName;
100 std::string m_loader;
102 IConversionSvc* m_dataLoader;
104 IAddressCreator* m_addrCreator;
106 Partitions m_partitions;
108 int m_slots;
110 bool m_forceLeaves;
112 bool m_enableFaultHdlr;
113
114 public:
116 CLID rootCLID() const override {
117 return (CLID)m_rootCLID;
118 }
120 const std::string& rootName() const override {
121 return m_rootName;
122 }
123
124 // macro to help writing the function calls
125 #define _CALL(P,F,ARGS) if(s_current) { \
126 wbMutex::scoped_lock lock; lock.acquire(s_current->storeMutex);\
127 return s_current->P ? s_current->P->F ARGS : IDataProviderSvc::INVALID_ROOT; }\
128 return IDataProviderSvc::INVALID_ROOT;
129
131 StatusCode registerAddress(const std::string& path, IOpaqueAddress* pAddr) override {
132 _CALL(dataManager, registerAddress, (path, pAddr));
133 }
135 StatusCode registerAddress(DataObject* parent, const std::string& path, IOpaqueAddress* pAddr) override {
136 _CALL(dataManager, registerAddress, (parent, path, pAddr));
137 }
139 StatusCode registerAddress(IRegistry* parent, const std::string& path, IOpaqueAddress* pAdd) override {
140 _CALL(dataManager, registerAddress, (parent, path, pAdd));
141 }
143 StatusCode unregisterAddress(const std::string& path) override {
144 _CALL(dataManager, unregisterAddress, (path));
145 }
147 StatusCode unregisterAddress(DataObject* pParent, const std::string& path) override {
148 _CALL(dataManager, unregisterAddress, (pParent, path));
149 }
151 StatusCode unregisterAddress(IRegistry* pParent, const std::string& path) override {
152 _CALL(dataManager, unregisterAddress, (pParent, path));
153 }
155 StatusCode objectLeaves(const DataObject* pObject, std::vector<IRegistry*>& leaves) override {
156 _CALL(dataManager, objectLeaves, (pObject, leaves));
157 }
159 StatusCode objectLeaves(const IRegistry* pObject, std::vector<IRegistry*>& leaves) override {
160 _CALL(dataManager, objectLeaves, (pObject, leaves));
161 }
163 StatusCode objectParent(const DataObject* pObject, IRegistry*& refpParent) override {
164 _CALL(dataManager, objectParent, (pObject, refpParent));
165 }
167 StatusCode objectParent(const IRegistry* pObject, IRegistry*& refpParent) override {
168 _CALL(dataManager, objectParent, (pObject, refpParent));
169 }
171 StatusCode clearSubTree(const std::string& path) override {
172 _CALL(dataManager, clearSubTree, (path));
173 }
175 StatusCode clearSubTree(DataObject* pObject) override {
176 _CALL(dataManager, clearSubTree, (pObject));
177 }
179 StatusCode clearStore() override {
180 for(auto& p: m_partitions) p.dataManager->clearStore().ignore();
181 return StatusCode::SUCCESS;
182 }
183
185 StatusCode traverseSubTree(const std::string& path, IDataStoreAgent* pAgent) override {
186 _CALL(dataManager, traverseSubTree, (path, pAgent));
187 }
189 StatusCode traverseSubTree(DataObject* pObject, IDataStoreAgent* pAgent) override {
190 _CALL(dataManager, traverseSubTree, (pObject, pAgent));
191 }
193 StatusCode traverseTree( IDataStoreAgent* pAgent ) override {
194 _CALL(dataManager, traverseTree, (pAgent));
195 }
198 StatusCode setRoot(std::string path, DataObject* pObj) override {
199 _CALL(dataManager, setRoot, (path, pObj));
200 }
201
204 StatusCode setRoot (std::string path, IOpaqueAddress* pAddr) override {
205 _CALL(dataManager, setRoot, (path, pAddr));
206 }
207
212 StatusCode setDataLoader(IConversionSvc* pDataLoader,
213 IDataProviderSvc* dpsvc __attribute__((unused)) = nullptr) override {
214 if ( 0 != pDataLoader ) pDataLoader->addRef();
215 if ( 0 != m_dataLoader ) m_dataLoader->release();
216 if ( 0 != pDataLoader ) {
217 pDataLoader->setDataProvider(this);
218 }
219 m_dataLoader = pDataLoader;
220 for(auto& p: m_partitions) {
221 p.dataManager->setDataLoader(m_dataLoader,this).ignore();
222 }
223 return SUCCESS;
224 }
226 StatusCode addPreLoadItem(const DataStoreItem& item) override {
227 for(auto& p: m_partitions) p.dataProvider->addPreLoadItem(item);
228 return StatusCode::SUCCESS;
229 }
231 StatusCode addPreLoadItem(const std::string& item) override {
232 for(auto& p: m_partitions) p.dataProvider->addPreLoadItem(item);
233 return StatusCode::SUCCESS;
234 }
236 StatusCode removePreLoadItem(const DataStoreItem& item) override {
237 for(auto& p: m_partitions) p.dataProvider->removePreLoadItem(item);
238 return StatusCode::SUCCESS;
239 }
241 StatusCode removePreLoadItem(const std::string& item) override {
242 for(auto& p: m_partitions) p.dataProvider->removePreLoadItem(item);
243 return StatusCode::SUCCESS;
244 }
246 StatusCode resetPreLoad() override {
247 for(auto& p: m_partitions) p.dataProvider->resetPreLoad();
248 return StatusCode::SUCCESS;
249 }
251 StatusCode preLoad() override {
252 wbMutex::scoped_lock lock; lock.acquire(s_current->storeMutex);
253 StatusCode sc = s_current->dataProvider->preLoad();
254 DataAgent da(s_current->newDataObjects);
255 s_current->dataManager->traverseTree(&da);
256 return sc;
257 }
259 StatusCode registerObject(const std::string& path, DataObject* pObj) override {
260 wbMutex::scoped_lock lock; lock.acquire(s_current->storeMutex);
261 StatusCode sc = s_current->dataProvider->registerObject(path, pObj);
262 if( sc.isSuccess()) {
263 s_current->newDataObjects.insert(DataObjID(path));
264 }
265 return sc;
266 }
268 StatusCode registerObject(const std::string& parent, const std::string& obj, DataObject* pObj) override {
269 _CALL(dataProvider, registerObject, (parent, obj, pObj));
270 }
272 StatusCode registerObject(const std::string& parent, int item, DataObject* pObj) override {
273 _CALL(dataProvider, registerObject, (parent, item, pObj));
274 }
276 StatusCode registerObject(DataObject* parent, const std::string& obj, DataObject* pObj) override {
277 _CALL(dataProvider, registerObject, (parent, obj, pObj));
278 }
280 StatusCode registerObject(DataObject* parent, int obj, DataObject* pObj) override {
281 _CALL(dataProvider, registerObject, (parent, obj, pObj));
282 }
284 StatusCode unregisterObject(const std::string& path) override {
285 _CALL(dataProvider, unregisterObject, (path));
286 }
288 StatusCode unregisterObject(const std::string& parent, const std::string& obj) override {
289 _CALL(dataProvider, unregisterObject, (parent, obj));
290 }
292 StatusCode unregisterObject(const std::string& parent, int obj) override {
293 _CALL(dataProvider, unregisterObject, (parent, obj));
294 }
296 StatusCode unregisterObject(DataObject* pObj) override {
297 _CALL(dataProvider, unregisterObject, (pObj));
298 }
300 StatusCode unregisterObject(DataObject* pObj, const std::string& path) override {
301 _CALL(dataProvider, unregisterObject, (pObj, path));
302 }
304 StatusCode unregisterObject(DataObject* pObj, int item ) override {
305 _CALL(dataProvider, unregisterObject, (pObj, item));
306 }
308 StatusCode retrieveObject(IRegistry* parent, const std::string& path, DataObject*& pObj ) override {
309 _CALL(dataProvider, retrieveObject, (parent, path, pObj));
310 }
312 StatusCode retrieveObject(const std::string& path, DataObject*& pObj) override {
313 _CALL(dataProvider, retrieveObject, (path, pObj));
314 }
316 StatusCode retrieveObject(const std::string& parent, const std::string& path, DataObject*& pObj ) override {
317 _CALL(dataProvider, retrieveObject, (parent, path, pObj));
318 }
320 StatusCode retrieveObject(const std::string& parent, int item, DataObject*& pObj) override {
321 _CALL(dataProvider, retrieveObject, (parent, item, pObj));
322 }
324 StatusCode retrieveObject(DataObject* parent, const std::string& path, DataObject*& pObj ) override {
325 _CALL(dataProvider, retrieveObject, (parent, path, pObj));
326 }
328 StatusCode retrieveObject(DataObject* parent, int item, DataObject*& pObj ) override {
329 _CALL(dataProvider, retrieveObject, (parent, item, pObj));
330 }
332 StatusCode findObject(const std::string& path, DataObject*& pObj) override {
333 _CALL(dataProvider, retrieveObject, (path, pObj));
334 }
336 StatusCode findObject(IRegistry* parent, const std::string& path, DataObject*& pObj) override {
337 _CALL(dataProvider, retrieveObject, (parent, path, pObj));
338 }
340 StatusCode findObject(const std::string& parent, const std::string& path, DataObject*& pObj) override {
341 _CALL(dataProvider, retrieveObject, (parent, path, pObj));
342 }
344 StatusCode findObject(const std::string& parent, int item, DataObject*& pObject ) override {
345 _CALL(dataProvider, findObject, (parent, item, pObject));
346 }
348 StatusCode findObject(DataObject* parent, const std::string& path, DataObject*& pObject) override {
349 _CALL(dataProvider, findObject, (parent, path, pObject));
350 }
352 StatusCode findObject(DataObject* parent, int item, DataObject*& pObject) override {
353 _CALL(dataProvider, findObject, (parent, item, pObject));
354 }
356 StatusCode linkObject(IRegistry* from, const std::string& objPath, DataObject* to) override {
357 _CALL(dataProvider, linkObject, (from, objPath, to));
358 }
360 StatusCode linkObject(const std::string& from, const std::string& objPath, DataObject* to) override {
361 _CALL(dataProvider, linkObject, (from, objPath, to));
362 }
364 StatusCode linkObject(DataObject* from, const std::string& objPath, DataObject* to) override {
365 _CALL(dataProvider, linkObject, (from, objPath, to));
366 }
368 StatusCode linkObject(const std::string& fullPath, DataObject* to) override {
369 _CALL(dataProvider, linkObject, (fullPath, to));
370 }
372 StatusCode unlinkObject(IRegistry* from, const std::string& objPath) override {
373 _CALL(dataProvider, unlinkObject, (from, objPath));
374 }
376 StatusCode unlinkObject(const std::string& from, const std::string& objPath) override {
377 _CALL(dataProvider, unlinkObject, (from, objPath));
378 }
380 StatusCode unlinkObject(DataObject* from, const std::string& objPath) override {
381 _CALL(dataProvider, unlinkObject, (from, objPath));
382 }
384 StatusCode unlinkObject(const std::string& path) override {
385 _CALL(dataProvider, unlinkObject, (path));
386 }
388 StatusCode updateObject(IRegistry* pDirectory ) override {
389 _CALL(dataProvider, updateObject, (pDirectory));
390 }
392 StatusCode updateObject(const std::string& path) override {
393 _CALL(dataProvider, updateObject, (path));
394 }
396 StatusCode updateObject(DataObject* pObj ) override {
397 _CALL(dataProvider, updateObject, (pObj));
398 }
400 StatusCode updateObject(const std::string& parent, const std::string& updatePath ) override {
401 _CALL(dataProvider, updateObject, (parent, updatePath));
402 }
404 StatusCode updateObject(DataObject* parent, const std::string& updatePath) override {
405 _CALL(dataProvider, updateObject, (parent, updatePath));
406 }
407
408 //
409 //---IHiveWhiteBard implemenation--------------------------------------------------
410 //
411
413 StatusCode clearStore(size_t partition) override {
414 return m_partitions[partition].dataManager->clearStore();
415 }
416
418 StatusCode selectStore(size_t partition) override {
419 s_current = &m_partitions[partition];
420 return StatusCode::SUCCESS;
421 }
422
424 StatusCode setNumberOfStores(size_t slots) override {
425 if((int)slots != m_slots and
426 FSMState() == Gaudi::StateMachine::INITIALIZED) {
427 warning() << "Too late to change the number of slots!" << endmsg;
428 return StatusCode::FAILURE;
429 }
430 m_slots = slots;
431 return StatusCode::SUCCESS;
432 }
433
435 size_t getNumberOfStores() override {
436 return m_slots;
437 }
438
440 StatusCode getNewDataObjects(DataObjIDColl& products) {
441 wbMutex::scoped_lock lock; lock.acquire(s_current->storeMutex);
442 products = s_current->newDataObjects;
443 s_current->newDataObjects.clear();
444 return StatusCode::SUCCESS;
445 }
446
448 bool newDataObjectsPresent() override {
449 wbMutex::scoped_lock lock; lock.acquire(s_current->storeMutex);
450 return s_current->newDataObjects.size()!=0;
451 }
452
454 size_t allocateStore( int evtnumber ) override {
455 //size_t free = std::string::npos;
456 size_t index = 0;
457 for (auto& p : m_partitions ) {
458 if( p.eventNumber == evtnumber) {
459 error() << "Attempt to allocate a store partition for an event that is still active" << endmsg;
460 return std::string::npos;
461 } else if (p.eventNumber == -1) {
462 p.eventNumber = evtnumber;
463 //info() << "Got allocated slot..." << index << endmsg;
464 return index;
465 }
466 index++;
467 }
468 return std::string::npos;
469 }
470
472 StatusCode freeStore( size_t partition ) override {
473 m_partitions[partition].eventNumber = -1;
474 //info() << "Freed slot..." << partition << endmsg;
475 return StatusCode::SUCCESS;
476 }
477
478
480 size_t getPartitionNumber(int eventnumber) const override {
481 size_t index{};
482 for (auto& p : m_partitions) {
483 if (p.eventNumber == eventnumber) return index;
484 ++index;
485 }
486 return std::string::npos;
487 }
488
489 StatusCode attachServices() {
490 StatusCode sc = service(m_loader, m_addrCreator, true);
491 if (!sc.isSuccess()) {
492 error() << "Failed to retrieve data loader " << "\"" << m_loader << "\"" << endmsg;
493 return sc;
494 }
495 IConversionSvc* dataLoader = 0;
496 sc = service(m_loader, dataLoader, true);
497 if (!sc.isSuccess()) {
498 error() << MSG::ERROR << "Failed to retrieve data loader " << "\"" << m_loader << "\"" << endmsg;
499 return sc;
500 }
501 sc = setDataLoader(dataLoader);
502 dataLoader->release();
503 if (!sc.isSuccess()) {
504 error() << MSG::ERROR << "Failed to set data loader " << "\"" << m_loader << "\"" << endmsg;
505 return sc;
506 }
507 return sc;
508 }
509
510 StatusCode detachServices() {
511 if ( m_addrCreator ) m_addrCreator->release();
512 if ( m_dataLoader ) m_dataLoader->release();
513 m_addrCreator = 0;
514 m_dataLoader = 0;
515 return StatusCode::SUCCESS;
516 }
517
518 //
519 //---IService implemenation---------------------------------------------------------
520 //
521
523 StatusCode initialize() override {
524 StatusCode sc = Service::initialize();
525 if ( !sc.isSuccess() ) {
526 error() << "Unable to initialize base class" << endmsg;
527 return sc;
528 }
529
530 if (1 > m_slots ){
531 error() << "Invalid number of slots (" << m_slots << ")" << endmsg;
532 return StatusCode::FAILURE;
533 }
534
535 for( int i = 0; i< m_slots; i++) {
536 std::ostringstream oss;
537 oss << name() << "_" << i;
538 DataSvc* svc = new DataSvc(oss.str(), serviceLocator());
539 // Percolate properties
540 svc->setProperty("RootCLID", std::to_string(m_rootCLID));
541 svc->setProperty("RootName", m_rootName);
542 svc->setProperty("ForceLeaves", std::to_string(m_forceLeaves));
543 svc->setProperty("EnableFaultHandler", std::to_string(m_enableFaultHdlr));
544
545 sc = svc->initialize();
546 if (!sc.isSuccess()) {
547 error() << "Failed to instantiate DataSvc as store partition" << endmsg;
548 return sc;
549 }
550 m_partitions.push_back(Partition(svc, svc));
551 }
552 selectStore(0).ignore();
553 return attachServices();
554 }
555
557 StatusCode reinitialize() override {
558 StatusCode sc = Service::reinitialize();
559 if (!sc.isSuccess()) {
560 error() << "Unable to reinitialize base class" << endmsg;
561 return sc;
562 }
563 detachServices();
564 sc = attachServices();
565 if ( !sc.isSuccess() ) {
566 error() << "Failed to attach necessary services." << endmsg;
567 return sc;
568 }
569 return StatusCode::SUCCESS;
570 }
571
573 StatusCode finalize() override {
574 setDataLoader(0).ignore();
575 clearStore().ignore();
576 return Service::finalize();
577 }
578
579
580 //protected:
581
583 HiveWhiteBoard( const std::string& name, ISvcLocator* svc )
584 : base_class(name,svc), m_rootCLID(110), m_rootName("/Event"),
585 m_dataLoader(0), m_addrCreator(0)
586 {
587 m_dataLoader = 0;
588 declareProperty("RootCLID", m_rootCLID);
589 declareProperty("RootName", m_rootName);
590 declareProperty("DataLoader", m_loader="EventPersistencySvc");
591 declareProperty("EventSlots", m_slots = 1);
592 declareProperty("ForceLeaves", m_forceLeaves = 1);
593 declareProperty("EnableFaultHandler", m_enableFaultHdlr = 0);
594 }
595
597 virtual ~HiveWhiteBoard() {
598 setDataLoader(0).ignore();
599 resetPreLoad().ignore();
600 clearStore().ignore();
601
602 for(Partitions::iterator i = m_partitions.begin(); i != m_partitions.end(); ++i) {
603 (*i).dataManager->release();
604 (*i).dataProvider->release();
605 }
606 m_partitions.clear();
607 }
608
609 };
610
611 // Instantiation of a static factory class used by clients to create
612 // instances of this service
613 DECLARE_SERVICE_FACTORY(HiveWhiteBoard)
HiveWhiteBoard::unlinkObject
StatusCode unlinkObject(const std::string &path) override
Remove a link to another object.
Definition: HiveWhiteBoard.cpp:384
HiveWhiteBoard::unlinkObject
StatusCode unlinkObject(IRegistry *from, const std::string &objPath) override
Remove a link to another object.
Definition: HiveWhiteBoard.cpp:372
HiveWhiteBoard::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: HiveWhiteBoard.cpp:388
HiveWhiteBoard::retrieveObject
StatusCode retrieveObject(const std::string &parent, const std::string &path, DataObject *&pObj) override
Retrieve object from data store.
Definition: HiveWhiteBoard.cpp:316
HiveWhiteBoard::registerAddress
StatusCode registerAddress(IRegistry *parent, const std::string &path, IOpaqueAddress *pAdd) override
IDataManagerSvc: Register object address with the data store.
Definition: HiveWhiteBoard.cpp:139
HiveWhiteBoard::linkObject
StatusCode linkObject(DataObject *from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: HiveWhiteBoard.cpp:364
_CALL
#define _CALL(P, F, ARGS)
Definition: HiveWhiteBoard.cpp:125
HiveWhiteBoard::retrieveObject
StatusCode retrieveObject(const std::string &parent, int item, DataObject *&pObj) override
Retrieve object from data store.
Definition: HiveWhiteBoard.cpp:320
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:259
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:68
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
HiveWhiteBoard::registerObject
StatusCode registerObject(const std::string &parent, int item, DataObject *pObj) override
Register object with the data store.
Definition: HiveWhiteBoard.cpp:272
HiveWhiteBoard::unregisterObject
StatusCode unregisterObject(DataObject *pObj) override
Unregister object from the data store.
Definition: HiveWhiteBoard.cpp:296
SmartIF< IDataProviderSvc >
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:324
__attribute__
#define __attribute__(x)
Definition: System.cpp:70
HiveWhiteBoard::allocateStore
size_t allocateStore(int evtnumber) override
Allocate a store partition for a given event number.
Definition: HiveWhiteBoard.cpp:454
HiveWhiteBoard::traverseSubTree
StatusCode traverseSubTree(const std::string &path, IDataStoreAgent *pAgent) override
Analyze by traversing all data objects below the sub tree.
Definition: HiveWhiteBoard.cpp:185
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
HiveWhiteBoard::unregisterAddress
StatusCode unregisterAddress(const std::string &path) override
IDataManagerSvc: Unregister object address from the data store.
Definition: HiveWhiteBoard.cpp:143
HiveWhiteBoard::setDataLoader
StatusCode setDataLoader(IConversionSvc *pDataLoader, IDataProviderSvc *dpsvc __attribute__((unused))=nullptr) override
IDataManagerSvc: Pass a default data loader to the service.
Definition: HiveWhiteBoard.cpp:212
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:193
IConversionSvc
Definition: IConversionSvc.h:37
Service::FSMState
Gaudi::StateMachine::State FSMState() const override
Definition: Service.h:57
DataObjID
Definition: DataObjID.h:38
MsgStream.h
HiveWhiteBoard::retrieveObject
StatusCode retrieveObject(DataObject *parent, const std::string &path, DataObject *&pObj) override
Retrieve object from data store.
Definition: HiveWhiteBoard.cpp:324
HiveWhiteBoard::freeStore
StatusCode freeStore(size_t partition) override
Free a store partition.
Definition: HiveWhiteBoard.cpp:472
HiveWhiteBoard::clearStore
StatusCode clearStore(size_t partition) override
Remove all data objects in one 'slot' of the data store.
Definition: HiveWhiteBoard.cpp:413
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
IDataStoreAgent::analyse
virtual bool analyse(IRegistry *pObject, int level)=0
Analyse the data object.
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:312
HiveWhiteBoard::registerObject
StatusCode registerObject(const std::string &parent, const std::string &obj, DataObject *pObj) override
Register object with the data store.
Definition: HiveWhiteBoard.cpp:268
HiveWhiteBoard::findObject
StatusCode findObject(DataObject *parent, int item, DataObject *&pObject) override
Find object in the data store.
Definition: HiveWhiteBoard.cpp:352
std::to_string
T to_string(T...args)
HiveWhiteBoard::unregisterObject
StatusCode unregisterObject(const std::string &parent, const std::string &obj) override
Unregister object from the data store.
Definition: HiveWhiteBoard.cpp:288
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:300
HiveWhiteBoard::getNewDataObjects
StatusCode getNewDataObjects(DataObjIDColl &products)
Get the list of new DataObjects in the current store.
Definition: HiveWhiteBoard.cpp:440
Service::setProperty
StatusCode setProperty(const Property &p) override
Definition: Service.cpp:330
HiveWhiteBoard::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: HiveWhiteBoard.cpp:246
HiveWhiteBoard::addPreLoadItem
StatusCode addPreLoadItem(const std::string &item) override
Add an item to the preload list.
Definition: HiveWhiteBoard.cpp:231
HiveWhiteBoard::finalize
StatusCode finalize() override
Service initialisation.
Definition: HiveWhiteBoard.cpp:573
HiveWhiteBoard::clearSubTree
StatusCode clearSubTree(DataObject *pObject) override
Remove all data objects below the sub tree identified.
Definition: HiveWhiteBoard.cpp:175
HiveWhiteBoard::clearSubTree
StatusCode clearSubTree(const std::string &path) override
Remove all data objects below the sub tree identified.
Definition: HiveWhiteBoard.cpp:171
HiveWhiteBoard::objectParent
StatusCode objectParent(const IRegistry *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object's parent.
Definition: HiveWhiteBoard.cpp:167
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:226
HiveWhiteBoard::updateObject
StatusCode updateObject(DataObject *pObj) override
Update object.
Definition: HiveWhiteBoard.cpp:396
HiveWhiteBoard::registerAddress
StatusCode registerAddress(DataObject *parent, const std::string &path, IOpaqueAddress *pAddr) override
IDataManagerSvc: Register object address with the data store.
Definition: HiveWhiteBoard.cpp:135
IDataProviderSvc
Data provider interface definition.
Definition: IDataProviderSvc.h:45
HiveWhiteBoard::preLoad
StatusCode preLoad() override
load all preload items of the list
Definition: HiveWhiteBoard.cpp:251
merge_files.sc
int sc
Definition: merge_files.py:167
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:304
ISvcManager.h
HiveWhiteBoard::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: HiveWhiteBoard.cpp:179
HiveWhiteBoard::getPartitionNumber
size_t getPartitionNumber(int eventnumber) const override
Get the partition number corresponding to a given event.
Definition: HiveWhiteBoard.cpp:480
HiveWhiteBoard::selectStore
StatusCode selectStore(size_t partition) override
Activate a partition object. The identifies the partition uniquely.
Definition: HiveWhiteBoard.cpp:418
HiveWhiteBoard::m_enableFaultHdlr
bool m_enableFaultHdlr
Flag to enable interrupts on data creation requests.
Definition: HiveWhiteBoard.cpp:112
std::string
STL class.
wbMutex
tbb::recursive_mutex wbMutex
Definition: HiveWhiteBoard.cpp:35
Service.h
DataSvc.h
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
HiveWhiteBoard::removePreLoadItem
StatusCode removePreLoadItem(const std::string &item) override
Add an item to the preload list.
Definition: HiveWhiteBoard.cpp:241
std::vector::push_back
T push_back(T...args)
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
SvcFactory.h
HiveWhiteBoard::m_rootName
std::string m_rootName
Name of root event.
Definition: HiveWhiteBoard.cpp:98
IDataManagerSvc.h
IDataProviderSvc.h
GaudiPython.Bindings.SUCCESS
tuple SUCCESS
Definition: Bindings.py:51
HiveWhiteBoard::detachServices
StatusCode detachServices()
Definition: HiveWhiteBoard.cpp:510
HiveWhiteBoard::findObject
StatusCode findObject(DataObject *parent, const std::string &path, DataObject *&pObject) override
Find object in the data store.
Definition: HiveWhiteBoard.cpp:348
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:121
HiveWhiteBoard::m_loader
std::string m_loader
Data loader name.
Definition: HiveWhiteBoard.cpp:100
HiveWhiteBoard::linkObject
StatusCode linkObject(const std::string &from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: HiveWhiteBoard.cpp:360
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:332
StatusCode::FAILURE
Definition: StatusCode.h:29
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:159
HiveWhiteBoard::updateObject
StatusCode updateObject(const std::string &path) override
Update object.
Definition: HiveWhiteBoard.cpp:392
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
HiveWhiteBoard::linkObject
StatusCode linkObject(const std::string &fullPath, DataObject *to) override
Add a link to another object.
Definition: HiveWhiteBoard.cpp:368
std::ostringstream
STL class.
HiveWhiteBoard::m_forceLeaves
bool m_forceLeaves
Allow forced creation of default leaves on registerObject.
Definition: HiveWhiteBoard.cpp:110
HiveWhiteBoard::unregisterObject
StatusCode unregisterObject(const std::string &path) override
Unregister object from the data store.
Definition: HiveWhiteBoard.cpp:284
SmartIF.h
locker.lock
def lock(file)
Definition: locker.py:16
HiveWhiteBoard::rootCLID
CLID rootCLID() const override
IDataManagerSvc: Accessor for root event CLID.
Definition: HiveWhiteBoard.cpp:116
HiveWhiteBoard::updateObject
StatusCode updateObject(const std::string &parent, const std::string &updatePath) override
Update object.
Definition: HiveWhiteBoard.cpp:400
HiveWhiteBoard::removePreLoadItem
StatusCode removePreLoadItem(const DataStoreItem &item) override
Remove an item from the preload list.
Definition: HiveWhiteBoard.cpp:236
HiveWhiteBoard::newDataObjectsPresent
bool newDataObjectsPresent() override
Check if new DataObjects are in the current store.
Definition: HiveWhiteBoard.cpp:448
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:282
DECLARE_SERVICE_FACTORY
#define DECLARE_SERVICE_FACTORY(x)
Definition: Service.h:361
HiveWhiteBoard::m_rootCLID
CLID m_rootCLID
Integer Property corresponding to CLID of root entry.
Definition: HiveWhiteBoard.cpp:96
HiveWhiteBoard::linkObject
StatusCode linkObject(IRegistry *from, const std::string &objPath, DataObject *to) override
Add a link to another object.
Definition: HiveWhiteBoard.cpp:356
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:280
std::vector::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:380
IDataStoreAgent.h
HiveWhiteBoard::rootName
const std::string & rootName() const override
Name for root Event.
Definition: HiveWhiteBoard.cpp:120
IRegistry::object
virtual DataObject * object() const =0
Retrieve object behind the link.
HiveWhiteBoard::getNumberOfStores
size_t getNumberOfStores() override
Get the number of event slots (copies of DataSvc objects).
Definition: HiveWhiteBoard.cpp:435
HiveWhiteBoard
Data service base class.
Definition: HiveWhiteBoard.cpp:87
Gaudi::Utils::Histos::path
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
Definition: HistoTableFormat.cpp:191
DataObjID.h
IOpaqueAddress.h
HiveWhiteBoard::attachServices
StatusCode attachServices()
Definition: HiveWhiteBoard.cpp:489
HiveWhiteBoard::traverseSubTree
StatusCode traverseSubTree(DataObject *pObject, IDataStoreAgent *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects below the sub tree.
Definition: HiveWhiteBoard.cpp:189
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:276
HiveWhiteBoard::objectParent
StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object's parent.
Definition: HiveWhiteBoard.cpp:163
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:204
HiveWhiteBoard::m_partitions
Partitions m_partitions
Datastore partitions.
Definition: HiveWhiteBoard.cpp:106
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:336
IInterface::release
virtual unsigned long release()=0
Release Interface instance.
HiveWhiteBoard::m_addrCreator
IAddressCreator * m_addrCreator
Reference to address creator.
Definition: HiveWhiteBoard.cpp:104
IDataStoreAgent
Generic data agent interface.
Definition: IDataStoreAgent.h:16
HiveWhiteBoard::~HiveWhiteBoard
virtual ~HiveWhiteBoard()
Standard Destructor.
Definition: HiveWhiteBoard.cpp:597
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:1153
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:151
HiveWhiteBoard::HiveWhiteBoard
HiveWhiteBoard(const std::string &name, ISvcLocator *svc)
Standard Constructor.
Definition: HiveWhiteBoard.cpp:583
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:198
DataSvc
Data service base class.
Definition: DataSvc.h:43
TypeNameString.h
ana.item
tuple item
print s1,s2
Definition: ana.py:146
CommonMessaging
Definition: CommonMessaging.h:58
HiveWhiteBoard::retrieveObject
StatusCode retrieveObject(DataObject *parent, int item, DataObject *&pObj) override
Retrieve object from data store.
Definition: HiveWhiteBoard.cpp:328
MSG::ERROR
Definition: IMessageSvc.h:21
IInterface::addRef
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
HiveWhiteBoard::m_slots
int m_slots
Datastore slots.
Definition: HiveWhiteBoard.cpp:108
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:155
HiveWhiteBoard::unregisterObject
StatusCode unregisterObject(const std::string &parent, int obj) override
Unregister object from the data store.
Definition: HiveWhiteBoard.cpp:292
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:144
HiveWhiteBoard::initialize
StatusCode initialize() override
Service initialisation.
Definition: HiveWhiteBoard.cpp:523
HiveWhiteBoard::updateObject
StatusCode updateObject(DataObject *parent, const std::string &updatePath) override
Update object.
Definition: HiveWhiteBoard.cpp:404
HiveWhiteBoard::findObject
StatusCode findObject(const std::string &parent, const std::string &path, DataObject *&pObj) override
Find object in the data store.
Definition: HiveWhiteBoard.cpp:340
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
HiveWhiteBoard::unlinkObject
StatusCode unlinkObject(const std::string &from, const std::string &objPath) override
Remove a link to another object.
Definition: HiveWhiteBoard.cpp:376
HiveWhiteBoard::traverseTree
StatusCode traverseTree(IDataStoreAgent *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects in the data store.
Definition: HiveWhiteBoard.cpp:193
s_current
thread_local Partition * s_current(0)
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108
Service::declareProperty
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Service.h:215
HiveWhiteBoard::m_dataLoader
IConversionSvc * m_dataLoader
Pointer to data loader service.
Definition: HiveWhiteBoard.cpp:102
HiveWhiteBoard::findObject
StatusCode findObject(const std::string &parent, int item, DataObject *&pObject) override
Find object in the data store.
Definition: HiveWhiteBoard.cpp:344
HiveWhiteBoard::Partitions
std::vector< Partition > Partitions
Definition: HiveWhiteBoard.cpp:93
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
ana.i
list i
Definition: ana.py:128
ISvcLocator.h
HiveWhiteBoard::retrieveObject
StatusCode retrieveObject(IRegistry *parent, const std::string &path, DataObject *&pObj) override
Retrieve object from data store.
Definition: HiveWhiteBoard.cpp:308
HiveWhiteBoard::unregisterAddress
StatusCode unregisterAddress(DataObject *pParent, const std::string &path) override
IDataManagerSvc: Unregister object address from the data store.
Definition: HiveWhiteBoard.cpp:147
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
HiveWhiteBoard::reinitialize
StatusCode reinitialize() override
Service initialisation.
Definition: HiveWhiteBoard.cpp:557
HiveWhiteBoard::setNumberOfStores
StatusCode setNumberOfStores(size_t slots) override
Set the number of event slots (copies of DataSvc objects).
Definition: HiveWhiteBoard.cpp:424
DataObject.h