The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
RecordDataSvc Class Reference

A RecordDataSvc is the base class for event services. More...

#include </builds/gaudi/Gaudi/GaudiCommonSvc/src/DataSvc/RecordDataSvc.h>

Inheritance diagram for RecordDataSvc:
Collaboration diagram for RecordDataSvc:

Public Member Functions

StatusCode initialize () override
 Service initialisation.
 
StatusCode finalize () override
 Service finalization.
 
void handle (const Incident &incident) override
 IIncidentListener override: Inform that a new incident has occured.
 
 RecordDataSvc (const std::string &name, ISvcLocator *svc)
 Standard Constructor.
 
- Public Member Functions inherited from extends< DataSvc, IIncidentListener >
void const * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast.
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface.
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames.
 
- Public Member Functions inherited from DataSvc
CLID rootCLID () const override
 IDataManagerSvc: Accessor for root event CLID.
 
const std::string & rootName () const override
 IDataManagerSvc: Accessor for root event name.
 
StatusCode registerAddress (std::string_view fullPath, IOpaqueAddress *pAddress) override
 IDataManagerSvc: Register object address with the data store.
 
StatusCode registerAddress (IRegistry *parentObj, std::string_view objectPath, IOpaqueAddress *pAddress) override
 IDataManagerSvc: Register object address with the data store.
 
StatusCode unregisterAddress (std::string_view fullPath) override
 IDataManagerSvc: Unregister object address from the data store.
 
StatusCode unregisterAddress (IRegistry *pParent, std::string_view objPath) override
 IDataManagerSvc: Unregister object address from the data store.
 
StatusCode objectLeaves (const DataObject *pObject, std::vector< IRegistry * > &refLeaves) override
 IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object.
 
StatusCode objectLeaves (const IRegistry *pRegistry, std::vector< IRegistry * > &refLeaves) override
 IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object.
 
StatusCode objectParent (const DataObject *pObject, IRegistry *&refpParent) override
 IDataManagerSvc: Explore the object store: retrieve the object's parent.
 
StatusCode objectParent (const IRegistry *pRegistry, IRegistry *&refpParent) override
 IDataManagerSvc: Explore the object store: retrieve the object's parent.
 
StatusCode clearSubTree (std::string_view sub_tree_path) override
 IDataManagerSvc: Remove all data objects below the sub tree identified by its full path name.
 
StatusCode clearSubTree (DataObject *pObject) override
 IDataManagerSvc: Remove all data objects below the sub tree identified by the object.
 
StatusCode clearStore () override
 IDataManagerSvc: Remove all data objects in the data store.
 
StatusCode traverseSubTree (std::string_view sub_tree_path, IDataStoreAgent *pAgent) override
 IDataManagerSvc: Analyze by traversing all data objects below the sub tree identified by its full path name.
 
StatusCode traverseSubTree (DataObject *pObject, IDataStoreAgent *pAgent) override
 IDataManagerSvc: Analyze by traversing all data objects below the sub tree.
 
StatusCode traverseTree (IDataStoreAgent *pAgent) override
 IDataManagerSvc: Analyze by traversing all data objects in the data store.
 
StatusCode setRoot (std::string root_name, DataObject *pRootObj) override
 Initialize data store for new event by giving new event path and root object.
 
virtual StatusCode i_setRoot (std::string root_name, DataObject *pRootObj)
 Initialize data store for new event by giving new event path and root object.
 
StatusCode setRoot (std::string root_path, IOpaqueAddress *pRootAddr) override
 Initialize data store for new event by giving new event path and address of root object.
 
virtual StatusCode i_setRoot (std::string root_path, IOpaqueAddress *pRootAddr)
 Initialize data store for new event by giving new event path and address of root object.
 
StatusCode setDataLoader (IConversionSvc *svc, IDataProviderSvc *dpsvc=nullptr) override
 IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data provider.
 
StatusCode addPreLoadItem (const DataStoreItem &item) override
 Add an item to the preload list.
 
