| The Gaudi Framework v32r1 (f65d50dc)

MultiStoreSvc.cpp
Go to the documentation of this file.
1 //====================================================================
2 // MultiStoreSvc.cpp
3 //--------------------------------------------------------------------
4 //
5 // Package : System ( The LHCb Offline System)
6 //
7 // Description: implementation of the Transient event data service.
8 //
9 // Author : M.Frank
10 // History :
11 // +---------+----------------------------------------------+---------
12 // | Date | Comment | Who
13 // +---------+----------------------------------------------+---------
14 // | 29/10/98| Initial version | MF
15 // +---------+----------------------------------------------+---------
16 //
17 //====================================================================
18 #define DATASVC_MULTISTORESVC_CPP
19
20 // Include files
21 #include "GaudiKernel/AttribStringParser.h"
22 #include "GaudiKernel/DataObject.h"
23 #include "GaudiKernel/IAddressCreator.h"
24 #include "GaudiKernel/IConversionSvc.h"
25 #include "GaudiKernel/IDataManagerSvc.h"
26 #include "GaudiKernel/IDataProviderSvc.h"
27 #include "GaudiKernel/IOpaqueAddress.h"
28 #include "GaudiKernel/IPartitionControl.h"
29 #include "GaudiKernel/ISvcLocator.h"
30 #include "GaudiKernel/ISvcManager.h"
31 #include "GaudiKernel/MsgStream.h"
32 #include "GaudiKernel/Service.h"
33 #include "GaudiKernel/SmartIF.h"
34 #include "GaudiKernel/TypeNameString.h"
35 #include "GaudiKernel/compose.h"
36 #include <map>
37 #include <variant>
38
39 // Forward declarations
40 // This class
41 class MultiStoreSvc;
42
43 typedef const std::string CSTR;
44 typedef IDataStoreAgent AGENT;
45 typedef DataObject OBJECT;
46 typedef IOpaqueAddress ADDRESS;
47
48 namespace {
49 struct Partition final {
50 SmartIF<IDataProviderSvc> dataProvider;
51 SmartIF<IDataManagerSvc> dataManager;
52 std::string name;
53
54 template <typename T>
55 T* get();
56 };
57 template <>
58 IDataProviderSvc* Partition::get<IDataProviderSvc>() {
59 return dataProvider.get();
60 }
61 template <>
62 IDataManagerSvc* Partition::get<IDataManagerSvc>() {
63 return dataManager.get();
64 }
65
66 namespace detail {
67 template <typename lambda>
68 struct arg_helper : public arg_helper<decltype( &lambda::operator() )> {};
69 template <typename T, typename Ret, typename Arg>
70 struct arg_helper<Ret ( T::* )( Arg ) const> {
71 using type = Arg;
72 };
73
74 // given a unary lambda whose argument is of type Arg_t,
75 // argument_t<lambda> will be equal to Arg_t
76 template <typename lambda>
77 using argument_t = typename arg_helper<lambda>::type;
78 } // namespace detail
79 auto visit = []( auto&& variant, auto&&... lambdas ) -> decltype( auto ) {
80 return std::visit( Gaudi::overload( std::forward<decltype( lambdas )>( lambdas )... ),
81 std::forward<decltype( variant )>( variant ) );
82 };
83 } // namespace
84
96 class MultiStoreSvc : public extends<Service, IDataProviderSvc, IDataManagerSvc, IPartitionControl> {
97 protected:
98 typedef std::vector<std::string> PartitionDefs;
99 typedef std::map<std::string, Partition> Partitions;
100
101 Gaudi::Property<CLID> m_rootCLID{this, "RootCLID", 110, "CLID of root entry"};
102 Gaudi::Property<std::string> m_rootName{this, "RootName", "/Event", "name of root entry"};
103 Gaudi::Property<PartitionDefs> m_partitionDefs{this, "Partitions", {}, "datastore partition definitions"};
104 Gaudi::Property<std::string> m_loader{this, "DataLoader", "EventPersistencySvc", "data loader name"};
105 Gaudi::Property<std::string> m_defaultPartition{this, "DefaultPartition", "Default", "default partition name"};
106
108 SmartIF<IConversionSvc> m_dataLoader;
110 SmartIF<IAddressCreator> m_addrCreator;
112 struct tagROOT {
113 std::string path;
114 std::variant<std::monostate, ADDRESS*, OBJECT*> root;
115 } m_root;
117 Partition m_current;
119 Partitions m_partitions;
120
121 // member templates to help writing the function calls
122 template <typename Fun>
123 StatusCode fwd( Fun f ) {
124 auto* svc = m_current.get<std::decay_t<detail::argument_t<Fun>>>();
125 return svc ? f( *svc ) : IDataProviderSvc::Status::INVALID_ROOT;
126 }
127
128 public:
130 CLID rootCLID() const override { return m_rootCLID; }
132 const std::string& rootName() const override { return m_rootName; }
133
135 StatusCode registerAddress( std::string_view path, ADDRESS* pAddr ) override {
136 return fwd( [&]( IDataManagerSvc& svc ) { return svc.registerAddress( path, pAddr ); } );
137 }
139 StatusCode registerAddress( IRegistry* parent, std::string_view path, ADDRESS* pAddr ) override {
140 return fwd( [&]( IDataManagerSvc& svc ) { return svc.registerAddress( parent, path, pAddr ); } );
141 }
143 StatusCode unregisterAddress( std::string_view path ) override {
144 return fwd( [&]( IDataManagerSvc& svc ) { return svc.unregisterAddress( path ); } );
145 }
147 StatusCode unregisterAddress( IRegistry* pParent, std::string_view path ) override {
148 return fwd( [&]( IDataManagerSvc& svc ) { return svc.unregisterAddress( pParent, path ); } );
149 }
151 StatusCode objectLeaves( const OBJECT* pObject, std::vector<IRegistry*>& leaves ) override {
152 return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectLeaves( pObject, leaves ); } );
153 }
155 StatusCode objectLeaves( const IRegistry* pObject, std::vector<IRegistry*>& leaves ) override {
156 return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectLeaves( pObject, leaves ); } );
157 }
159 StatusCode objectParent( const OBJECT* pObject, IRegistry*& refpParent ) override {
160 return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectParent( pObject, refpParent ); } );
161 }
163 StatusCode objectParent( const IRegistry* pObject, IRegistry*& refpParent ) override {
164 return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectParent( pObject, refpParent ); } );
165 }
167 StatusCode clearSubTree( std::string_view path ) override {
168 return fwd( [&]( IDataManagerSvc& svc ) { return svc.clearSubTree( path ); } );
169 }
171 StatusCode clearSubTree( OBJECT* pObject ) override {
172 return fwd( [&]( IDataManagerSvc& svc ) { return svc.clearSubTree( pObject ); } );
173 }
175 StatusCode clearStore() override {
176 for ( auto& i : m_partitions ) { i.second.dataManager->clearStore().ignore(); }
177 visit(
178 m_root.root,
179 []( auto* p ) {
180 if ( p ) p->release();
181 },
182 []( std::monostate ) {} );
183 m_root.root = {};
184 m_root.path.clear();
185 return StatusCode::SUCCESS;
186 }
188 StatusCode traverseSubTree( std::string_view path, AGENT* pAgent ) override {
189 return fwd( [&]( IDataManagerSvc& svc ) { return svc.traverseSubTree( path, pAgent ); } );
190 }
192 StatusCode traverseSubTree( OBJECT* pObject, AGENT* pAgent ) override {
193 return fwd( [&]( IDataManagerSvc& svc ) { return svc.traverseSubTree( pObject, pAgent ); } );
194 }
196 StatusCode traverseTree( AGENT* pAgent ) override {
197 return fwd( [&]( IDataManagerSvc& svc ) { return svc.traverseTree( pAgent ); } );
198 }
201 StatusCode setRoot( std::string path, OBJECT* pObj ) override {
202 visit(
203 m_root.root,
204 []( auto* p ) {
205 if ( p ) p->release();
206 },
207 []( std::monostate ) {} );
208 m_root.path = std::move( path );
209 m_root.root = pObj;
210 preparePartitions();
211 return activate( m_defaultPartition );
212 }
213
216 StatusCode setRoot( std::string path, ADDRESS* pAddr ) override {
217 visit(
218 m_root.root,
219 []( auto* p ) {
220 if ( p ) p->release();
221 },
222 []( std::monostate ) {} );
223 m_root.path = std::move( path );
224 m_root.root = pAddr;
225 if ( !pAddr ) return StatusCode::FAILURE;
226 pAddr->addRef();
227 preparePartitions();
228 return activate( m_defaultPartition );
229 }
231 StatusCode setDataLoader( IConversionSvc* pDataLoader, IDataProviderSvc* dpsvc = nullptr ) override {
232 m_dataLoader = pDataLoader;
233 if ( m_dataLoader ) m_dataLoader->setDataProvider( dpsvc ? dpsvc : this );
234 for ( auto& i : m_partitions ) { i.second.dataManager->setDataLoader( m_dataLoader.get() ).ignore(); }
235 return StatusCode::SUCCESS;
236 }
238 StatusCode addPreLoadItem( const DataStoreItem& item ) override {
239 return fwd( [&]( IDataProviderSvc& svc ) { return svc.addPreLoadItem( item ); } );
240 }
242 StatusCode removePreLoadItem( const DataStoreItem& item ) override {
243 return fwd( [&]( IDataProviderSvc& svc ) { return svc.removePreLoadItem( item ); } );
244 }
246 StatusCode resetPreLoad() override {
247 return fwd( [&]( IDataProviderSvc& svc ) { return svc.resetPreLoad(); } );
248 }
250 StatusCode preLoad() override {
251 return fwd( [&]( IDataProviderSvc& svc ) { return svc.preLoad(); } );
252 }
254 StatusCode registerObject( std::string_view parent, std::string_view obj, OBJECT* pObj ) override {
255 return fwd( [&]( IDataProviderSvc& svc ) { return svc.registerObject( parent, obj, pObj ); } );
256 }
258 StatusCode registerObject( OBJECT* parent, std::string_view obj, OBJECT* pObj ) override {
259 return fwd( [&]( IDataProviderSvc& svc ) { return svc.registerObject( parent, obj, pObj ); } );
260 }
262 StatusCode unregisterObject( std::string_view path ) override {
263 return fwd( [&]( IDataProviderSvc& svc ) { return svc.unregisterObject( path ); } );
264 }
266 StatusCode unregisterObject( OBJECT* pObj ) override {
267 return fwd( [&]( IDataProviderSvc& svc ) { return svc.unregisterObject( pObj ); } );
268 }
270 StatusCode unregisterObject( OBJECT* pObj, std::string_view path ) override {
271 return fwd( [&]( IDataProviderSvc& svc ) { return svc.unregisterObject( pObj, path ); } );
272 }
274 StatusCode retrieveObject( IRegistry* parent, std::string_view path, OBJECT*& pObj ) override {
275 return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( parent, path, pObj ); } );
276 }
278 StatusCode findObject( std::string_view path, OBJECT*& pObj ) override {
279 return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( path, pObj ); } );
280 }
282 StatusCode findObject( IRegistry* parent, std::string_view path, OBJECT*& pObj ) override {
283 return fwd( [&]( IDataProviderSvc& svc ) { return svc.findObject( parent, path, pObj ); } );
284 }
286 StatusCode linkObject( IRegistry* from, std::string_view objPath, OBJECT* to ) override {
287 return fwd( [&]( IDataProviderSvc& svc ) { return svc.linkObject( from, objPath, to ); } );
288 }
290 StatusCode linkObject( std::string_view fullPath, OBJECT* to ) override {
291 return fwd( [&]( IDataProviderSvc& svc ) { return svc.linkObject( fullPath, to ); } );
292 }
294 StatusCode unlinkObject( IRegistry* from, std::string_view objPath ) override {
295 return fwd( [&]( IDataProviderSvc& svc ) { return svc.unlinkObject( from, objPath ); } );
296 }
298 StatusCode unlinkObject( OBJECT* from, std::string_view objPath ) override {
299 return fwd( [&]( IDataProviderSvc& svc ) { return svc.unlinkObject( from, objPath ); } );
300 }
302 StatusCode unlinkObject( std::string_view path ) override {
303 return fwd( [&]( IDataProviderSvc& svc ) { return svc.unlinkObject( path ); } );
304 }
306 StatusCode updateObject( IRegistry* pDirectory ) override {
307 return fwd( [&]( IDataProviderSvc& svc ) { return svc.updateObject( pDirectory ); } );
308 }
310 StatusCode updateObject( OBJECT* pObj ) override {
311 return fwd( [&]( IDataProviderSvc& svc ) { return svc.updateObject( pObj ); } );
312 }
314 StatusCode create( CSTR& nam, CSTR& typ ) override {
315 IInterface* pPartition = nullptr;
316 return create( nam, typ, pPartition );
317 }
319 StatusCode create( CSTR& nam, CSTR& typ, IInterface*& pPartition ) override {
320 if ( get( nam, pPartition ).isSuccess() ) return IPartitionControl::Status::PARTITION_EXISTS;
322 auto isvc = serviceLocator()->service<IService>( typ );
323 if ( !isvc ) return IInterface::Status::NO_INTERFACE;
324 auto dataMgr = isvc.as<IDataManagerSvc>();
325 auto dataProv = isvc.as<IDataProviderSvc>();
326 if ( !dataMgr || !dataProv ) return IInterface::Status::NO_INTERFACE;
327 m_partitions.emplace( nam, Partition{dataProv, dataMgr, nam} );
328 return StatusCode::SUCCESS;
329 }
330
332 StatusCode drop( CSTR& nam ) override {
333 auto i = m_partitions.find( nam );
334 if ( i == m_partitions.end() ) return IPartitionControl::Status::PARTITION_NOT_PRESENT;
335 if ( i->second.dataManager == m_current.dataManager ) { m_current = Partition(); }
336 i->second.dataManager->clearStore().ignore();
337 m_partitions.erase( i );
338 return StatusCode::SUCCESS;
339 }
340
342 StatusCode drop( IInterface* pPartition ) override {
343 auto provider = SmartIF<IDataProviderSvc>( pPartition );
344 if ( !provider ) return IInterface::Status::NO_INTERFACE;
345 auto i = std::find_if( std::begin( m_partitions ), std::end( m_partitions ),
346 [&]( Partitions::const_reference p ) { return p.second.dataProvider == provider; } );
347 if ( i == std::end( m_partitions ) ) return IPartitionControl::Status::PARTITION_NOT_PRESENT;
348 i->second.dataManager->clearStore().ignore();
349 m_partitions.erase( i );
350 return StatusCode::SUCCESS;
351 }
352
354 StatusCode activate( CSTR& nam ) override {
355 auto i = m_partitions.find( nam );
356 if ( i != m_partitions.end() ) {
357 m_current = i->second;
358 return StatusCode::SUCCESS;
359 }
360 m_current = {};
361 return IPartitionControl::Status::PARTITION_NOT_PRESENT;
362 }
363
365 StatusCode activate( IInterface* pPartition ) override {
366 auto provider = SmartIF<IDataProviderSvc>( pPartition );
367 m_current = Partition();
368 if ( !provider ) return IInterface::Status::NO_INTERFACE;
369 auto i = std::find_if( std::begin( m_partitions ), std::end( m_partitions ),
370 [&]( Partitions::const_reference p ) { return p.second.dataProvider == provider; } );
371 if ( i == std::end( m_partitions ) ) return IPartitionControl::Status::PARTITION_NOT_PRESENT;
372 m_current = i->second;
373 return StatusCode::SUCCESS;
374 }
375
377 StatusCode get( CSTR& nam, IInterface*& pPartition ) const override {
378 auto i = m_partitions.find( nam );
379 if ( i != m_partitions.end() ) {
380 pPartition = i->second.dataProvider;
381 return StatusCode::SUCCESS;
382 }
383 pPartition = nullptr;
384 return IPartitionControl::Status::PARTITION_NOT_PRESENT;
385 }
386
388 StatusCode activePartition( std::string& nam, IInterface*& pPartition ) const override {
389 if ( m_current.dataProvider ) {
390 nam = m_current.name;
391 pPartition = m_current.dataProvider;
392 return StatusCode::SUCCESS;
393 }
394 nam.clear();
395 pPartition = nullptr;
396 return IPartitionControl::Status::NO_ACTIVE_PARTITION;
397 }
398
399 StatusCode attachServices() {
400 // Attach address creator facility
401 m_addrCreator = service( m_loader, true );
402 if ( !m_addrCreator ) {
403 error() << "Failed to retrieve data loader "
404 << "\"" << m_loader << "\"" << endmsg;
405 return StatusCode::FAILURE;
406 }
407 // Attach data loader facility
408 auto dataLoader = service<IConversionSvc>( m_loader, true );
409 if ( !dataLoader ) {
410 error() << "Failed to retrieve data loader "
411 << "\"" << m_loader << "\"" << endmsg;
412 return StatusCode::FAILURE;
413 }
414 auto sc = setDataLoader( dataLoader.get() );
415 if ( !sc.isSuccess() ) {
416 error() << "Failed to set data loader "
417 << "\"" << m_loader << "\"" << endmsg;
418 }
419 return sc;
420 }
421
422 StatusCode detachServices() {
423 m_addrCreator.reset();
424 m_dataLoader.reset();
425 return StatusCode::SUCCESS;
426 }
427
429 StatusCode initialize() override {
430 // Nothing to do: just call base class initialisation
431 StatusCode sc = Service::initialize();
432 if ( !sc.isSuccess() ) return sc;
433 sc = makePartitions();
434 if ( !sc.isSuccess() ) {
435 error() << "Failed to connect to all store partitions." << endmsg;
436 return sc;
437 }
438 return attachServices();
439 }
440
442 StatusCode reinitialize() override {
443 StatusCode sc = Service::reinitialize();
444 if ( !sc.isSuccess() ) {
445 error() << "Enable to reinitialize base class" << endmsg;
446 return sc;
447 }
448 detachServices();
449 sc = attachServices();
450 if ( !sc.isSuccess() ) {
451 error() << "Failed to attach necessary services." << endmsg;
452 return sc;
453 }
454 sc = makePartitions();
455 if ( !sc.isSuccess() ) {
456 error() << "Failed to connect to store partitions." << endmsg;
457 return sc;
458 }
459 // return
460 return StatusCode::SUCCESS;
461 }
462
464 StatusCode finalize() override {
465 setDataLoader( nullptr ).ignore();
466 clearStore().ignore();
467 clearPartitions().ignore();
468 m_current = Partition();
469 detachServices();
470 return Service::finalize();
471 }
472
473 // protected:
474
476 using extends::extends;
477
479 ~MultiStoreSvc() override {
480 setDataLoader( nullptr ).ignore();
481 resetPreLoad().ignore();
482 clearStore().ignore();
483 clearPartitions().ignore();
484 }
485
487 StatusCode preparePartitions() {
488 StatusCode iret = StatusCode::SUCCESS;
489 for ( auto& i : m_partitions ) {
490 StatusCode sc = visit(
491 m_root.root,
492 [&]( ADDRESS* address ) -> StatusCode {
493 if ( !address ) return StatusCode::FAILURE;
494 ADDRESS* pAdd = nullptr;
495 ADDRESS* p = address;
496 auto sc = m_addrCreator->createAddress( p->svcType(), p->clID(), p->par(), p->ipar(), pAdd );
497 return sc.isSuccess() ? i.second.dataManager->setRoot( m_root.path, pAdd ) : sc;
498 },
499 [&]( OBJECT* object ) -> StatusCode {
500 if ( object && object->clID() == CLID_DataObject ) {
501 return i.second.dataManager->setRoot( m_root.path, new DataObject() );
502 }
503 return StatusCode::FAILURE;
504 },
505 []( std::monostate ) -> StatusCode { return StatusCode::FAILURE; } );
506 if ( !sc.isSuccess() ) iret = sc;
507 }
508 return iret;
509 }
510
512 StatusCode clearPartitions() {
513 for ( auto& i : m_partitions ) i.second.dataManager->clearStore().ignore();
514 m_partitions.clear();
515 return StatusCode::SUCCESS;
516 }
517
519 StatusCode makePartitions() {
520 using Parser = Gaudi::Utils::AttribStringParser;
521 std::string typ, nam;
522 clearPartitions().ignore();
523 for ( auto part : m_partitionDefs ) {
524 for ( auto attrib : Parser( std::move( part ) ) ) {
525 switch ( ::toupper( attrib.tag[0] ) ) {
526 case 'N':
527 nam = std::move( attrib.value );
528 break;
529 case 'T':
530 typ = std::move( attrib.value );
531 break;
532 }
533 }
534 StatusCode sc = create( nam, typ );
535 if ( !sc.isSuccess() ) return sc;
536 if ( m_defaultPartition.empty() ) m_defaultPartition = nam;
537 }
538 return StatusCode::SUCCESS;
539 }
540 };
541
542 // Instantiation of a static factory class used by clients to create
543 // instances of this service
544 DECLARE_COMPONENT( MultiStoreSvc )
IDataManagerSvc::traverseTree
virtual StatusCode traverseTree(IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects in the data store.
MultiStoreSvc::detachServices
StatusCode detachServices()
Definition: MultiStoreSvc.cpp:422
Gaudi::Utils::AttribStringParser
Parse attribute strings allowing iteration over the various attributes.
Definition: AttribStringParser.h:30
MultiStoreSvc::registerAddress
StatusCode registerAddress(std::string_view path, ADDRESS *pAddr) override
IDataManagerSvc: Register object address with the data store.
Definition: MultiStoreSvc.cpp:135
IInterface::Status::NO_INTERFACE
Requested interface is not available.
MultiStoreSvc::create
StatusCode create(CSTR &nam, CSTR &typ) override
Create a partition object. The name identifies the partition uniquely.
Definition: MultiStoreSvc.cpp:314
MultiStoreSvc::removePreLoadItem
StatusCode removePreLoadItem(const DataStoreItem &item) override
Remove an item from the preload list.
Definition: MultiStoreSvc.cpp:242
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:60
SmartIF< IDataProviderSvc >
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:277
MultiStoreSvc::tagROOT::root
std::variant< std::monostate, ADDRESS *, OBJECT * > root
Definition: MultiStoreSvc.cpp:114
MultiStoreSvc::clearSubTree
StatusCode clearSubTree(std::string_view path) override
Remove all data objects below the sub tree identified.
Definition: MultiStoreSvc.cpp:167
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 ...
MultiStoreSvc::clearStore
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
Definition: MultiStoreSvc.cpp:175
compose.h
IPartitionControl::Status::PARTITION_EXISTS
MultiStoreSvc::m_partitions
Partitions m_partitions
Datastore partitions.
Definition: MultiStoreSvc.cpp:119
MultiStoreSvc::fwd
StatusCode fwd(Fun f)
Definition: MultiStoreSvc.cpp:123
MultiStoreSvc::unlinkObject
StatusCode unlinkObject(std::string_view path) override
Remove a link to another object.
Definition: MultiStoreSvc.cpp:302
MultiStoreSvc::traverseTree
StatusCode traverseTree(AGENT *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects in the data store.
Definition: MultiStoreSvc.cpp:196
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.
MultiStoreSvc::m_root
struct MultiStoreSvc::tagROOT m_root
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
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.
IDataProviderSvc::addPreLoadItem
virtual StatusCode addPreLoadItem(const DataStoreItem &item)=0
Add an item to the preload list.
IDataManagerSvc
Definition: IDataManagerSvc.h:45
MultiStoreSvc::objectLeaves
StatusCode objectLeaves(const OBJECT *pObject, std::vector< IRegistry * > &leaves) override
Explore the object store: retrieve all leaves attached to the object.
Definition: MultiStoreSvc.cpp:151
IPartitionControl::Status::PARTITION_NOT_PRESENT
MultiStoreSvc::unregisterObject
StatusCode unregisterObject(std::string_view path) override
Unregister object from the data store.
Definition: MultiStoreSvc.cpp:262
MultiStoreSvc::tagROOT
Root type (address or object)
Definition: MultiStoreSvc.cpp:112
IDataManagerSvc::unregisterAddress
virtual StatusCode unregisterAddress(std::string_view fullPath)=0
Unregister object address from the data store.
IConverter::setDataProvider
virtual StatusCode setDataProvider(IDataProviderSvc *pService)=0
Set Data provider service.
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
IDataProviderSvc::preLoad
virtual StatusCode preLoad()=0
Load all preload items of the list.
MultiStoreSvc::registerAddress
StatusCode registerAddress(IRegistry *parent, std::string_view path, ADDRESS *pAddr) override
IDataManagerSvc: Register object address with the data store.
Definition: MultiStoreSvc.cpp:139
MultiStoreSvc::unlinkObject
StatusCode unlinkObject(OBJECT *from, std::string_view objPath) override
Remove a link to another object.
Definition: MultiStoreSvc.cpp:298
IDataProviderSvc::resetPreLoad
virtual StatusCode resetPreLoad()=0
Clear the preload list.
MultiStoreSvc::linkObject
StatusCode linkObject(std::string_view fullPath, OBJECT *to) override
Add a link to another object.
Definition: MultiStoreSvc.cpp:290
MultiStoreSvc::m_rootCLID
Gaudi::Property< CLID > m_rootCLID
Definition: MultiStoreSvc.cpp:101
std::map::end
T end(T... args)
MultiStoreSvc
Data service base class.
Definition: MultiStoreSvc.cpp:96
MultiStoreSvc::unlinkObject
StatusCode unlinkObject(IRegistry *from, std::string_view objPath) override
Remove a link to another object.
Definition: MultiStoreSvc.cpp:294
IDataProviderSvc
Data provider interface definition.
Definition: IDataProviderSvc.h:43
DataStoreItem
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
std::map< std::string, Partition >
ISvcManager.h
IDataManagerSvc::objectParent
virtual StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent)=0
IDataManagerSvc: Explore the object store: retrieve the object's parent.
MultiStoreSvc::m_dataLoader
SmartIF< IConversionSvc > m_dataLoader
Pointer to data loader service.
Definition: MultiStoreSvc.cpp:108
IDataProviderSvc::findObject
virtual StatusCode findObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Find object identified by its directory entry.
IDataProviderSvc::unlinkObject
virtual StatusCode unlinkObject(IRegistry *from, std::string_view objPath)=0
Remove a link to another object.
MultiStoreSvc::registerObject
StatusCode registerObject(std::string_view parent, std::string_view obj, OBJECT *pObj) override
Register object with the data store.
Definition: MultiStoreSvc.cpp:254
IDataProviderSvc::Status::INVALID_ROOT
Invalid root path object cannot be retrieved or stored.
MultiStoreSvc::attachServices
StatusCode attachServices()
Definition: MultiStoreSvc.cpp:399
std::string
STL class.
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginServiceV1.h:46
MultiStoreSvc::PartitionDefs
std::vector< std::string > PartitionDefs
Definition: MultiStoreSvc.cpp:98
IDataProviderSvc::removePreLoadItem
virtual StatusCode removePreLoadItem(const DataStoreItem &item)=0
Remove an item from the preload list.
Service.h
IDataProviderSvc::unregisterObject
virtual StatusCode unregisterObject(std::string_view fullPath)=0
Unregister object from the data store.
MultiStoreSvc::get
StatusCode get(CSTR &nam, IInterface *&pPartition) const override
Access a partition object. The name identifies the partition uniquely.
Definition: MultiStoreSvc.cpp:377
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:76
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:274
MultiStoreSvc::setRoot
StatusCode setRoot(std::string path, OBJECT *pObj) override
Initialize data store for new event by giving new event path and root object.
Definition: MultiStoreSvc.cpp:201
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
MultiStoreSvc::unregisterAddress
StatusCode unregisterAddress(std::string_view path) override
IDataManagerSvc: Unregister object address from the data store.
Definition: MultiStoreSvc.cpp:143
IDataProviderSvc.h
detail
TupleObj.h GaudiAlg/TupleObj.h namespace with few technical implementations.
IPartitionControl.h
IService
General service interface definition.
Definition: IService.h:18
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
MultiStoreSvc::drop
StatusCode drop(CSTR &nam) override
Drop a partition object. The name identifies the partition uniquely.
Definition: MultiStoreSvc.cpp:332
IDataProviderSvc::updateObject
virtual StatusCode updateObject(IRegistry *pDirectory)=0
Update object identified by its directory entry.
MultiStoreSvc::updateObject
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
Definition: MultiStoreSvc.cpp:306
IInterface
Definition of the basic interface.
Definition: IInterface.h:244
gaudirun.type
type
Definition: gaudirun.py:142
MultiStoreSvc::findObject
StatusCode findObject(IRegistry *parent, std::string_view path, OBJECT *&pObj) override
Find object identified by its full path in the data store.
Definition: MultiStoreSvc.cpp:282
IPartitionControl::Status::NO_ACTIVE_PARTITION
SmartIF.h
MultiStoreSvc::m_loader
Gaudi::Property< std::string > m_loader
Definition: MultiStoreSvc.cpp:104
std::map::erase
T erase(T... args)
MultiStoreSvc::clearPartitions
StatusCode clearPartitions()
Clear all partitions.
Definition: MultiStoreSvc.cpp:512
MultiStoreSvc::unregisterObject
StatusCode unregisterObject(OBJECT *pObj) override
Unregister object from the data store.
Definition: MultiStoreSvc.cpp:266
MultiStoreSvc::m_defaultPartition
Gaudi::Property< std::string > m_defaultPartition
Definition: MultiStoreSvc.cpp:105
MultiStoreSvc::findObject
StatusCode findObject(std::string_view path, OBJECT *&pObj) override
Find object identified by its full path in the data store.
Definition: MultiStoreSvc.cpp:278
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
CSTR
const std::string CSTR
Definition: MultiStoreSvc.cpp:41
MultiStoreSvc::preparePartitions
StatusCode preparePartitions()
Prepare partition for usage.
Definition: MultiStoreSvc.cpp:487
OBJECT
DataObject OBJECT
Definition: MultiStoreSvc.cpp:45
Service::reinitialize
StatusCode reinitialize() override
Definition: Service.cpp:237
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
MultiStoreSvc::registerObject
StatusCode registerObject(OBJECT *parent, std::string_view obj, OBJECT *pObj) override
Register object with the data store.
Definition: MultiStoreSvc.cpp:258
std::string::clear
T clear(T... args)
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
std::move
T move(T... args)
MultiStoreSvc::traverseSubTree
StatusCode traverseSubTree(OBJECT *pObject, AGENT *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects below the sub tree.
Definition: MultiStoreSvc.cpp:192
MultiStoreSvc::rootCLID
CLID rootCLID() const override
IDataManagerSvc: Accessor for root event CLID.
Definition: MultiStoreSvc.cpp:130
MultiStoreSvc::rootName
const std::string & rootName() const override
Name for root Event.
Definition: MultiStoreSvc.cpp:132
MultiStoreSvc::m_current
Partition m_current
Current partition.
Definition: MultiStoreSvc.cpp:117
MultiStoreSvc::m_rootName
Gaudi::Property< std::string > m_rootName
Definition: MultiStoreSvc.cpp:102
IOpaqueAddress.h
MultiStoreSvc::objectParent
StatusCode objectParent(const OBJECT *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object's parent.
Definition: MultiStoreSvc.cpp:159
MultiStoreSvc::drop
StatusCode drop(IInterface *pPartition) override
Drop a partition object. The name identifies the partition uniquely.
Definition: MultiStoreSvc.cpp:342
MultiStoreSvc::objectLeaves
StatusCode objectLeaves(const IRegistry *pObject, std::vector< IRegistry * > &leaves) override
Explore the object store: retrieve all leaves attached to the object.
Definition: MultiStoreSvc.cpp:155
MultiStoreSvc::traverseSubTree
StatusCode traverseSubTree(std::string_view path, AGENT *pAgent) override
Analyze by traversing all data objects below the sub tree.
Definition: MultiStoreSvc.cpp:188
std::map::find
T find(T... args)
StatusCode::ignore
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:153
MultiStoreSvc::create
StatusCode create(CSTR &nam, CSTR &typ, IInterface *&pPartition) override
Create a partition object. The name identifies the partition uniquely.
Definition: MultiStoreSvc.cpp:319
std::vector< std::string >
IDataProviderSvc::retrieveObject
virtual StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
IDataStoreAgent
Generic data agent interface.
Definition: IDataStoreAgent.h:17
MultiStoreSvc::resetPreLoad
StatusCode resetPreLoad() override
Clear the preload list.
Definition: MultiStoreSvc.cpp:246
IDataProviderSvc::registerObject
StatusCode registerObject(std::string_view fullPath, DataObject *pObject)
Register object with the data store.
Definition: IDataProviderSvc.h:62
IAddressCreator.h
IConversionSvc.h
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
std::begin
T begin(T... args)
MultiStoreSvc::setRoot
StatusCode setRoot(std::string path, ADDRESS *pAddr) override
Initialize data store for new event by giving new event path and address of root object.
Definition: MultiStoreSvc.cpp:216
MultiStoreSvc::updateObject
StatusCode updateObject(OBJECT *pObj) override
Update object.
Definition: MultiStoreSvc.cpp:310
MultiStoreSvc::activePartition
StatusCode activePartition(std::string &nam, IInterface *&pPartition) const override
Access the active partition object.
Definition: MultiStoreSvc.cpp:388
MultiStoreSvc::m_addrCreator
SmartIF< IAddressCreator > m_addrCreator
Reference to address creator.
Definition: MultiStoreSvc.cpp:110
std::map::emplace
T emplace(T... args)
MultiStoreSvc::activate
StatusCode activate(CSTR &nam) override
Activate a partition object. The name identifies the partition uniquely.
Definition: MultiStoreSvc.cpp:354
MultiStoreSvc::unregisterAddress
StatusCode unregisterAddress(IRegistry *pParent, std::string_view path) override
IDataManagerSvc: Unregister object address from the data store.
Definition: MultiStoreSvc.cpp:147
TypeNameString.h
AttribStringParser.h
MultiStoreSvc::activate
StatusCode activate(IInterface *pPartition) override
Activate a partition object.
Definition: MultiStoreSvc.cpp:365
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
MultiStoreSvc::initialize
StatusCode initialize() override
Service initialisation.
Definition: MultiStoreSvc.cpp:429
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
MultiStoreSvc::setDataLoader
StatusCode setDataLoader(IConversionSvc *pDataLoader, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: Pass a default data loader to the service.
Definition: MultiStoreSvc.cpp:231
MultiStoreSvc::addPreLoadItem
StatusCode addPreLoadItem(const DataStoreItem &item) override
Add an item to the preload list.
Definition: MultiStoreSvc.cpp:238
MultiStoreSvc::unregisterObject
StatusCode unregisterObject(OBJECT *pObj, std::string_view path) override
Unregister object from the data store.
Definition: MultiStoreSvc.cpp:270
MultiStoreSvc::retrieveObject
StatusCode retrieveObject(IRegistry *parent, std::string_view path, OBJECT *&pObj) override
Retrieve object from data store.
Definition: MultiStoreSvc.cpp:274
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:86
MultiStoreSvc::makePartitions
StatusCode makePartitions()
Create all partitions according to job options.
Definition: MultiStoreSvc.cpp:519
MultiStoreSvc::clearSubTree
StatusCode clearSubTree(OBJECT *pObject) override
Remove all data objects below the sub tree identified.
Definition: MultiStoreSvc.cpp:171
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
MultiStoreSvc::m_partitionDefs
Gaudi::Property< PartitionDefs > m_partitionDefs
Definition: MultiStoreSvc.cpp:103
MultiStoreSvc::reinitialize
StatusCode reinitialize() override
Service initialisation.
Definition: MultiStoreSvc.cpp:442
MultiStoreSvc::objectParent
StatusCode objectParent(const IRegistry *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object's parent.
Definition: MultiStoreSvc.cpp:163
ADDRESS
IOpaqueAddress ADDRESS
Definition: MultiStoreSvc.cpp:46
MultiStoreSvc::finalize
StatusCode finalize() override
Service initialisation.
Definition: MultiStoreSvc.cpp:464
MultiStoreSvc::preLoad
StatusCode preLoad() override
load all preload items of the list
Definition: MultiStoreSvc.cpp:250
MultiStoreSvc::Partitions
std::map< std::string, Partition > Partitions
Definition: MultiStoreSvc.cpp:99
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
Gaudi::overload
auto overload(lambda_ts &&... lambdas)
Definition: compose.h:28
ISvcLocator.h
std::forward
T forward(T... args)
toupper
void toupper(std::string &s)
Definition: StatusCodeSvc.cpp:7
MultiStoreSvc::linkObject
StatusCode linkObject(IRegistry *from, std::string_view objPath, OBJECT *to) override
Add a link to another object.
Definition: MultiStoreSvc.cpp:286
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
AGENT
IDataStoreAgent AGENT
Definition: MultiStoreSvc.cpp:44
MultiStoreSvc::tagROOT::path
std::string path
Definition: MultiStoreSvc.cpp:113
DataObject.h
MultiStoreSvc::~MultiStoreSvc
~MultiStoreSvc() override
Standard Destructor.
Definition: MultiStoreSvc.cpp:479
IOpaqueAddress::addRef
virtual unsigned long addRef()=0
Add reference to object.