| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

RegistrationSequenceCnv Class Reference

#include <RegistrationSequenceCnv.h>

Inheritance diagram for RegistrationSequenceCnv:

[legend]
Collaboration diagram for RegistrationSequenceCnv:
[legend]
List of all members.

Public Types

 INVALID_ADDRESS
 INVALID_OBJECT
 NO_MEMORY
 BAD_STORAGE_TYPE
 NO_SOURCE_OBJECT
 ICONVERSIONSVC_LAST_ERROR
 SUCCESS
 NO_INTERFACE
 VERSMISMATCH
 LAST_ERROR
enum  Status

Public Member Functions

 RegistrationSequenceCnv (ISvcLocator *svc)
virtual ~RegistrationSequenceCnv ()
StatusCode PerToTran (const PerRegistrationSequence &perobj, DayaBay::RegistrationSequence &tranobj)
 Copy data from TObject based class of type TType to DataObject based class of type DOType.
StatusCode TranToPer (const DayaBay::RegistrationSequence &tranobj, PerRegistrationSequence &perobj)
 Copy data from DataObject based class of type DOType to TObject based class of type TType.
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the persistent object.
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
 Resolve the references of the transient object.
PerRegistrationSequencegetPerInputObject ()
PerRegistrationSequencegetPerOutputObject ()
const RootIOBaseObjectgetBaseInputObject ()
const RootIOBaseObjectgetBaseOutputObject ()
virtual StatusCode TranObjectToPerObject (DataObject &dat, const RootOutputAddress &)
virtual StatusCode PerObjectToTranObject (DataObject *&dat)
virtual RootInputStreammakeInputStream (const RootInputAddress &ria)
virtual RootOutputStreammakeOutputStream (const RootOutputAddress &ria)
virtual long repSvcType () const
virtual StatusCode initialize ()
virtual StatusCode finalize ()
virtual StatusCode createObj (IOpaqueAddress *addr, DataObject *&dat)
virtual StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress)
int commit (const RootOutputAddress &roa)
RootIOBaseCnvotherConverter (int clID)
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface)
virtual unsigned long addRef ()
virtual unsigned long release ()
virtual StatusCode setDataProvider (IDataProviderSvc *svc)
virtual IDataProviderSvcdataProvider () const
virtual StatusCode setConversionSvc (IConversionSvc *svc)
virtual IConversionSvcconversionSvc () const
virtual StatusCode setAddressCreator (IAddressCreator *creator)
virtual IAddressCreatoraddressCreator () const
virtual const CLIDobjType () const
virtual long i_repSvcType () const
virtual StatusCode updateObj (IOpaqueAddress *pAddress, DataObject *refpObject)
virtual StatusCode updateObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
virtual StatusCode updateRep (IOpaqueAddress *pAddress, DataObject *pObject)
virtual StatusCode updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
StatusCode service (const std::string &name, T *&psvc, bool createIf=false) const
StatusCode service (const std::string &type, const std::string &name, T *&psvc) const

Static Public Member Functions

static const CLIDclassID ()
static unsigned char storageType ()
static const InterfaceIDinterfaceID ()
static const InterfaceIDinterfaceID ()

Public Attributes

 INVALID_ADDRESS
 INVALID_OBJECT
 NO_MEMORY
 BAD_STORAGE_TYPE
 NO_SOURCE_OBJECT
 ICONVERSIONSVC_LAST_ERROR

Protected Member Functions

ISvcLocatorserviceLocator () const
IMessageSvcmsgSvc () const
IMessageSvcmessageService () const
IDataManagerSvcdataManager () const

Protected Attributes

std::string m_perclassName
PerRegistrationSequencem_perInObj
PerRegistrationSequencem_perOutObj
IRootIOSvcm_rioSvc
IConversionSvcm_cnvSvc
RootInputStreamm_ris

Detailed Description

Definition at line 8 of file RegistrationSequenceCnv.h.


Constructor & Destructor Documentation

RegistrationSequenceCnv::RegistrationSequenceCnv ( ISvcLocator svc  ) 

Definition at line 14 of file RegistrationSequenceCnv.cc.

00015     : RootIOTypedCnv<PerRegistrationSequence,RegistrationSequence>("PerRegistrationSequence",
00016                                                                  classID(),svc)
00017 {
00018 }

RegistrationSequenceCnv::~RegistrationSequenceCnv (  )  [virtual]