StatusCode removePreLoadItem (const DataStoreItem &item) override
 Remove an item from the preload list.
 
StatusCode resetPreLoad () override
 Clear the preload list.
 
virtual StatusCode preLoad (int depth, int load_depth, DataObject *pObject)
 Execute one level of preloading and recursively load until the final level is reached.
 
StatusCode preLoad () override
 load all preload items of the list
 
StatusCode registerObject (std::string_view parentPath, std::string_view objPath, DataObject *pObject) override
 Register object with the data store.
 
StatusCode registerObject (DataObject *parentObj, std::string_view objPath, DataObject *pObject) override
 Register object with the data store.
 
StatusCode unregisterObject (std::string_view fullPath) override
 Unregister object from the data store.
 
StatusCode unregisterObject (DataObject *pObject) override
 Unregister object from the data store.
 
StatusCode unregisterObject (DataObject *pObject, std::string_view objectPath) override
 Unregister object from the data store.
 
StatusCode retrieveObject (IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
 Retrieve object from data store.
 
StatusCode findObject (std::string_view fullPath, DataObject *&pObject) override
 Find object identified by its full path in the data store.
 
StatusCode findObject (IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
 Find object identified by its full path in the data store.
 
StatusCode linkObject (IRegistry *from, std::string_view objPath, DataObject *to) override
 Add a link to another object.
 
StatusCode linkObject (std::string_view fullPath, DataObject *to) override
 Add a link to another object.
 
StatusCode unlinkObject (IRegistry *from, std::string_view objPath) override
 Remove a link to another object.
 
StatusCode unlinkObject (DataObject *fromObj, std::string_view objPath) override
 Remove a link to another object.
 
StatusCode unlinkObject (std::string_view fullPath) override
 Remove a link to another object.
 
StatusCode updateObject (IRegistry *pDirectory) override
 Update object identified by its directory entry.
 
StatusCode updateObject (DataObject *toUpdate) override
 Update object.
 
StatusCode initialize () override
 Service initialization.
 
StatusCode reinitialize () override
 Service initialization.
 
StatusCode finalize () override
 Service initialization.
 
 DataSvc (const DataSvc &)=delete
 copy constructor disabled
 
DataSvcoperator= (const DataSvc &)=delete
 Fake assignment operator (never implemented).
 
StatusCode registerAddress (DataObject *parentObj, std::string_view objectPath, IOpaqueAddress *pAddress)
 Register object address with the data store.
 
StatusCode unregisterAddress (DataObject *pParent, std::string_view objPath)
 Unregister object address from the data store.
 
StatusCode registerObject (std::string_view fullPath, DataObject *pObject)
 Register object with the data store.
 
StatusCode registerObject (std::string_view parentPath, int item, DataObject *pObject)
 Register object with the data store.
 
StatusCode registerObject (DataObject *parentObj, int item, DataObject *pObject)
 Register object with the data store.
 
StatusCode retrieveObject (std::string_view fullPath, DataObject *&pObject)
 Retrieve object identified by its full path from the data store.
 
StatusCode retrieveObject (std::string_view parentPath, std::string_view objectPath, DataObject *&pObject)
 Retrieve object from data store.
 
StatusCode retrieveObject (std::string_view parentPath, int item, DataObject *&pObject)
 Retrieve object from data store.
 
StatusCode retrieveObject (DataObject *parentObj, std::string_view objectPath, DataObject *&pObject)
 Retrieve object from data store.
 
StatusCode retrieveObject (DataObject *parentObj, int item, DataObject *&pObject)
 Retrieve object from data store.
 
StatusCode findObject (std::string_view parentPath, std::string_view objectPath, DataObject *&pObject)
 Find object identified by its parent object and the path to the object relative to the parent.
 
StatusCode findObject (std::string_view parentPath, int item, DataObject *&pObject)
 Find object identified by its parent object and an integer identifier in the data store.
 
StatusCode findObject (DataObject *parentObj, std::string_view objectPath, DataObject *&pObject)
 Find object identified by its parent object and the path to the object relative to the parent.
 
StatusCode findObject (DataObject *parentObj, int item, DataObject *&pObject)
 Find object identified by its parent object and an integer identifier in the data store.
 
StatusCode linkObject (std::string_view fromPath, std::string_view objPath, DataObject *toObj)
 Add a link to another object.
 
StatusCode linkObject (DataObject *fromObj, std::string_view objPath, DataObject *toObj)
 Add a link to another object.
 
StatusCode unlinkObject (std::string_view fromPath, std::string_view objPath)
 Remove a link to another object.
 
- Public Member Functions inherited from extends< Service, IDataProviderSvc, IDataManagerSvc >
void const * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast.
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface.
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames.
 
- Public Member Functions inherited from Service
const std::string & name () const override
 Retrieve name of the service.
 
StatusCode configure () override
 
StatusCode initialize () override
 
StatusCode start () override
 
StatusCode stop () override
 
StatusCode finalize () override
 
StatusCode terminate () override
 
Gaudi::StateMachine::State FSMState () const override
 
Gaudi::StateMachine::State targetFSMState () const override
 
StatusCode reinitialize () override
 
StatusCode restart () override
 
StatusCode sysInitialize () override
 Initialize Service.
 
StatusCode sysStart () override
 Initialize Service.
 
StatusCode sysStop () override
 Initialize Service.
 
StatusCode sysFinalize () override
 Finalize Service.
 
StatusCode sysReinitialize () override
 Re-initialize the Service.
 
StatusCode sysRestart () override
 Re-initialize the Service.
 
 Service (std::string name, ISvcLocator *svcloc)
 Standard Constructor.
 
SmartIF< ISvcLocator > & serviceLocator () const override
 Retrieve pointer to service locator.
 
template<typename IFace = IService>
SmartIF< IFace > service (const std::string &name, bool createIf=true) const
 
template<class T>
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none")
 
template<class T>
StatusCode declareTool (ToolHandle< T > &handle, bool createIf=true)
 
template<class T>
StatusCode declareTool (ToolHandle< T > &handle, const std::string &toolTypeAndName, bool createIf=true)
 Declare used tool.
 
template<class T>
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandleArray< T > &hndlArr, const std::string &doc="none")
 
template<class T>
void addToolsArray (ToolHandleArray< T > &hndlArr)
 
const std::vector< IAlgTool * > & tools () const
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked.
 
- Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
StatusCode setProperty (const Gaudi::Details::PropertyBase &p)
 Set the property from a property.
 
StatusCode setProperty (const std::string &name, const char *v)
 Special case for string literals.
 
StatusCode setProperty (const std::string &name, const std::string &v)
 Special case for std::string.
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value
 
 PropertyHolder ()=default
 
Gaudi::Details::PropertyBasedeclareProperty (Gaudi::Details::PropertyBase &prop)
 Declare a property.
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
 Helper to wrap a regular data member and use it as a regular property.
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
 Declare a PropertyBase instance setting name and documentation.
 
Gaudi::Details::PropertyBasedeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
 Declare a remote property.
 
StatusCode setProperty (const std::string &name, const Gaudi::Details::PropertyBase &p) override
 set the property from another property with a different name
 
StatusCode setProperty (const std::string &s) override
 set the property from the formatted string
 
StatusCode setProperty (const Gaudi::Details::PropertyBase &p)
 Set the property from a property.
 
StatusCode setProperty (const std::string &name, const char *v)
 Special case for string literals.
 
StatusCode setProperty (const std::string &name, const std::string &v)
 Special case for std::string.
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value
 
StatusCode setPropertyRepr (const std::string &n, const std::string &r) override
 set the property from name and value string representation
 
StatusCode getProperty (Gaudi::Details::PropertyBase *p) const override
 get the property
 
const Gaudi::Details::PropertyBasegetProperty (std::string_view name) const override
 get the property by name
 
StatusCode getProperty (std::string_view n, std::string &v) const override
 convert the property to the string
 
const std::vector< Gaudi::Details::PropertyBase * > & getProperties () const override
 get all properties
 
bool hasProperty (std::string_view name) const override
 Return true if we have a property with the given name.
 
Gaudi::Details::PropertyBaseproperty (std::string_view name) const
 \fixme property and bindPropertiesTo should be protected
 
void bindPropertiesTo (Gaudi::Interfaces::IOptionsSvc &optsSvc)
 
 PropertyHolder (const PropertyHolder &)=delete
 
PropertyHolderoperator= (const PropertyHolder &)=delete
 
- Public Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level msgLevel () const
 get the cached level (originally extracted from the embedded MsgStream)
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream
 
- Public Member Functions inherited from CommonMessagingBase
virtual ~CommonMessagingBase ()=default
 Virtual destructor.
 
const SmartIF< IMessageSvc > & msgSvc () const
 The standard message service.
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream.
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts.
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS)
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL)
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR)
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR)
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING)
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO)
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG)
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE)
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO)
 

