| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

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

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
RecordDataSvc Class Reference

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

`#include <RecordDataSvc.h>`

Inheritance diagram for RecordDataSvc:
[legend]
Collaboration diagram for RecordDataSvc:
[legend]

## Public Member Functions
virtual StatusCode | initialize ()
| Service initialisation.
virtual StatusCode | reinitialize ()
| Service reinitialisation.
virtual StatusCode | finalize ()
| Service finalization.
virtual void | handle (const Incident &incident)
| IIncidentListener override: Inform that a new incident has occured.
| RecordDataSvc (const std::string &name, ISvcLocator *svc)
| Standard Constructor.
virtual | ~RecordDataSvc ()
| Standard Destructor.
Public Member Functions inherited from extends1< DataSvc, IIncidentListener >
| extends1 (A1 a1, A2 a2, A3 a3)
| Templated constructor with 3 arguments.
| extends1 (A1 a1, A2 a2)
| Templated constructor with 2 arguments.
| extends1 (A1 a1)
| Templated constructor with 1 argument.
| extends1 ()
| Default constructor.
virtual void * | i_cast (const InterfaceID &tid) const
| Implementation of IInterface::i_cast.
virtual StatusCode | queryInterface (const InterfaceID &ti, void **pp)
| Implementation of IInterface::queryInterface.
virtual std::vector< std::string > | getInterfaceNames () const
| Implementation of IInterface::getInterfaceNames.
virtual | ~extends1 ()
| Virtual destructor.
Public Member Functions inherited from DataSvc
virtual CLID | rootCLID () const
| IDataManagerSvc: Accessor for root event CLID.
virtual std::string | rootName () const
| IDataManagerSvc: Accessor for root event name.
virtual StatusCode | registerAddress (const std::string &fullPath, IOpaqueAddress *pAddress)
| IDataManagerSvc: Register object address with the data store.
virtual StatusCode | registerAddress (DataObject *parentObj, const std::string &objectPath, IOpaqueAddress *pAddress)
| IDataManagerSvc: Register object address with the data store.
virtual StatusCode | registerAddress (IRegistry *parentObj, const std::string &objectPath, IOpaqueAddress *pAddress)
| IDataManagerSvc: Register object address with the data store.
virtual StatusCode | unregisterAddress (const std::string &fullPath)
| IDataManagerSvc: Unregister object address from the data store.
virtual StatusCode | unregisterAddress (DataObject *pParent, const std::string &objPath)
| IDataManagerSvc: Unregister object address from the data store.
virtual StatusCode | unregisterAddress (IRegistry *pParent, const std::string &objPath)
| IDataManagerSvc: Unregister object address from the data store.
virtual StatusCode | objectLeaves (const DataObject *pObject, std::vector< IRegistry * > &refLeaves)
| IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object.
virtual StatusCode | objectLeaves (const IRegistry *pRegistry, std::vector< IRegistry * > &refLeaves)
| IDataManagerSvc: Explore the object store: retrieve all leaves attached to the object.
virtual StatusCode | objectParent (const DataObject *pObject, IRegistry *&refpParent)
| IDataManagerSvc: Explore the object store: retrieve the object's parent.
virtual StatusCode | objectParent (const IRegistry *pRegistry, IRegistry *&refpParent)
| IDataManagerSvc: Explore the object store: retrieve the object's parent.
virtual StatusCode | clearSubTree (const std::string &sub_tree_path)
| IDataManagerSvc: Remove all data objects below the sub tree identified by its full path name.
virtual StatusCode | clearSubTree (DataObject *pObject)
| IDataManagerSvc: Remove all data objects below the sub tree identified by the object.
virtual StatusCode | clearStore ()
| IDataManagerSvc: Remove all data objects in the data store.
virtual StatusCode | traverseSubTree (const std::string &sub_tree_path, IDataStoreAgent *pAgent)
| IDataManagerSvc: Analyze by traversing all data objects below the sub tree identified by its full path name.
virtual StatusCode | traverseSubTree (DataObject *pObject, IDataStoreAgent *pAgent)
| IDataManagerSvc: Analyze by traversing all data objects below the sub tree.
virtual StatusCode | traverseTree (IDataStoreAgent *pAgent)
| IDataManagerSvc: Analyze by traversing all data objects in the data store.
virtual StatusCode | setRoot (const std::string &root_name, DataObject *pRootObj)
| Initialize data store for new event by giving new event path and root object.
virtual StatusCode | i_setRoot (const std::string &root_name, DataObject *pRootObj)
| Initialize data store for new event by giving new event path and root object.
virtual StatusCode | setRoot (const std::string &root_path, IOpaqueAddress *pRootAddr)
| Initialize data store for new event by giving new event path and address of root object.
virtual StatusCode | i_setRoot (const std::string &root_path, IOpaqueAddress *pRootAddr)
| Initialize data store for new event by giving new event path and address of root object.
virtual StatusCode | setDataLoader (IConversionSvc *svc)
| IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service.
virtual StatusCode | addPreLoadItem (const DataStoreItem &item)
| Add an item to the preload list.
virtual StatusCode | addPreLoadItem (const std::string &itemPath)
| Add an item to the preload list.
virtual StatusCode | removePreLoadItem (const DataStoreItem &item)
| Remove an item from the preload list.
virtual StatusCode | removePreLoadItem (const std::string &itemPath)
| Add an item to the preload list.
virtual StatusCode | resetPreLoad ()
| 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.
virtual StatusCode | preLoad ()
| load all preload items of the list
virtual StatusCode | registerObject (const std::string &fullPath, DataObject *pObject)
| Register object with the data store.
virtual StatusCode | registerObject (const std::string &parentPath, const std::string &objPath, DataObject *pObject)
| Register object with the data store.
virtual StatusCode | registerObject (const std::string &parentPath, int item, DataObject *pObject)
| Register object with the data store.
virtual StatusCode | registerObject (DataObject *parentObj, const std::string &objPath, DataObject *pObject)
| Register object with the data store.
virtual StatusCode | registerObject (DataObject *parentObj, int item, DataObject *pObject)
| Register object with the data store.
virtual StatusCode | unregisterObject (const std::string &fullPath)
| Unregister object from the data store.
virtual StatusCode | unregisterObject (const std::string &parentPath, const std::string &objectPath)
| Unregister object from the data store.
virtual StatusCode | unregisterObject (const std::string &parentPath, int item)
| Unregister object from the data store.
virtual StatusCode | unregisterObject (DataObject *pObject)
| Unregister object from the data store.
virtual StatusCode | unregisterObject (DataObject *pObject, const std::string &objectPath)
| Unregister object from the data store.
virtual StatusCode | unregisterObject (DataObject *pObject, int item)
| Unregister object from the data store.
virtual StatusCode | retrieveObject (IRegistry *pDirectory, const std::string &path, DataObject *&pObject)
| Retrieve object from data store.
virtual StatusCode | retrieveObject (const std::string &fullPath, DataObject *&pObject)
| Retrieve object identified by its full path from the data store.
virtual StatusCode | retrieveObject (const std::string &parentPath, const std::string &objPath, DataObject *&pObject)
| Retrieve object from data store.
virtual StatusCode | retrieveObject (const std::string &parentPath, int item, DataObject *&pObject)
| Retrieve object from data store.
virtual StatusCode | retrieveObject (DataObject *parentObj, const std::string &objPath, DataObject *&pObject)
| Retrieve object from data store.
virtual StatusCode | retrieveObject (DataObject *parentObj, int item, DataObject *&pObject)
| Retrieve object from data store.
virtual StatusCode | findObject (const std::string &fullPath, DataObject *&pObject)
| Find object identified by its full path in the data store.
virtual StatusCode | findObject (IRegistry *pDirectory, const std::string &path, DataObject *&pObject)
| Find object identified by its full path in the data store.
virtual StatusCode | findObject (const std::string &parentPath, const std::string &objPath, DataObject *&pObject)
| Find object in the data store.
virtual StatusCode | findObject (const std::string &parentPath, int item, DataObject *&pObject)
| Find object in the data store.
virtual StatusCode | findObject (DataObject *parentObj, const std::string &objPath, DataObject *&pObject)
| Find object in the data store.
virtual StatusCode | findObject (DataObject *parentObj, int item, DataObject *&pObject)
| Find object in the data store.
virtual StatusCode | linkObject (IRegistry *from, const std::string &objPath, DataObject *to)
| Add a link to another object.
virtual StatusCode | linkObject (const std::string &fromPath, const std::string &objPath, DataObject *to)
| Add a link to another object.
virtual StatusCode | linkObject (DataObject *from, const std::string &objPath, DataObject *to)
| Add a link to another object.
virtual StatusCode | linkObject (const std::string &fullPath, DataObject *to)
| Add a link to another object.
virtual StatusCode | unlinkObject (IRegistry *from, const std::string &objPath)
| Remove a link to another object.
virtual StatusCode | unlinkObject (const std::string &fromPath, const std::string &objPath)
| Remove a link to another object.
virtual StatusCode | unlinkObject (DataObject *fromObj, const std::string &objPath)
| Remove a link to another object.
virtual StatusCode | unlinkObject (const std::string &fullPath)
| Remove a link to another object.
virtual StatusCode | updateObject (IRegistry *pDirectory)
| Update object identified by its directory entry.
virtual StatusCode | updateObject (const std::string &updatePath)
| Update object.
virtual StatusCode | updateObject (DataObject *toUpdate)
| Update object.
virtual StatusCode | updateObject (const std::string &parentPath, const std::string &updatePath)
| Update object.
virtual StatusCode | updateObject (DataObject *pParent, const std::string &updatePath)
| Update object.
| DataSvc (const std::string &name, ISvcLocator *svc)
| Standard Constructor.
virtual | ~DataSvc ()
| Standard Destructor.
Public Member Functions inherited from extends2< Service, IDataProviderSvc, IDataManagerSvc >
| extends2 (A1 a1, A2 a2, A3 a3)
| Templated constructor with 3 arguments.
| extends2 (A1 a1, A2 a2)
| Templated constructor with 2 arguments.
| extends2 (A1 a1)
| Templated constructor with 1 argument.
| extends2 ()
| Default constructor.
virtual | ~extends2 ()
| Virtual destructor.
Public Member Functions inherited from Service
virtual unsigned long | release ()
| Release Interface instance.
virtual const std::string & | name () const
| Retrieve name of the service.
virtual StatusCode | configure ()
virtual StatusCode | start ()
virtual StatusCode | stop ()
virtual StatusCode | terminate ()
virtual Gaudi::StateMachine::State | FSMState () const
virtual Gaudi::StateMachine::State | targetFSMState () const
virtual StatusCode | restart ()
virtual StatusCode | sysInitialize ()
| Initialize Service.
virtual StatusCode | sysStart ()
| Initialize Service.
virtual StatusCode | sysStop ()
| Initialize Service.
virtual StatusCode | sysFinalize ()
| Finalize Service.
virtual StatusCode | sysReinitialize ()
| Re-initialize the Service.
virtual StatusCode | sysRestart ()
| Re-initialize the Service.
virtual StatusCode | setProperty (const Property &p)
virtual StatusCode | setProperty (const std::string &s)
virtual StatusCode | setProperty (const std::string &n, const std::string &v)
virtual StatusCode | getProperty (Property *p) const
virtual const Property & | getProperty (const std::string &name) const
virtual StatusCode | getProperty (const std::string &n, std::string &v) const
virtual const std::vector < Property * > & | getProperties () const
template<class TYPE >
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value
| Service (const std::string &name, ISvcLocator *svcloc)
| Standard Constructor.
SmartIF< ISvcLocator > & | serviceLocator () const
| Retrieve pointer to service locator.
StatusCode | setProperties ()
| Method for setting declared properties to the values specified for the job.
template<class T >
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.
template<class T >
StatusCode | service (const std::string &name, T *&psvc, bool createIf=true) const
template<class T >
StatusCode | service (const std::string &svcType, const std::string &svcName, T *&psvc) const
| Access a service by name and type, creating it if it doesn't already exist.
template<class T >
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const
| Declare the named property.
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
| Declare remote named properties.
SmartIF< IAuditorSvc > & | auditorSvc () const
| The standard auditor service.May not be invoked before sysInitialize() has been invoked.
Public Member Functions inherited from CommonMessaging< implements3< IService, IProperty, IStateful > >
| CommonMessaging (const A1 &a1, const A2 &a2, const A3 &a3)
| Templated constructor with 3 arguments.
| CommonMessaging (const A1 &a1, const A2 &a2)
| Templated constructor with 2 arguments.
| CommonMessaging (const A1 &a1)
| Templated constructor with 1 argument.
| CommonMessaging ()
| Default constructor.
virtual | ~CommonMessaging ()
| Virtual destructor.
SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service.
MsgStream & | msgStream () const
| Return an uninitialized MsgStream.
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts.
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS)
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL)
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR)
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR)
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING)
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO)
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG)
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE)
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO)
MSG::Level | msgLevel () const
| get the output level from the embedded MsgStream
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream
Public Member Functions inherited from extend_interfaces2< I1, I2 >
virtual | ~extend_interfaces2 ()
| Virtual destructor.
Public Member Functions inherited from extend_interfaces1< IIncidentListener >
virtual | ~extend_interfaces1 ()
| Virtual destructor.
Public Member Functions inherited from IIncidentListener
| DeclareInterfaceID (IIncidentListener, 2, 0)
| InterfaceID.
Public Member Functions inherited from IInterface
virtual unsigned long | addRef ()=0
| Increment the reference count of Interface instance.
virtual unsigned long | release ()=0
| Release Interface instance.
virtual unsigned long | refCount () const =0
| Current reference count.
virtual | ~IInterface ()
| Virtual destructor.

