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

In This Package:

DaqBlockHeaderCnv Class Reference

#include <DaqBlockHeaderCnv.h>

Inheritance diagram for DaqBlockHeaderCnv:

[legend]
Collaboration diagram for DaqBlockHeaderCnv:
[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

 DaqBlockHeaderCnv (ISvcLocator *svc)
 Creates an instance of this class.
virtual ~DaqBlockHeaderCnv ()
 Destroys this instance of the class.
StatusCode PerToTran (const PerDaqBlockHeader &perobj, DayaBay::DaqBlockHeader &tranobj)
 Create transisent instance from persistent.
StatusCode TranToPer (const DayaBay::DaqBlockHeader &tranobj, PerDaqBlockHeader &perobj)
 Create persistent instance from transient.
StatusCode fillRepRefs (IOpaqueAddress *addr, DataObject *dobj)
StatusCode fillObjRefs (IOpaqueAddress *addr, DataObject *dobj)
PerDaqBlockHeadergetPerInputObject ()
PerDaqBlockHeadergetPerOutputObject ()
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
PerDaqBlockHeaderm_perInObj
PerDaqBlockHeaderm_perOutObj
IRootIOSvcm_rioSvc
IConversionSvcm_cnvSvc
RootInputStreamm_ris

Detailed Description

Definition at line 18 of file DaqBlockHeaderCnv.h.


Constructor & Destructor Documentation

DaqBlockHeaderCnv::DaqBlockHeaderCnv ( ISvcLocator svc  ) 

Creates an instance of this class.

Definition at line 24 of file DaqBlockHeaderCnv.cc.

00024                                                      :
00025     RootIOTypedCnv<PerDaqBlockHeader,DaqBlockHeader>("PerDaqBlockHeader",
00026                                                      classID(),
00027                                                      svc) {
00028 }

DaqBlockHeaderCnv::~DaqBlockHeaderCnv (  )  [virtual]

Destroys this instance of the class.

Definition at line 31 of file DaqBlockHeaderCnv.cc.

00031                                       {
00032 }


Member Function Documentation

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

Definition at line 23 of file DaqBlockHeaderCnv.h.

00023                                  {
00024         return DayaBay::CLID_DaqBlockHeader;
00025     }

StatusCode DaqBlockHeaderCnv::PerToTran ( const PerDaqBlockHeader perobj,
DayaBay::DaqBlockHeader tranobj 
) [virtual]

Create transisent instance from persistent.

Implements RootIOTypedCnv< PerDaqBlockHeader, DayaBay::DaqBlockHeader >.

Definition at line 34 of file DaqBlockHeaderCnv.cc.

00035                                                                  {
00036     MsgStream log(msgSvc(), "ReadoutHeaderCnv::PerToTran");
00037     StatusCode sc = HeaderObjectCnv::toTran(perobj,tranobj);
00038     if (sc.isFailure()) {
00039         return sc;
00040     }
00041 
00042     tranobj.setDeltaEvents(perobj.deltaEvents);
00043     if(0 == perobj.daqBlock) {
00044         tranobj.setDaqBlock(0);
00045         return StatusCode::SUCCESS;
00046     }
00047 
00048     DaqBlock* daqBlock = const_cast<DaqBlock*>(tranobj.daqBlock());
00049     if (0 == daqBlock) {
00050         daqBlock = new DaqBlock();
00051         tranobj.setDaqBlock(daqBlock);
00052     }
00053     DaqBlock::RawData* rawBytes = daqBlock->bytes();
00054     std::vector<unsigned int>& daqBytes = perobj.daqBlock->rawData;
00055     if (0 == rawBytes) {
00056         rawBytes = new DaqBlock::RawData(daqBytes.size());
00057         daqBlock->setBytes(rawBytes);
00058     } else {
00059         rawBytes->resize(daqBytes.size());
00060     }
00061     memcpy(&((*(daqBlock->bytes()))[0]),
00062            &(daqBytes[0]),
00063            daqBytes.size() * ByteBuffer::BYTES_IN_INT);
00064     return StatusCode::SUCCESS;
00065 }                                       

StatusCode DaqBlockHeaderCnv::TranToPer ( const DayaBay::DaqBlockHeader tranobj,
PerDaqBlockHeader perobj 
) [virtual]

Create persistent instance from transient.

Implements RootIOTypedCnv< PerDaqBlockHeader, DayaBay::DaqBlockHeader >.

Definition at line 67 of file DaqBlockHeaderCnv.cc.

00068                                                                    {
00069     MsgStream log(msgSvc(), "DaqBlockHeaderCnv::TranToPer");
00070     StatusCode sc = HeaderObjectCnv::toPer(tranobj,
00071                                            perobj);
00072     if (sc.isFailure()) {
00073         return sc;
00074     }
00075 
00076     perobj.deltaEvents = tranobj.deltaEvents();
00077     const DaqBlock* daqBlock = tranobj.daqBlock();
00078     if ( 0 == daqBlock) {
00079         delete perobj.daqBlock;
00080         perobj.daqBlock = 0;
00081         return StatusCode::SUCCESS;
00082     }
00083     perobj.daqBlock = new PerDaqBlock(daqBlock->size());
00084     std::vector<unsigned int>& daqBytes = perobj.daqBlock->rawData;
00085     memcpy(&(daqBytes[0]),
00086            &((*(daqBlock->bytes()))[0]),
00087            daqBlock->size() * ByteBuffer::BYTES_IN_INT);
00088     return StatusCode::SUCCESS;
00089 }

StatusCode DaqBlockHeaderCnv::fillRepRefs ( IOpaqueAddress addr,
DataObject dobj 
) [virtual]

Reimplemented from RootIOTypedCnv< PerDaqBlockHeader, DayaBay::DaqBlockHeader >.

Definition at line 91 of file DaqBlockHeaderCnv.cc.

00091                                                                            {
00092     MsgStream log(msgSvc(), "DaqBlockHeaderCnv::fillRepRefs");
00093     DaqBlockHeader* rh = dynamic_cast<DaqBlockHeader*>(dobj);
00094 
00095     log << MSG::DEBUG
00096         << "Saving links to " << rh->inputHeaders().size() 
00097         << " input headers" << endreq;
00098 
00099     StatusCode sc = HeaderObjectCnv::fillPer(m_rioSvc,*rh,*m_perOutObj);
00100     if (sc.isFailure()) {
00101         log << MSG::ERROR << "Failed to fill HeaderObject part" << endreq;
00102         return sc;
00103     }
00104 
00105     // ... fill DaqBlockHeader part...
00106     return sc;
00107 }

StatusCode DaqBlockHeaderCnv::fillObjRefs ( IOpaqueAddress addr,
DataObject dobj 
) [virtual]

Reimplemented from RootIOTypedCnv< PerDaqBlockHeader, DayaBay::DaqBlockHeader >.

Definition at line 109 of file DaqBlockHeaderCnv.cc.

00109                                                                            {
00110     MsgStream log(msgSvc(), "DaqBlockHeaderCnv::fillObjRefs");
00111     HeaderObject* hobj = dynamic_cast<HeaderObject*>(dobj);
00112     StatusCode sc = HeaderObjectCnv::fillTran(m_rioSvc,*m_perInObj,*hobj);
00113     if (sc.isFailure()) {
00114         log << MSG::ERROR << "Failed to fill HeaderObject part" << endreq;
00115         return sc;
00116     }
00117 
00118     log << MSG::DEBUG
00119         << "Restored links to " << hobj->inputHeaders().size() 
00120         << " input headers" << endreq;
00121 
00122     // ... fill DaqBlockHeader part...
00123     return sc;
00124 }

PerDaqBlockHeader & RootIOTypedCnv< PerDaqBlockHeader , DayaBay::DaqBlockHeader >::getPerInputObject (  )  [inherited]

PerDaqBlockHeader & RootIOTypedCnv< PerDaqBlockHeader , DayaBay::DaqBlockHeader >::getPerOutputObject (  )  [inherited]

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

Implements RootIOBaseCnv.

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

Implements RootIOBaseCnv.

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

Implements RootIOBaseCnv.

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

Implements RootIOBaseCnv.

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

Implements RootIOBaseCnv.

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

Implements RootIOBaseCnv.

virtual long RootIOTypedCnv< PerDaqBlockHeader , DayaBay::DaqBlockHeader >::repSvcType (  )  const [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual StatusCode RootIOTypedCnv< PerDaqBlockHeader , DayaBay::DaqBlockHeader >::initialize (  )  [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual StatusCode RootIOTypedCnv< PerDaqBlockHeader , DayaBay::DaqBlockHeader >::finalize (  )  [virtual, inherited]

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

virtual unsigned long RootIOTypedCnv< PerDaqBlockHeader , DayaBay::DaqBlockHeader >::addRef (  )  [virtual, inherited]

Reimplemented from RootIOBaseCnv.

virtual unsigned long RootIOTypedCnv< PerDaqBlockHeader , DayaBay::DaqBlockHeader >::release (  )  [virtual, inherited]

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

virtual long RootIOTypedCnv< PerDaqBlockHeader , DayaBay::DaqBlockHeader >::i_repSvcType (  )  const [virtual, inherited]

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

static unsigned char RootIOTypedCnv< PerDaqBlockHeader , DayaBay::DaqBlockHeader >::storageType (  )  [static, inherited]

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.

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

Reimplemented from RootIOBaseCnv.


Member Data Documentation

RootIOTypedCnv< PerDaqBlockHeader , DayaBay::DaqBlockHeader >::INVALID_ADDRESS [inherited]

Reimplemented from RootIOBaseCnv.

RootIOTypedCnv< PerDaqBlockHeader , DayaBay::DaqBlockHeader >::INVALID_OBJECT [inherited]

Reimplemented from RootIOBaseCnv.

RootIOTypedCnv< PerDaqBlockHeader , DayaBay::DaqBlockHeader >::NO_MEMORY [inherited]

Reimplemented from RootIOBaseCnv.

RootIOTypedCnv< PerDaqBlockHeader , DayaBay::DaqBlockHeader >::BAD_STORAGE_TYPE [inherited]

Reimplemented from RootIOBaseCnv.

RootIOTypedCnv< PerDaqBlockHeader , DayaBay::DaqBlockHeader >::NO_SOURCE_OBJECT [inherited]

Reimplemented from RootIOBaseCnv.

RootIOTypedCnv< PerDaqBlockHeader , DayaBay::DaqBlockHeader >::ICONVERSIONSVC_LAST_ERROR [inherited]

Reimplemented from RootIOBaseCnv.

std::string RootIOTypedCnv< PerDaqBlockHeader , DayaBay::DaqBlockHeader >::m_perclassName [protected, inherited]

PerDaqBlockHeader * RootIOTypedCnv< PerDaqBlockHeader , DayaBay::DaqBlockHeader >::m_perInObj [protected, inherited]

PerDaqBlockHeader * RootIOTypedCnv< PerDaqBlockHeader , DayaBay::DaqBlockHeader >::m_perOutObj [protected, inherited]

IRootIOSvc * RootIOTypedCnv< PerDaqBlockHeader , DayaBay::DaqBlockHeader >::m_rioSvc [protected, inherited]

Reimplemented from RootIOBaseCnv.

IConversionSvc * RootIOTypedCnv< PerDaqBlockHeader , DayaBay::DaqBlockHeader >::m_cnvSvc [protected, inherited]

Reimplemented from RootIOBaseCnv.

RootInputStream * RootIOTypedCnv< PerDaqBlockHeader , DayaBay::DaqBlockHeader >::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:24:13 2011 for PerDaqBlock by doxygen 1.4.7