Protected Member Functions

void registerRecord (const std::string &data, IOpaqueAddress *pAddr)
 Load new record into the data store if necessary.
 
void loadRecords (IRegistry *pReg)
 Load dependent records into memory.
 
- Protected Member Functions inherited from DataSvc
bool checkRoot ()
 Check if root path is valid.
 
virtual IConversionSvcgetDataLoader (IRegistry *pReg)
 Retrieve customizable data loader according to registry entry to be retrieved.
 
virtual DataObjectcreateDefaultObject () const
 Create default objects in case forced creation of leaves is requested.
 
virtual StatusCode loadObject (IRegistry *pNode)
 Invoke Persistency service to create transient object from its persistent representation.
 
virtual StatusCode loadObject (IConversionSvc *pLoader, IRegistry *pNode)
 Invoke Persistency service to create transient object from its persistent representation.
 
StatusCode retrieveEntry (DataSvcHelpers::RegistryEntry *pNode, std::string_view path, DataSvcHelpers::RegistryEntry *&pEntry)
 Retrieve registry entry from store.
 
DataObjecthandleDataFault (IRegistry *pReg, std::string_view path="")
 Invoke data fault handling if enabled.
 
- Protected Member Functions inherited from Service
std::vector< IAlgTool * > & tools ()
 
 ~Service () override
 