## Protected Types
typedef std::vector< std::string > | StringV

## 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 Attributes
bool | m_autoLoad
| Property: autoload of records (default: true)
std::string | m_incidentName
| Property: name of incident to be fired if new record arrives.
std::string | m_saveIncidentName
| Property: name of the "save" incident.
std::string | m_persSvcName
| Property: name of the persistency service.
StringV | m_incidents
| Pending new file incidents.
IConversionSvc * | m_cnvSvc
| Reference to the main data conversion service.

## Additional Inherited Members
Public Types inherited from extends1< DataSvc, IIncidentListener >
typedef extends1 | base_class
| Typedef to this class.
typedef extend_interfaces1 < IIncidentListener > | extend_interfaces_base
| Typedef to the base of this class.
typedef extend_interfaces_base::ext_iids | interfaces
| MPL set of all the implemented interfaces.
Static Public Member Functions inherited from IInterface
static const InterfaceID & | interfaceID ()
| Return an instance of InterfaceID identifying the interface.

## 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 26 of file RecordDataSvc.h.

## Member Typedef Documentation

typedef std::vector<std::string> RecordDataSvc::StringV
| protected

Definition at line 28 of file RecordDataSvc.h.

## Constructor & Destructor Documentation

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

Standard Constructor.

Definition at line 169 of file RecordDataSvc.cpp.