Definition at line 20 of file RegistrationSequenceCnv.cc.

00021 {
00022 }


Member Function Documentation

static const CLID& RegistrationSequenceCnv::classID (  )  [inline, static]

Definition at line 12 of file RegistrationSequenceCnv.h.

00012                                  {
00013         return DayaBay::CLID_RegistrationSequence;
00014     }

StatusCode RegistrationSequenceCnv::PerToTran ( const PerRegistrationSequence perobj,
DayaBay::RegistrationSequence tranobj 
) [virtual]

Copy data from TObject based class of type TType to DataObject based class of type DOType.

Implements RootIOTypedCnv< PerRegistrationSequence, DayaBay::RegistrationSequence >.

Definition at line 25 of file RegistrationSequenceCnv.cc.

00027 {
00028     MsgStream log(msgSvc(), "RegistrationSequenceCnv::PerToTran");
00029 
00030     StatusCode sc = TemporalDataObjectCnv::toTran(perobj,tranobj);    
00031     if (sc.isFailure()) {
00032         log<<MSG::ERROR<<"Failed in PerToTran"<<endreq;
00033     } else {
00034         log<<MSG::DEBUG<<"RegistrationSequence converted"<<endreq;
00035     }
00036     return sc;
00037 }

StatusCode RegistrationSequenceCnv::TranToPer ( const DayaBay::RegistrationSequence tranobj,
PerRegistrationSequence perobj 
) [virtual]

Copy data from DataObject based class of type DOType to TObject based class of type TType.

Implements RootIOTypedCnv< PerRegistrationSequence, DayaBay::RegistrationSequence >.

Definition at line 138 of file RegistrationSequenceCnv.cc.

00140 {
00141     StatusCode sc = TemporalDataObjectCnv::toPer(tranobj,perobj);    
00142     if (sc.isFailure()) return sc;
00143 
00144     perobj.reglist.clear();
00145     return StatusCode::SUCCESS;
00146 }

StatusCode RegistrationSequenceCnv::fillRepRefs ( IOpaqueAddress pAddress,
DataObject pObject 
) [virtual]

Resolve the references of the persistent object.

Reimplemented from RootIOTypedCnv< PerRegistrationSequence, DayaBay::RegistrationSequence >.

Definition at line 148 of file RegistrationSequenceCnv.cc.

00150 {
00151     RegistrationSequence* rs = dynamic_cast<RegistrationSequence*>(tranobj);
00152     if (!rs) return StatusCode::FAILURE;
00153 
00154     PerRegistrationSequence& trs = getPerOutputObject();
00155 
00156     const IRegistrationSequence::Registrations &rlist = rs->registrations();
00157     IRegistrationSequence::Registrations::const_iterator it, done = rlist.end();
00158     for (it = rlist.begin(); it != done; ++it) {
00159         const ObjectReg& oreg = *it;
00160         if( oreg.store() ){
00161           trs.reglist.push_back(PerRegSeqReg(oreg.path(),oreg.entry(),
00162                                              oreg.object()->clID()));
00163         }
00164     }
00165 
00166     return StatusCode::SUCCESS;
00167 }

StatusCode RegistrationSequenceCnv::fillObjRefs ( IOpaqueAddress pAddress,
DataObject pObject 
) [virtual]

Resolve the references of the transient object.

Reimplemented from RootIOTypedCnv< PerRegistrationSequence, DayaBay::RegistrationSequence >.

Definition at line 39 of file RegistrationSequenceCnv.cc.