int outputLevel () const
 get the Service's output level
 
- Protected Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level setUpMessaging () const
 Set up local caches.
 
MSG::Level resetMessaging ()
 Reinitialize internal states.
 
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream.
 

Protected Attributes

Gaudi::Property< bool > m_autoLoad { this, "AutoLoad", true, "autoload of records" }
 
Gaudi::Property< std::string > m_incidentName
 
Gaudi::Property< std::string > m_saveIncidentName { this, "SaveIncident", "SAVE_RECORD", "name of the 'save' incident" }
 
Gaudi::Property< std::string > m_persSvcName
 
std::vector< std::string > m_incidents
 Pending new file incidents.
 
SmartIF< IConversionSvcm_cnvSvc
 Reference to the main data conversion service.
 
- Protected Attributes inherited from DataSvc
SmartIF< IIncidentSvcm_incidentSvc = nullptr
 Pointer to incident service.
 
Gaudi::Property< CLIDm_rootCLID { this, "RootCLID", 110 , "CLID of root entry" }
 
Gaudi::Property< std::string > m_rootName { this, "RootName", "/Event", "name of root entry" }
 
std::unique_ptr< DataSvcHelpers::RegistryEntrym_root
 Pointer to root entry.
 
- Protected Attributes inherited from Service
Gaudi::StateMachine::State m_state = Gaudi::StateMachine::OFFLINE
 Service state.
 