: base_class(name,svc), m_cnvSvc(0)
{
m_rootName = "/Records";
declareProperty("AutoLoad", m_autoLoad = true);
declareProperty("IncidentName", m_incidentName = "");
declareProperty("SaveIncident", m_saveIncidentName = "SAVE_RECORD");
declareProperty("PersistencySvc", m_persSvcName = "PersistencySvc/RecordPersistencySvc");
}

RecordDataSvc::~RecordDataSvc | ( |  | ) |
| virtual

Standard Destructor.

Definition at line 180 of file RecordDataSvc.cpp.

{
}

## Member Function Documentation

StatusCode RecordDataSvc::finalize | ( |  | ) |
| virtual

Service finalization.

Reimplemented from DataSvc.

Definition at line 90 of file RecordDataSvc.cpp.

{
if( m_incidentSvc ) m_incidentSvc->removeListener(this);
if( m_cnvSvc ) m_cnvSvc->release();
m_cnvSvc = 0;
DataSvc::finalize().ignore();
return StatusCode::SUCCESS ;
}

void RecordDataSvc::handle | ( | const Incident & | incident | ) |
| virtual

IIncidentListener override: Inform that a new incident has occured.

Inform that a new incident has occured.

Implements IIncidentListener.

Definition at line 99 of file RecordDataSvc.cpp.