00041 {
00042     MsgStream log(msgSvc(), "RegistrationSequenceCnv::fillObjRefs");
00043 
00044     RegistrationSequence* rs = dynamic_cast<RegistrationSequence*>(tranobj);
00045     if (!rs) return StatusCode::FAILURE;
00046 
00047     unsigned int skipped = 0;
00048 
00049     PerRegistrationSequence& trs = getPerInputObject();
00050     size_t siz = trs.reglist.size();
00051     log << MSG::DEBUG << siz << " registrations" << endreq;
00052     for (size_t ind = 0; ind < siz; ++ind) {
00053 
00054         const PerRegSeqReg& reg = trs.reglist[ind];
00055 
00056         if (reg.path == "/Event/Random/RandomHeader") {
00057             ++skipped;
00058             log << MSG::DEBUG
00059                 << "Not retrieving '/Event/Random/RandomHeader'" 
00060                 << endreq;
00061             continue;
00062         }
00063 
00064         RootInputAddress* ria = new RootInputAddress(reg.clid,reg.path);
00065 
00066         ria->setEntry(reg.entry);
00067         ria->setFileNumber(m_ris->fileNumber());
00068 
00069         RootInputStream* ris = m_rioSvc->inputStream(*ria);
00070         if (!ris) {
00071           log << MSG::WARNING
00072               << "No input stream for " << reg.path
00073               << " will not register anything in the TES"
00074               << endreq;
00075           delete ria;
00076           continue;
00077         }
00078         ria->setStream(ris);
00079 
00080         // register address
00081         log << MSG::DEBUG << "registering " << reg.path
00082             << " entry " << reg.entry << " fileNum " << m_ris->fileNumber() 
00083             << endreq;
00084 
00085         StatusCode sc = m_rioSvc->dataMgrSvc()->registerAddress(reg.path,ria);
00086         
00087         if(sc.getCode()==IDataProviderSvc::DOUBL_OBJ_PATH) {
00088           // Two data objects in the same location.
00089           log << MSG::DEBUG << "IDataProviderSvc::DOUBL_OBJ_PATH Catched "<<endreq;
00090           DataObject* exist_obj=0;
00091           // Since it exist unregister it first, then register the address again.
00092           // It is in AES now if AES is in use.
00093           sc = m_rioSvc->dataSvc()->findObject(reg.path,exist_obj);
00094           if(sc.isSuccess() && exist_obj) {
00095             m_rioSvc->dataSvc()->unregisterObject(exist_obj);       
00096             exist_obj->release(); // why release, check DybDataSvc.cpp and DocDB 3242, page 2 memo
00097             sc = m_rioSvc->dataMgrSvc()->registerAddress(reg.path,ria);
00098           }
00099         }
00100 
00101         if (sc.isFailure()) {
00102           log << MSG::ERROR
00103               << "failed to register address at " << reg.path
00104               << endreq;
00105           return sc;
00106         }
00107 
00108         DataObject* other_tranobj = 0;
00109         // This should trigger an RS registration.
00110         sc = m_rioSvc->dataSvc()->retrieveObject(reg.path,other_tranobj);
00111         if (!other_tranobj || sc.isFailure()) {
00112             log << MSG::WARNING << "failed to retrieve object at " 
00113                 << reg.path << ", continuing...." << endreq;
00114             continue;
00115         }
00116         log << MSG::DEBUG << "retrieved " << reg.path 
00117             << " registration #" << rs->size()
00118             << endreq;
00119 
00120         log << MSG::DEBUG << "inputaddress "<<ria->entry()<<"\t"<<ria->tespath()<<endreq;
00121 
00122         TemporalDataObject* tdo=dynamic_cast<TemporalDataObject*>(other_tranobj);
00123         log << MSG::DEBUG <<tdo<<endreq;
00124         if(tdo!=0) tdo->setInputAddress(ria);
00125     }
00126     log << MSG::DEBUG << "copied " << rs->size()
00127         << " registrations" << endreq;
00128     if (siz - rs->size() > skipped) {
00129         log << MSG::WARNING << "have " << siz
00130             << " registrations from file but only converted " 
00131             << rs->size() 
00132             << " (" << skipped << " skipped on purpose)"
00133             << endreq;
00134     }
00135     return StatusCode::SUCCESS;
00136 }

PerRegistrationSequence & RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::getPerInputObject (  )  [inherited]

PerRegistrationSequence & RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::getPerOutputObject (  )  [inherited]

const RootIOBaseObject * RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::getBaseInputObject (  )  [virtual, inherited]

Implements RootIOBaseCnv.

const RootIOBaseObject * RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::getBaseOutputObject (  )  [virtual, inherited]

Implements RootIOBaseCnv.

virtual StatusCode RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::TranObjectToPerObject ( DataObject dat,
const RootOutputAddress  
) [virtual, inherited]

Implements RootIOBaseCnv.

virtual StatusCode RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::PerObjectToTranObject ( DataObject *&  dat  )  [virtual, inherited]

Implements RootIOBaseCnv.

virtual RootInputStream * RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::makeInputStream ( const RootInputAddress ria  )  [virtual, inherited]

Implements RootIOBaseCnv.

virtual RootOutputStream * RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::makeOutputStream ( const RootOutputAddress ria  )  [virtual, inherited]

Implements RootIOBaseCnv.