Gaudi::StateMachine::State m_targetState = Gaudi::StateMachine::OFFLINE
 Service state.
 
Gaudi::Property< int > m_outputLevel { this, "OutputLevel", MSG::NIL, "output level" }
 flag indicating whether ToolHandle tools have been added to m_tools
 
Gaudi::Property< bool > m_auditorInitialize { this, "AuditInitialize", false, "trigger auditor on initialize()" }
 
Gaudi::Property< bool > m_auditorStart { this, "AuditStart", false, "trigger auditor on start()" }
 
Gaudi::Property< bool > m_auditorStop { this, "AuditStop", false, "trigger auditor on stop()" }
 
Gaudi::Property< bool > m_auditorFinalize { this, "AuditFinalize", false, "trigger auditor on finalize()" }
 
Gaudi::Property< bool > m_auditorReinitialize { this, "AuditReinitialize", false, "trigger auditor on reinitialize()" }
 
Gaudi::Property< bool > m_auditorRestart { this, "AuditRestart", false, "trigger auditor on restart()" }
 
Gaudi::Property< bool > m_autoRetrieveTools
 
Gaudi::Property< bool > m_checkToolDeps
 
SmartIF< IAuditorSvcm_pAuditorSvc
 Auditor Service.
 

Additional Inherited Members

- Public Types inherited from extends< DataSvc, IIncidentListener >
using base_class
 Typedef to this class.
 
using extend_interfaces_base
 Typedef to the base of this class.
 
- Public Types inherited from extends< Service, IDataProviderSvc, IDataManagerSvc >
using base_class
 Typedef to this class.
 
using extend_interfaces_base
 Typedef to the base of this class.
 
- Public Types inherited from Service
using Factory = Gaudi::PluginService::Factory<IService*( const std::string&, ISvcLocator* )>
 
- Public Types inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
using PropertyHolderImpl
 Typedef used to refer to this class from derived classes, as in.
 
- Public Types inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
using base_class
 
- Public Types inherited from extend_interfaces< Interfaces... >
using ext_iids
 take union of the ext_iids of all Interfaces...
 

Detailed Description

A RecordDataSvc is the base class for event services.

When a new datafile is opened the data service retrieves an incident from the persistency area (currently only from POOL) together with an opaque address describing the record. These history records are put onto the run-records datastore under the name of the logical file (FID): /Records/<FID>/.....

Hence, each history records can be addresses the same way: /Record/<FID> (/EOR)

Author
M.Frank
Version
1.0

Definition at line 33 of file RecordDataSvc.h.

Constructor & Destructor Documentation

◆ RecordDataSvc()

RecordDataSvc::RecordDataSvc ( const std::string & name,
ISvcLocator * svc )

Standard Constructor.

Definition at line 157 of file RecordDataSvc.cpp.

157 : base_class( name, svc ) {
158 m_rootName = "/Records";
159}
Gaudi::Property< std::string > m_rootName
Definition DataSvc.h:53
const std::string & name() const override
Retrieve name of the service.
Definition Service.cpp:333

Member Function Documentation

◆ finalize()

StatusCode RecordDataSvc::finalize ( )
override

Service finalization.

Definition at line 92 of file RecordDataSvc.cpp.

92 {
93 if ( m_incidentSvc ) m_incidentSvc->removeListener( this );
94 m_cnvSvc.reset();
97}
StatusCode finalize() override
Service initialization.
Definition DataSvc.cpp:828
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to incident service.
Definition DataSvc.h:50
SmartIF< IConversionSvc > m_cnvSvc
Reference to the main data conversion service.
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Definition StatusCode.h:139
constexpr static const auto SUCCESS
Definition StatusCode.h:99

◆ handle()

void RecordDataSvc::handle ( const Incident & incident)
override

IIncidentListener override: Inform that a new incident has occured.

Inform that a new incident has occured.

Definition at line 100 of file RecordDataSvc.cpp.