{
if ( incident.type() == "FILE_OPEN_READ" ) {
typedef ContextIncident<IOpaqueAddress*> Ctxt;
const Ctxt* inc = dynamic_cast<const Ctxt*>(&incident);
if ( inc ) {
registerRecord(inc->source(),inc->tag());
if ( !m_incidentName.empty() ) {
StringV incidents(m_incidents);
m_incidents.clear();
for( StringV::const_iterator i=incidents.begin(); i!=incidents.end();++i)
m_incidentSvc->fireIncident(Incident(*i,m_incidentName));
}
return;
}
MsgStream log(msgSvc(),name());
log << MSG::ALWAYS << "Received invalid incident of type:" << incident.type() << endmsg;
}
else if ( incident.type() == m_saveIncidentName ) {
MsgStream log(msgSvc(),name());
log << MSG::ALWAYS << "Saving records not implemented." << endmsg;
}
}

StatusCode RecordDataSvc::initialize | ( |  | ) |
| virtual

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.

Reimplemented from DataSvc.

Definition at line 39 of file RecordDataSvc.cpp.

{
// Nothing to do: just call base class initialisation
StatusCode sc = DataSvc::initialize();
MsgStream log(msgSvc(),name());
if ( !sc.isSuccess() ) { // Base class failure
return sc;
}
// Attach data loader facility
sc = service(m_persSvcName, m_cnvSvc, true);
if ( !sc.isSuccess() ) {
log << MSG::ERROR << "Failed to access RecordPersistencySvc." << endmsg;
return sc;
}
SmartIF<IProperty> prp(m_cnvSvc);
if ( prp ) {
//prp->setProperty();
}
sc = setDataLoader( m_cnvSvc );
if ( !sc.isSuccess() ) {
log << MSG::ERROR << "Failed to attach dataloader RecordPersistencySvc." << endmsg;
return sc;
}
sc = setRoot(m_rootName, new DataObject());
if( !sc.isSuccess() ) {
log << MSG::WARNING << "Error declaring Record root DataObject" << endmsg;
return sc;
}
if( !m_incidentSvc ) {
log << MSG::FATAL << "IncidentSvc is invalid--base class failed." << endmsg;
return sc;
}
m_incidentSvc->addListener(this,"FILE_OPEN_READ");
m_incidentSvc->addListener(this,m_saveIncidentName);
return sc;
}