virtual long RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::repSvcType (  )  const [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual StatusCode RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::initialize (  )  [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual StatusCode RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::finalize (  )  [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual StatusCode RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::createObj ( IOpaqueAddress addr,
DataObject *&  dat 
) [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual StatusCode RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::createRep ( DataObject pObject,
IOpaqueAddress *&  refpAddress 
) [virtual, inherited]

Reimplemented from RootIOBaseCnv.

int RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::commit ( const RootOutputAddress roa  )  [inherited]

Reimplemented from RootIOBaseCnv.

RootIOBaseCnv * RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::otherConverter ( int  clID  )  [inherited]

Reimplemented from RootIOBaseCnv.

virtual StatusCode RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::queryInterface ( const InterfaceID riid,
void **  ppvInterface 
) [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual unsigned long RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::addRef (  )  [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual unsigned long RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::release (  )  [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual StatusCode RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::setDataProvider ( IDataProviderSvc svc  )  [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual IDataProviderSvc * RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::dataProvider (  )  const [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual StatusCode RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::setConversionSvc ( IConversionSvc svc  )  [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual IConversionSvc * RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::conversionSvc (  )  const [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual StatusCode RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::setAddressCreator ( IAddressCreator creator  )  [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual IAddressCreator * RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::addressCreator (  )  const [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual const CLID & RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::objType (  )  const [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual long RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::i_repSvcType (  )  const [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual StatusCode RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::updateObj ( IOpaqueAddress pAddress,
DataObject refpObject 
) [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual StatusCode RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::updateObjRefs ( IOpaqueAddress pAddress,
DataObject pObject 
) [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual StatusCode RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::updateRep ( IOpaqueAddress pAddress,
DataObject pObject 
) [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual StatusCode RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::updateRepRefs ( IOpaqueAddress pAddress,
DataObject pObject 
) [virtual, inherited]

Reimplemented from RootIOBaseCnv.

StatusCode RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::service ( const std::string &  name,
T *&  psvc,
bool  createIf = false 
) const [inherited]

Reimplemented from RootIOBaseCnv.

StatusCode RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::service ( const std::string &  type,
const std::string &  name,
T *&  psvc 
) const [inherited]

Reimplemented from RootIOBaseCnv.

static unsigned char RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::storageType (  )  [static, inherited]

Reimplemented from RootIOBaseCnv.

static const InterfaceID & RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::interfaceID (  )  [static, inherited]

Reimplemented from RootIOBaseCnv.

static const InterfaceID & RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::interfaceID (  )  [static, inherited]

Reimplemented from RootIOBaseCnv.

ISvcLocator * RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::serviceLocator (  )  const [protected, inherited]

Reimplemented from RootIOBaseCnv.

IMessageSvc * RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::msgSvc (  )  const [protected, inherited]

Reimplemented from RootIOBaseCnv.

IMessageSvc * RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::messageService (  )  const [protected, inherited]

Reimplemented from RootIOBaseCnv.

IDataManagerSvc * RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::dataManager (  )  const [protected, inherited]

Reimplemented from RootIOBaseCnv.


Member Data Documentation

RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::INVALID_ADDRESS [inherited]

Reimplemented from RootIOBaseCnv.

RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::INVALID_OBJECT [inherited]

Reimplemented from RootIOBaseCnv.

RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::NO_MEMORY [inherited]

Reimplemented from RootIOBaseCnv.

RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::BAD_STORAGE_TYPE [inherited]

Reimplemented from RootIOBaseCnv.

RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::NO_SOURCE_OBJECT [inherited]

Reimplemented from RootIOBaseCnv.

RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::ICONVERSIONSVC_LAST_ERROR [inherited]

Reimplemented from RootIOBaseCnv.

std::string RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::m_perclassName [protected, inherited]

PerRegistrationSequence * RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::m_perInObj [protected, inherited]

PerRegistrationSequence * RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::m_perOutObj [protected, inherited]

IRootIOSvc * RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::m_rioSvc [protected, inherited]

Reimplemented from RootIOBaseCnv.

IConversionSvc * RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::m_cnvSvc [protected, inherited]

Reimplemented from RootIOBaseCnv.

RootInputStream * RootIOTypedCnv< PerRegistrationSequence , DayaBay::RegistrationSequence >::m_ris [protected, inherited]

Reimplemented from RootIOBaseCnv.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:18:45 2011 for PerBaseEvent by doxygen 1.4.7