100 {
101 if ( incident.type() == "FILE_OPEN_READ" ) {
102 typedef ContextIncident<IOpaqueAddress*> Ctxt;
103 auto inc = dynamic_cast<const Ctxt*>( &incident );
104 if ( !inc ) {
105 always() << "Received invalid incident of type:" << incident.type() << endmsg;
106 } else {
107 registerRecord( inc->source(), inc->tag() );
108 if ( !m_incidentName.empty() ) {
109 auto incidents = m_incidents;
110 m_incidents.clear();
111 for ( const auto& i : incidents ) m_incidentSvc->fireIncident( Incident{ i, m_incidentName } );
112 }
113 }
114 } else if ( m_saveIncidentName == incident.type() ) {
115 always() << "Saving records not implemented." << endmsg;
116 }
117}
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition MsgStream.h:198
MsgStream & always() const
shortcut for the method msgStream(MSG::ALWAYS)
const std::string & type() const
Access to the incident type.
Definition Incident.h:43
Gaudi::Property< std::string > m_incidentName
std::vector< std::string > m_incidents
Pending new file incidents.
void registerRecord(const std::string &data, IOpaqueAddress *pAddr)
Load new record into the data store if necessary.
Gaudi::Property< std::string > m_saveIncidentName

◆ initialize()

StatusCode RecordDataSvc::initialize ( )
override

Service initialisation.

We need to subscribe to 2 incident: 1) FILE_OPEN_READ: fired by conversion service on open file 2) IncidentType::BeginEvent fired by event loop BEFORE the event processing starts. Do everything to bootstract access to the old event record.

Definition at line 48 of file RecordDataSvc.cpp.

48 {
49 // Nothing to do: just call base class initialisation
50 StatusCode sc = DataSvc::initialize();
51
52 if ( !sc.isSuccess() ) { // Base class failure
53 return sc;
54 }
55 // Attach data loader facility
57 if ( !m_cnvSvc ) {
58 error() << "Failed to access RecordPersistencySvc." << endmsg;
60 }
61 auto prp = m_cnvSvc.as<IProperty>();
62 if ( prp ) {
63 // prp->setProperty();
64 }
65 sc = setDataLoader( m_cnvSvc.get() );
66 if ( !sc.isSuccess() ) {
67 error() << "Failed to attach dataloader RecordPersistencySvc." << endmsg;
68 return sc;
69 }
70
71 sc = setRoot( m_rootName, new DataObject() );
72 if ( !sc.isSuccess() ) {
73 warning() << "Error declaring Record root DataObject" << endmsg;
74 return sc;
75 }
76
77 if ( !m_incidentSvc ) {
78 fatal() << "IncidentSvc is invalid--base class failed." << endmsg;
79 return sc;
80 }
81
86 m_incidentSvc->addListener( this, "FILE_OPEN_READ" );
87 m_incidentSvc->addListener( this, m_saveIncidentName );
88 return sc;
89}
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
StatusCode setRoot(std::string root_name, DataObject *pRootObj) override
Initialize data store for new event by giving new event path and root object.
Definition DataSvc.cpp:115
StatusCode setDataLoader(IConversionSvc *svc, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data pro...
Definition DataSvc.cpp:160
StatusCode initialize() override
Service initialization.
Definition DataSvc.cpp:795
Gaudi::Property< std::string > m_persSvcName
SmartIF< IFace > service(const std::string &name, bool createIf=true) const
Definition Service.h:79
bool isSuccess() const
Definition StatusCode.h:314
constexpr static const auto FAILURE
Definition StatusCode.h:100

◆ loadRecords()

void RecordDataSvc::loadRecords ( IRegistry * pReg)
protected

Load dependent records into memory.

Definition at line 120 of file RecordDataSvc.cpp.

120 {
121 if ( !pObj ) {
122 error() << "Failed to load records object" << endmsg;
123 } else {
124 vector<IRegistry*> leaves;
125 DataObject* p = nullptr;
126 const string& id0 = pObj->identifier();
127 StatusCode sc = retrieveObject( id0, p );
128 if ( sc.isSuccess() ) {
129 debug() << "Loaded records object: " << id0 << endmsg;
130 sc = objectLeaves( pObj, leaves );
131 if ( sc.isSuccess() ) {
132 for ( const auto& i : leaves ) loadRecords( i );
133 }
134 }
135 }
136}
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
StatusCode objectLeaves(const DataObject *pObject, std::vector< IRegistry * > &refLeaves) override
IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object.
Definition DataSvc.cpp:181
StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject) override
Retrieve object from data store.
Definition DataSvc.cpp:601
void loadRecords(IRegistry *pReg)
Load dependent records into memory.