void RecordDataSvc::loadRecords | ( | IRegistry * | pReg | ) |
| protected

Load dependent records into memory.

Definition at line 123 of file RecordDataSvc.cpp.

{
if ( 0 != pObj ) {
typedef vector<IRegistry*> Leaves;
Leaves leaves;
DataObject* p = 0;
MsgStream log(msgSvc(),name());
const string& id0 = pObj->identifier();
StatusCode sc = retrieveObject(id0, p);
if ( sc.isSuccess() ) {
log << MSG::DEBUG << "Loaded records object: " << id0 << endmsg;
sc = objectLeaves(pObj, leaves);
if ( sc.isSuccess() ) {
for ( Leaves::const_iterator i=leaves.begin(); i != leaves.end(); i++ )
loadRecords(*i);
}
}
else {
log << MSG::ERROR << "Failed to load records object: " << pObj->identifier() << endmsg;
}
}
}

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 146 of file RecordDataSvc.cpp.

{
if ( !data.empty() && 0 != pAddr ) {
MsgStream log(msgSvc(),name());
string fid = data;
log << MSG::DEBUG << "Request to load record for file " << fid << endmsg;
StatusCode sc = registerAddress(m_root,fid,pAddr);
if ( !sc.isSuccess() ) {
log << MSG::WARNING << "Failed to register record for:" << fid << endmsg;
pAddr->release();
return;
}
if ( m_autoLoad ) {
loadRecords(pAddr->registry());
}
m_incidents.push_back(pAddr->registry()->identifier());
}
else if ( !data.empty() && 0 == pAddr ) {
MsgStream log(msgSvc(),name());
log << MSG::INFO << "Failed to register record for:" << data << " [Invalid Address]" << endmsg;
}
}

StatusCode RecordDataSvc::reinitialize | ( |  | ) |
| virtual

Service reinitialisation.

Reimplemented from DataSvc.

Definition at line 84 of file RecordDataSvc.cpp.

{
// Do nothing for this service
return StatusCode::SUCCESS;
}

## Member Data Documentation

bool RecordDataSvc::m_autoLoad
| protected

Property: autoload of records (default: true)

Definition at line 52 of file RecordDataSvc.h.

IConversionSvc* RecordDataSvc::m_cnvSvc
| protected

Reference to the main data conversion service.

Definition at line 62 of file RecordDataSvc.h.

std::string RecordDataSvc::m_incidentName
| protected

Property: name of incident to be fired if new record arrives.

Definition at line 54 of file RecordDataSvc.h.

StringV RecordDataSvc::m_incidents
| protected

Pending new file incidents.

Definition at line 60 of file RecordDataSvc.h.

std::string RecordDataSvc::m_persSvcName
| protected

Property: name of the persistency service.

Definition at line 58 of file RecordDataSvc.h.

std::string RecordDataSvc::m_saveIncidentName
| protected

Property: name of the "save" incident.

Definition at line 56 of file RecordDataSvc.h.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/GaudiCommonSvc/src/DataSvc/RecordDataSvc.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/GaudiCommonSvc/src/DataSvc/RecordDataSvc.cpp