The Gaudi Framework  master (b9786168)
Loading...
Searching...
No Matches
MultiStoreSvc.cpp
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3* *
4* This software is distributed under the terms of the Apache version 2 licence, *
5* copied verbatim in the file "LICENSE". *
6* *
7* In applying this licence, CERN does not waive the privileges and immunities *
8* granted to it by virtue of its status as an Intergovernmental Organization *
9* or submit itself to any jurisdiction. *
10\***********************************************************************************/
11//====================================================================
12// MultiStoreSvc.cpp
13//--------------------------------------------------------------------
14//
15// Package : System ( The LHCb Offline System)
16//
17// Description: implementation of the Transient event data service.
18//
19// Author : M.Frank
20// History :
21// +---------+----------------------------------------------+---------
22// | Date | Comment | Who
23// +---------+----------------------------------------------+---------
24// | 29/10/98| Initial version | MF
25// +---------+----------------------------------------------+---------
26//
27//====================================================================
28#define DATASVC_MULTISTORESVC_CPP
29
30// Include files
42#include <GaudiKernel/Service.h>
43#include <GaudiKernel/SmartIF.h>
45#include <GaudiKernel/compose.h>
46#include <map>
47#include <variant>
48
49// Forward declarations
50// This class
51class MultiStoreSvc;
52
53typedef const std::string CSTR;
57
58namespace {
59 struct Partition final {
60 SmartIF<IDataProviderSvc> dataProvider;
61 SmartIF<IDataManagerSvc> dataManager;
62 std::string name;
63
64 template <typename T>
65 T* get();
66 };
67 template <>
68 IDataProviderSvc* Partition::get<IDataProviderSvc>() {
69 return dataProvider.get();
70 }
71 template <>
72 IDataManagerSvc* Partition::get<IDataManagerSvc>() {
73 return dataManager.get();
74 }
75
76 namespace detail {
77 template <typename lambda>
78 struct arg_helper : public arg_helper<decltype( &lambda::operator() )> {};
79 template <typename T, typename Ret, typename Arg>
80 struct arg_helper<Ret ( T::* )( Arg ) const> {
81 using type = Arg;
82 };
83
84 // given a unary lambda whose argument is of type Arg_t,
85 // argument_t<lambda> will be equal to Arg_t
86 template <typename lambda>
87 using argument_t = typename arg_helper<lambda>::type;
88 } // namespace detail
89 auto visit = []( auto&& variant, auto&&... lambdas ) -> decltype( auto ) {
90 return std::visit( Gaudi::overload( std::forward<decltype( lambdas )>( lambdas )... ),
91 std::forward<decltype( variant )>( variant ) );
92 };
93} // namespace
94
106class MultiStoreSvc : public extends<Service, IDataProviderSvc, IDataManagerSvc, IPartitionControl> {
107protected:
108 typedef std::vector<std::string> PartitionDefs;
109 typedef std::map<std::string, Partition> Partitions;
110
111 Gaudi::Property<CLID> m_rootCLID{ this, "RootCLID", 110, "CLID of root entry" };
112 Gaudi::Property<std::string> m_rootName{ this, "RootName", "/Event", "name of root entry" };
113 Gaudi::Property<PartitionDefs> m_partitionDefs{ this, "Partitions", {}, "datastore partition definitions" };
114 Gaudi::Property<std::string> m_loader{ this, "DataLoader", "EventPersistencySvc", "data loader name" };
115 Gaudi::Property<std::string> m_defaultPartition{ this, "DefaultPartition", "Default", "default partition name" };
116
122 struct tagROOT {
123 std::string path;
124 std::variant<std::monostate, ADDRESS*, OBJECT*> root;
127 Partition m_current;
130
131 // member templates to help writing the function calls
132 template <typename Fun>
133 StatusCode fwd( Fun f ) {
134 auto* svc = m_current.get<std::decay_t<detail::argument_t<Fun>>>();
135 return svc ? f( *svc ) : IDataProviderSvc::Status::INVALID_ROOT;
136 }
137
138public:
140 CLID rootCLID() const override { return m_rootCLID; }
142 const std::string& rootName() const override { return m_rootName; }
143
145 StatusCode registerAddress( std::string_view path, ADDRESS* pAddr ) override {
146 return fwd( [&]( IDataManagerSvc& svc ) { return svc.registerAddress( path, pAddr ); } );
147 }
148
149 StatusCode registerAddress( IRegistry* parent, std::string_view path, ADDRESS* pAddr ) override {
150 return fwd( [&]( IDataManagerSvc& svc ) { return svc.registerAddress( parent, path, pAddr ); } );
151 }
152
153 StatusCode unregisterAddress( std::string_view path ) override {
154 return fwd( [&]( IDataManagerSvc& svc ) { return svc.unregisterAddress( path ); } );
155 }
156
157 StatusCode unregisterAddress( IRegistry* pParent, std::string_view path ) override {
158 return fwd( [&]( IDataManagerSvc& svc ) { return svc.unregisterAddress( pParent, path ); } );
159 }
160
161 StatusCode objectLeaves( const OBJECT* pObject, std::vector<IRegistry*>& leaves ) override {
162 return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectLeaves( pObject, leaves ); } );
163 }
164
165 StatusCode objectLeaves( const IRegistry* pObject, std::vector<IRegistry*>& leaves ) override {
166 return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectLeaves( pObject, leaves ); } );
167 }
168
169 StatusCode objectParent( const OBJECT* pObject, IRegistry*& refpParent ) override {
170 return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectParent( pObject, refpParent ); } );
171 }
172
173 StatusCode objectParent( const IRegistry* pObject, IRegistry*& refpParent ) override {
174 return fwd( [&]( IDataManagerSvc& svc ) { return svc.objectParent( pObject, refpParent ); } );
175 }
176
177 StatusCode clearSubTree( std::string_view path ) override {
178 return fwd( [&]( IDataManagerSvc& svc ) { return svc.clearSubTree( path ); } );
179 }
180
181 StatusCode clearSubTree( OBJECT* pObject ) override {
182 return fwd( [&]( IDataManagerSvc& svc ) { return svc.clearSubTree( pObject ); } );
183 }
184
186 for ( auto& i : m_partitions ) { i.second.dataManager->clearStore().ignore(); }
187 visit(
188 m_root.root,
189 []( auto* p ) {
190 if ( p ) p->release();
191 },
192 []( std::monostate ) {} );
193 m_root.root = {};
194 m_root.path.clear();
195 return StatusCode::SUCCESS;
196 }
197
198 StatusCode traverseSubTree( std::string_view path, AGENT* pAgent ) override {
199 return fwd( [&]( IDataManagerSvc& svc ) { return svc.traverseSubTree( path, pAgent ); } );
200 }
201
202 StatusCode traverseSubTree( OBJECT* pObject, AGENT* pAgent ) override {
203 return fwd( [&]( IDataManagerSvc& svc ) { return svc.traverseSubTree( pObject, pAgent ); } );
204 }
205
206 StatusCode traverseTree( AGENT* pAgent ) override {
207 return fwd( [&]( IDataManagerSvc& svc ) { return svc.traverseTree( pAgent ); } );
208 }
209
211 StatusCode setRoot( std::string path, OBJECT* pObj ) override {
212 visit(
213 m_root.root,
214 []( auto* p ) {
215 if ( p ) p->release();
216 },
217 []( std::monostate ) {} );
218 m_root.path = std::move( path );
219 m_root.root = pObj;
220 if ( auto sc = preparePartitions(); !sc ) return sc;
222 }
223
226 StatusCode setRoot( std::string path, ADDRESS* pAddr ) override {
227 visit(
228 m_root.root,
229 []( auto* p ) {
230 if ( p ) p->release();
231 },
232 []( std::monostate ) {} );
233 m_root.path = std::move( path );
234 m_root.root = pAddr;
235 if ( !pAddr ) return StatusCode::FAILURE;
236 pAddr->addRef();
237 if ( auto sc = preparePartitions(); !sc ) return sc;
239 }
240
241 StatusCode setDataLoader( IConversionSvc* pDataLoader, IDataProviderSvc* dpsvc = nullptr ) override {
242 m_dataLoader = pDataLoader;
243 if ( m_dataLoader )
244 if ( auto sc = m_dataLoader->setDataProvider( dpsvc ? dpsvc : this ); !sc ) return sc;
245 for ( auto& i : m_partitions ) {
246 if ( auto sc = i.second.dataManager->setDataLoader( m_dataLoader.get() ); !sc ) return sc;
247 }
248 return StatusCode::SUCCESS;
249 }
250
251 StatusCode addPreLoadItem( const DataStoreItem& item ) override {
252 return fwd( [&]( IDataProviderSvc& svc ) { return svc.addPreLoadItem( item ); } );
253 }
254
256 return fwd( [&]( IDataProviderSvc& svc ) { return svc.removePreLoadItem( item ); } );
257 }
258
260 return fwd( [&]( IDataProviderSvc& svc ) { return svc.resetPreLoad(); } );
261 }
262
263 StatusCode preLoad() override {
264 return fwd( [&]( IDataProviderSvc& svc ) { return svc.preLoad(); } );
265 }
266
267 StatusCode registerObject( std::string_view parent, std::string_view obj, OBJECT* pObj ) override {
268 return fwd( [&]( IDataProviderSvc& svc ) { return svc.registerObject( parent, obj, pObj ); } );
269 }
270
271 StatusCode registerObject( OBJECT* parent, std::string_view obj, OBJECT* pObj ) override {
272 return fwd( [&]( IDataProviderSvc& svc ) { return svc.registerObject( parent, obj, pObj ); } );
273 }
274
275 StatusCode unregisterObject( std::string_view path ) override {
276 return fwd( [&]( IDataProviderSvc& svc ) { return svc.unregisterObject( path ); } );
277 }
278
280 return fwd( [&]( IDataProviderSvc& svc ) { return svc.unregisterObject( pObj ); } );
281 }
282
283 StatusCode unregisterObject( OBJECT* pObj, std::string_view path ) override {
284 return fwd( [&]( IDataProviderSvc& svc ) { return svc.unregisterObject( pObj, path ); } );
285 }
286
287 StatusCode retrieveObject( IRegistry* parent, std::string_view path, OBJECT*& pObj ) override {
288 return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( parent, path, pObj ); } );
289 }
290
291 StatusCode findObject( std::string_view path, OBJECT*& pObj ) override {
292 return fwd( [&]( IDataProviderSvc& svc ) { return svc.retrieveObject( path, pObj ); } );
293 }
294
295 StatusCode findObject( IRegistry* parent, std::string_view path, OBJECT*& pObj ) override {
296 return fwd( [&]( IDataProviderSvc& svc ) { return svc.findObject( parent, path, pObj ); } );
297 }
298
299 StatusCode linkObject( IRegistry* from, std::string_view objPath, OBJECT* to ) override {
300 return fwd( [&]( IDataProviderSvc& svc ) { return svc.linkObject( from, objPath, to ); } );
301 }
302
303 StatusCode linkObject( std::string_view fullPath, OBJECT* to ) override {
304 return fwd( [&]( IDataProviderSvc& svc ) { return svc.linkObject( fullPath, to ); } );
305 }
306
307 StatusCode unlinkObject( IRegistry* from, std::string_view objPath ) override {
308 return fwd( [&]( IDataProviderSvc& svc ) { return svc.unlinkObject( from, objPath ); } );
309 }
310
311 StatusCode unlinkObject( OBJECT* from, std::string_view objPath ) override {
312 return fwd( [&]( IDataProviderSvc& svc ) { return svc.unlinkObject( from, objPath ); } );
313 }
314
315 StatusCode unlinkObject( std::string_view path ) override {
316 return fwd( [&]( IDataProviderSvc& svc ) { return svc.unlinkObject( path ); } );
317 }
318
319 StatusCode updateObject( IRegistry* pDirectory ) override {
320 return fwd( [&]( IDataProviderSvc& svc ) { return svc.updateObject( pDirectory ); } );
321 }
322
323 StatusCode updateObject( OBJECT* pObj ) override {
324 return fwd( [&]( IDataProviderSvc& svc ) { return svc.updateObject( pObj ); } );
325 }
326
327 StatusCode create( CSTR& nam, CSTR& typ ) override {
328 IInterface* pPartition = nullptr;
329 return create( nam, typ, pPartition );
330 }
331
332 StatusCode create( CSTR& nam, CSTR& typ, IInterface*& pPartition ) override {
333 if ( get( nam, pPartition ).isSuccess() ) return IPartitionControl::Status::PARTITION_EXISTS;
335 auto isvc = serviceLocator()->service<IService>( typ );
336 if ( !isvc ) return IInterface::Status::NO_INTERFACE;
337 auto dataMgr = isvc.as<IDataManagerSvc>();
338 auto dataProv = isvc.as<IDataProviderSvc>();
339 if ( !dataMgr || !dataProv ) return IInterface::Status::NO_INTERFACE;
340 m_partitions.emplace( nam, Partition{ dataProv, dataMgr, nam } );
341 return StatusCode::SUCCESS;
342 }
343
345 StatusCode drop( CSTR& nam ) override {
346 auto i = m_partitions.find( nam );
348 if ( i->second.dataManager == m_current.dataManager ) { m_current = Partition(); }
349 i->second.dataManager->clearStore().ignore();
350 m_partitions.erase( i );
351 return StatusCode::SUCCESS;
352 }
353
355 StatusCode drop( IInterface* pPartition ) override {
356 auto provider = SmartIF<IDataProviderSvc>( pPartition );
357 if ( !provider ) return IInterface::Status::NO_INTERFACE;
358 auto i = std::find_if( std::begin( m_partitions ), std::end( m_partitions ),
359 [&]( Partitions::const_reference p ) { return p.second.dataProvider == provider; } );
361 i->second.dataManager->clearStore().ignore();
362 m_partitions.erase( i );
363 return StatusCode::SUCCESS;
364 }
365
367 StatusCode activate( CSTR& nam ) override {
368 auto i = m_partitions.find( nam );
369 if ( i != m_partitions.end() ) {
370 m_current = i->second;
371 return StatusCode::SUCCESS;
372 }
373 m_current = {};
375 }
376
378 StatusCode activate( IInterface* pPartition ) override {
379 auto provider = SmartIF<IDataProviderSvc>( pPartition );
380 m_current = Partition();
381 if ( !provider ) return IInterface::Status::NO_INTERFACE;
382 auto i = std::find_if( std::begin( m_partitions ), std::end( m_partitions ),
383 [&]( Partitions::const_reference p ) { return p.second.dataProvider == provider; } );
385 m_current = i->second;
386 return StatusCode::SUCCESS;
387 }
388
390 StatusCode get( CSTR& nam, IInterface*& pPartition ) const override {
391 auto i = m_partitions.find( nam );
392 if ( i != m_partitions.end() ) {
393 pPartition = i->second.dataProvider;
394 return StatusCode::SUCCESS;
395 }
396 pPartition = nullptr;
398 }
399
401 StatusCode activePartition( std::string& nam, IInterface*& pPartition ) const override {
402 if ( m_current.dataProvider ) {
403 nam = m_current.name;
404 pPartition = m_current.dataProvider;
405 return StatusCode::SUCCESS;
406 }
407 nam.clear();
408 pPartition = nullptr;
410 }
411
413 // Attach address creator facility
414 m_addrCreator = service( m_loader, true );
415 if ( !m_addrCreator ) {
416 error() << "Failed to retrieve data loader "
417 << "\"" << m_loader << "\"" << endmsg;
418 return StatusCode::FAILURE;
419 }
420 // Attach data loader facility
421 auto dataLoader = service<IConversionSvc>( m_loader, true );
422 if ( !dataLoader ) {
423 error() << "Failed to retrieve data loader "
424 << "\"" << m_loader << "\"" << endmsg;
425 return StatusCode::FAILURE;
426 }
427 auto sc = setDataLoader( dataLoader.get() );
428 if ( !sc.isSuccess() ) {
429 error() << "Failed to set data loader "
430 << "\"" << m_loader << "\"" << endmsg;
431 }
432 return sc;
433 }
434
436 m_addrCreator.reset();
437 m_dataLoader.reset();
438 return StatusCode::SUCCESS;
439 }
440
443 // Nothing to do: just call base class initialisation
445 if ( !sc.isSuccess() ) return sc;
446 sc = makePartitions();
447 if ( !sc.isSuccess() ) {
448 error() << "Failed to connect to all store partitions." << endmsg;
449 return sc;
450 }
451 return attachServices();
452 }
453
457 if ( !sc.isSuccess() ) {
458 error() << "Enable to reinitialize base class" << endmsg;
459 return sc;
460 }
461 sc = detachServices();
462 if ( !sc.isSuccess() ) {
463 error() << "Failed to detach necessary services." << endmsg;
464 return sc;
465 }
466 sc = attachServices();
467 if ( !sc.isSuccess() ) {
468 error() << "Failed to attach necessary services." << endmsg;
469 return sc;
470 }
471 sc = makePartitions();
472 if ( !sc.isSuccess() ) {
473 error() << "Failed to connect to store partitions." << endmsg;
474 return sc;
475 }
476 // return
477 return StatusCode::SUCCESS;
478 }
479
481 StatusCode finalize() override {
482 setDataLoader( nullptr ).ignore();
483 clearStore().ignore();
485 m_current = Partition();
487 return Service::finalize();
488 }
489
490 // protected:
491
493 using extends::extends;
494
496 ~MultiStoreSvc() override {
497 setDataLoader( nullptr ).ignore();
499 clearStore().ignore();
501 }
502
506 for ( auto& i : m_partitions ) {
507 StatusCode sc = visit(
508 m_root.root,
509 [&]( ADDRESS* address ) -> StatusCode {
510 if ( !address ) return StatusCode::FAILURE;
511 ADDRESS* pAdd = nullptr;
512 ADDRESS* p = address;
513 auto sc = m_addrCreator->createAddress( p->svcType(), p->clID(), p->par(), p->ipar(), pAdd );
514 return sc.isSuccess() ? i.second.dataManager->setRoot( m_root.path, pAdd ) : sc;
515 },
516 [&]( OBJECT* object ) -> StatusCode {
517 if ( object && object->clID() == CLID_DataObject ) {
518 return i.second.dataManager->setRoot( m_root.path, new DataObject() );
519 }
520 return StatusCode::FAILURE;
521 },
522 []( std::monostate ) -> StatusCode { return StatusCode::FAILURE; } );
523 if ( !sc.isSuccess() ) iret = sc;
524 }
525 return iret;
526 }
527
530 for ( auto& i : m_partitions ) i.second.dataManager->clearStore().ignore();
531 m_partitions.clear();
532 return StatusCode::SUCCESS;
533 }
534
538 std::string typ, nam;
539 clearPartitions().ignore();
540 for ( auto part : m_partitionDefs ) {
541 for ( auto attrib : Parser( std::move( part ) ) ) {
542 switch ( ::toupper( attrib.tag[0] ) ) {
543 case 'N':
544 nam = std::move( attrib.value );
545 break;
546 case 'T':
547 typ = std::move( attrib.value );
548 break;
549 }
550 }
551 StatusCode sc = create( nam, typ );
552 if ( !sc.isSuccess() ) return sc;
553 if ( m_defaultPartition.empty() ) m_defaultPartition = nam;
554 }
555 return StatusCode::SUCCESS;
556 }
557};
558
559// Instantiation of a static factory class used by clients to create
560// instances of this service
unsigned int CLID
Class ID definition.
Definition ClassID.h:16
void toupper(std::string &s)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition MsgStream.h:198
const std::string CSTR
DataObject OBJECT
IOpaqueAddress ADDRESS
IDataStoreAgent AGENT
#define DECLARE_COMPONENT(type)
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
A DataObject is the base class of any identifiable object on any data store.
Definition DataObject.h:37
Description of the DataStoreItem class.
Implementation of property with value of concrete type.
Definition PropertyFwd.h:27
Parse attribute strings allowing iteration over the various attributes.
Data provider interface definition.
virtual StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
virtual StatusCode linkObject(IRegistry *from, std::string_view objPath, DataObject *toObj)=0
Add a link to another object.
virtual StatusCode unregisterObject(std::string_view fullPath)=0
Unregister object from the data store.
virtual StatusCode updateObject(IRegistry *pDirectory)=0
Update object identified by its directory entry.
virtual StatusCode addPreLoadItem(const DataStoreItem &item)=0
Add an item to the preload list.
virtual StatusCode unlinkObject(IRegistry *from, std::string_view objPath)=0
Remove a link to another object.
virtual StatusCode removePreLoadItem(const DataStoreItem &item)=0
Remove an item from the preload list.
virtual StatusCode resetPreLoad()=0
Clear the preload list.
@ INVALID_ROOT
Invalid root path object cannot be retrieved or stored.
virtual StatusCode findObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Find object identified by its directory entry.
virtual StatusCode preLoad()=0
Load all preload items of the list.
StatusCode registerObject(std::string_view fullPath, DataObject *pObject)
Register object with the data store.
Generic data agent interface.
Definition of the basic interface.
Definition IInterface.h:225
@ NO_INTERFACE
Requested interface is not available.
Definition IInterface.h:313
Opaque address interface definition.
virtual unsigned long addRef()=0
Add reference to object.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition IRegistry.h:29
General service interface definition.
Definition IService.h:26
virtual SmartIF< IService > & service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.
Data service base class.
StatusCode drop(CSTR &nam) override
Drop a partition object. The name identifies the partition uniquely.
StatusCode traverseTree(AGENT *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects in the data store.
StatusCode objectLeaves(const OBJECT *pObject, std::vector< IRegistry * > &leaves) override
Explore the object store: retrieve all leaves attached to the object.
StatusCode get(CSTR &nam, IInterface *&pPartition) const override
Access a partition object. The name identifies the partition uniquely.
StatusCode attachServices()
StatusCode fwd(Fun f)
const std::string & rootName() const override
Name for root Event.
StatusCode updateObject(OBJECT *pObj) override
Update object.
StatusCode registerObject(std::string_view parent, std::string_view obj, OBJECT *pObj) override
Register object with the data store.
Gaudi::Property< std::string > m_defaultPartition
StatusCode unlinkObject(IRegistry *from, std::string_view objPath) override
Remove a link to another object.
SmartIF< IAddressCreator > m_addrCreator
Reference to address creator.
StatusCode drop(IInterface *pPartition) override
Drop a partition object. The name identifies the partition uniquely.
Gaudi::Property< PartitionDefs > m_partitionDefs
StatusCode create(CSTR &nam, CSTR &typ) override
Create a partition object. The name identifies the partition uniquely.
StatusCode removePreLoadItem(const DataStoreItem &item) override
Remove an item from the preload list.
StatusCode unregisterAddress(IRegistry *pParent, std::string_view path) override
IDataManagerSvc: Unregister object address from the data store.
StatusCode activePartition(std::string &nam, IInterface *&pPartition) const override
Access the active partition object.
StatusCode registerObject(OBJECT *parent, std::string_view obj, OBJECT *pObj) override
Register object with the data store.
StatusCode makePartitions()
Create all partitions according to job options.
CLID rootCLID() const override
IDataManagerSvc: Accessor for root event CLID.
StatusCode unregisterObject(OBJECT *pObj, std::string_view path) override
Unregister object from the data store.
struct MultiStoreSvc::tagROOT m_root
StatusCode findObject(std::string_view path, OBJECT *&pObj) override
Find object identified by its full path in the data store.
Gaudi::Property< std::string > m_loader
Partition m_current
Current partition.
StatusCode retrieveObject(IRegistry *parent, std::string_view path, OBJECT *&pObj) override
Retrieve object from data store.
StatusCode objectParent(const IRegistry *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object's parent.
StatusCode preLoad() override
load all preload items of the list
StatusCode unlinkObject(std::string_view path) override
Remove a link to another object.
StatusCode updateObject(IRegistry *pDirectory) override
Update object identified by its directory entry.
StatusCode traverseSubTree(OBJECT *pObject, AGENT *pAgent) override
IDataManagerSvc: Analyze by traversing all data objects below the sub tree.
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
StatusCode finalize() override
Service initialisation.
StatusCode setRoot(std::string path, ADDRESS *pAddr) override
Initialize data store for new event by giving new event path and address of root object.
StatusCode objectLeaves(const IRegistry *pObject, std::vector< IRegistry * > &leaves) override
Explore the object store: retrieve all leaves attached to the object.
StatusCode clearSubTree(OBJECT *pObject) override
Remove all data objects below the sub tree identified.
StatusCode objectParent(const OBJECT *pObject, IRegistry *&refpParent) override
IDataManagerSvc: Explore the object store: retrieve the object's parent.
StatusCode traverseSubTree(std::string_view path, AGENT *pAgent) override
Analyze by traversing all data objects below the sub tree.
StatusCode registerAddress(std::string_view path, ADDRESS *pAddr) override
IDataManagerSvc: Register object address with the data store.
StatusCode reinitialize() override
Service initialisation.
StatusCode findObject(IRegistry *parent, std::string_view path, OBJECT *&pObj) override
Find object identified by its full path in the data store.
~MultiStoreSvc() override
Standard Destructor.
StatusCode initialize() override
Service initialisation.
StatusCode unregisterObject(OBJECT *pObj) override
Unregister object from the data store.
StatusCode registerAddress(IRegistry *parent, std::string_view path, ADDRESS *pAddr) override
IDataManagerSvc: Register object address with the data store.
StatusCode detachServices()
SmartIF< IConversionSvc > m_dataLoader
Pointer to data loader service.
StatusCode setDataLoader(IConversionSvc *pDataLoader, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: Pass a default data loader to the service.
StatusCode resetPreLoad() override
Clear the preload list.
StatusCode unregisterObject(std::string_view path) override
Unregister object from the data store.
StatusCode setRoot(std::string path, OBJECT *pObj) override
Initialize data store for new event by giving new event path and root object.
StatusCode clearPartitions()
Clear all partitions.
StatusCode unlinkObject(OBJECT *from, std::string_view objPath) override
Remove a link to another object.
StatusCode unregisterAddress(std::string_view path) override
IDataManagerSvc: Unregister object address from the data store.
StatusCode linkObject(IRegistry *from, std::string_view objPath, OBJECT *to) override
Add a link to another object.
StatusCode preparePartitions()
Prepare partition for usage.
Partitions m_partitions
Datastore partitions.
StatusCode addPreLoadItem(const DataStoreItem &item) override
Add an item to the preload list.
StatusCode activate(CSTR &nam) override
Activate a partition object. The name identifies the partition uniquely.
StatusCode linkObject(std::string_view fullPath, OBJECT *to) override
Add a link to another object.
Gaudi::Property< CLID > m_rootCLID
StatusCode activate(IInterface *pPartition) override
Activate a partition object.
std::map< std::string, Partition > Partitions
Gaudi::Property< std::string > m_rootName
StatusCode clearSubTree(std::string_view path) override
Remove all data objects below the sub tree identified.
StatusCode create(CSTR &nam, CSTR &typ, IInterface *&pPartition) override
Create a partition object. The name identifies the partition uniquely.
std::vector< std::string > PartitionDefs
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition Service.cpp:336
StatusCode finalize() override
Definition Service.cpp:223
StatusCode reinitialize() override
Definition Service.cpp:296
SmartIF< IFace > service(const std::string &name, bool createIf=true) const
Definition Service.h:79
StatusCode initialize() override
Definition Service.cpp:118
Small smart pointer class with automatic reference counting for IInterface.
Definition SmartIF.h:28
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Definition StatusCode.h:139
bool isSuccess() const
Definition StatusCode.h:314
constexpr static const auto SUCCESS
Definition StatusCode.h:99
constexpr static const auto FAILURE
Definition StatusCode.h:100
Base class used to extend a class implementing other interfaces.
Definition extends.h:19
auto overload(lambda_ts &&... lambdas)
Definition compose.h:37
virtual StatusCode clearSubTree(std::string_view sub_path)=0
Remove all data objects below the sub tree identified by its full path name.
virtual StatusCode objectParent(const DataObject *pObject, IRegistry *&refpParent)=0
IDataManagerSvc: Explore the object store: retrieve the object's parent.
virtual StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &refLeaves)=0
Explore the object store: retrieve all leaves attached to the object The object is identified by its ...
virtual StatusCode 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.
virtual StatusCode registerAddress(std::string_view fullPath, IOpaqueAddress *pAddress)=0
Register object address with the data store.
virtual StatusCode unregisterAddress(std::string_view fullPath)=0
Unregister object address from the data store.
virtual StatusCode traverseTree(IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects in the data store.
Root type (address or object)
std::variant< std::monostate, ADDRESS *, OBJECT * > root