◆ registerRecord()

void RecordDataSvc::registerRecord ( const std::string & data,
IOpaqueAddress * pAddr )
protected

Load new record into the data store if necessary.

Load new run record into the data store if necessary.

Definition at line 139 of file RecordDataSvc.cpp.

139 {
140 if ( !data.empty() && pAddr ) {
141 string fid = data;
142 debug() << "Request to load record for file " << fid << endmsg;
143 StatusCode sc = registerAddress( m_root.get(), fid, pAddr );
144 if ( !sc.isSuccess() ) {
145 warning() << "Failed to register record for:" << fid << endmsg;
146 pAddr->release();
147 return;
148 }
149 if ( m_autoLoad ) { loadRecords( pAddr->registry() ); }
150 m_incidents.push_back( pAddr->registry()->identifier() );
151 } else if ( !data.empty() && !pAddr ) {
152 info() << "Failed to register record for:" << data << " [Invalid Address]" << endmsg;
153 }
154}
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
StatusCode registerAddress(std::string_view fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
Definition DataSvc.cpp:198
std::unique_ptr< DataSvcHelpers::RegistryEntry > m_root
Pointer to root entry.
Definition DataSvc.h:73
virtual unsigned long release()=0
release reference to object
virtual IRegistry * registry() const =0
Update branch name.
virtual const id_type & identifier() const =0
Full identifier (or key)
Gaudi::Property< bool > m_autoLoad

Member Data Documentation

◆ m_autoLoad

Gaudi::Property<bool> RecordDataSvc::m_autoLoad { this, "AutoLoad", true, "autoload of records" }
protected

Definition at line 52 of file RecordDataSvc.h.

52{ this, "AutoLoad", true, "autoload of records" };

◆ m_cnvSvc

SmartIF<IConversionSvc> RecordDataSvc::m_cnvSvc
protected

Reference to the main data conversion service.

Definition at line 62 of file RecordDataSvc.h.

◆ m_incidentName

Gaudi::Property<std::string> RecordDataSvc::m_incidentName
protected
Initial value:
{ this, "IncidentName", "",
"name of incident to be fired if new record arrives" }

Definition at line 53 of file RecordDataSvc.h.

53 { this, "IncidentName", "",
54 "name of incident to be fired if new record arrives" };

◆ m_incidents

std::vector<std::string> RecordDataSvc::m_incidents
protected

Pending new file incidents.

Definition at line 60 of file RecordDataSvc.h.

◆ m_persSvcName

Gaudi::Property<std::string> RecordDataSvc::m_persSvcName
protected
Initial value:
{ this, "PersistencySvc", "PersistencySvc/RecordPersistencySvc",
"name of the persistency service" }

Definition at line 56 of file RecordDataSvc.h.

56 { this, "PersistencySvc", "PersistencySvc/RecordPersistencySvc",
57 "name of the persistency service" };

◆ m_saveIncidentName

Gaudi::Property<std::string> RecordDataSvc::m_saveIncidentName { this, "SaveIncident", "SAVE_RECORD", "name of the 'save' incident" }
protected

Definition at line 55 of file RecordDataSvc.h.

55{ this, "SaveIncident", "SAVE_RECORD", "name of the 'save' incident" };

The documentation for this class was generated from the following files: