#include <HeaderObjectCnv.h>
Inheritance diagram for HeaderObjectCnv:
Definition at line 10 of file HeaderObjectCnv.h.
HeaderObjectCnv::HeaderObjectCnv | ( | ISvcLocator * | svc | ) |
Definition at line 18 of file HeaderObjectCnv.cc.
00019 : RootIOTypedCnv<PerHeaderObject,HeaderObject>("PerHeaderObject",classID(),svc) 00020 { 00021 }
HeaderObjectCnv::~HeaderObjectCnv | ( | ) | [virtual] |
static const CLID& HeaderObjectCnv::classID | ( | ) | [inline, static] |
Definition at line 14 of file HeaderObjectCnv.h.
00014 { 00015 return DayaBay::CLID_HeaderObject; 00016 }
void HeaderObjectCnv::clear | ( | ) |
Definition at line 27 of file HeaderObjectCnv.cc.
00028 { 00029 PerHeaderObject* objs[3] = { 00030 &getPerInputObject(), 00031 &getPerOutputObject(), 00032 0 00033 }; 00034 const char* label[] = { "input", "output", 0 }; 00035 for (int ind=0; objs[ind]; ++ind) { 00036 PerHeaderObject& tho = *objs[ind]; 00037 tho.context = Context(); 00038 tho.context.SetTimeStamp(TimeStamp(0.0)); // default is sets to "now" 00039 tho.execNumber = -1; 00040 tho.jobId = DayaBay::JobId(); 00041 tho.randomState.clear(); 00042 00043 MsgStream log(msgSvc(), "HeaderObjectCnv::clear"); 00044 log << MSG::VERBOSE 00045 << "clearing " << tho.inputHeaders.size() << " input headers from " 00046 << label[ind] << " PerHeaderObject" 00047 << endreq; 00048 tho.inputHeaders.clear(); 00049 } 00050 }
StatusCode HeaderObjectCnv::toTran | ( | const PerHeaderObject & | tobj, | |
DayaBay::HeaderObject & | dobj | |||
) | [static] |
Static method to do conversion.
This should be called by other converters that are converting a subclass of HeaderObject.
Definition at line 53 of file HeaderObjectCnv.cc.
00055 { 00056 StatusCode sc = TemporalDataObjectCnv::toTran(perobj,tranobj); 00057 if (sc.isFailure()) return sc; 00058 00059 // do header copy 00060 tranobj.setContext(perobj.context); 00061 tranobj.setExecNumber(perobj.execNumber); 00062 tranobj.setJobId(perobj.jobId); 00063 tranobj.setRandomState(perobj.randomState); 00064 tranobj.setInputHeaders(vector<const DayaBay::IHeader*>()); 00065 return StatusCode::SUCCESS; 00066 }
StatusCode HeaderObjectCnv::toPer | ( | const DayaBay::HeaderObject & | dobj, | |
PerHeaderObject & | tobj | |||
) | [static] |
Definition at line 68 of file HeaderObjectCnv.cc.
00070 { 00071 StatusCode sc = TemporalDataObjectCnv::toPer(tranobj,perobj); 00072 if (sc.isFailure()) return sc; 00073 00074 // do header copy 00075 00076 perobj.context = tranobj.context(); 00077 perobj.execNumber = tranobj.execNumber(); 00078 perobj.jobId = tranobj.jobId(); 00079 perobj.randomState = tranobj.randomState(); 00080 perobj.inputHeaders.clear(); 00081 return StatusCode::SUCCESS; 00082 }
StatusCode HeaderObjectCnv::fillTran | ( | IRootIOSvc * | rioSvc, | |
const PerHeaderObject & | tobj, | |||
DayaBay::HeaderObject & | dobj | |||
) | [static] |
Static method to fill in HeaderObject references.
This should be called by other converters that are converting a subclass of HeaderObject.
Definition at line 130 of file HeaderObjectCnv.cc.
00133 { 00134 GaudiMsgStreams log("HeaderObjectCnv::fillTran"); 00135 00136 static IEvtStoreQuery* s_evtStoreQuery=0; 00137 // get a service pointer in a static function 00138 if (s_evtStoreQuery==0) { 00139 ServiceHandle<IEvtStoreQuery> msgh("EvtStoreQuery","HeaderObjectCnv"); 00140 s_evtStoreQuery = msgh.operator->(); 00141 } 00142 00143 // Get current RegistrationSequence 00144 string rs_path = RegistrationSequence::defaultLocation(); 00145 DataObject *rs_tranobj = 0; 00146 StatusCode sc = rioSvc->dataSvc()->retrieveObject(rs_path,rs_tranobj); 00147 if (sc.isFailure()) { 00148 return sc; 00149 } 00150 RegistrationSequence* rsobj = dynamic_cast<RegistrationSequence*>(rs_tranobj); 00151 if (!rsobj)return StatusCode::FAILURE; 00152 00153 vector<const DayaBay::IHeader*> inputs; 00154 00155 size_t siz = tho.inputHeaders.size(); 00156 for (size_t ind=0; ind < siz; ++ind) { 00157 const PerRef& pref = tho.inputHeaders[ind]; 00158 00159 log.debug() 00160 << s_evtStoreQuery << "\t" << pref.path() << "\t" << pref.entry() 00161 << endreq; 00162 const DataObject* pOBJ = s_evtStoreQuery->queryInputAddress(pref.path(),pref.entry()); 00163 00164 if(pOBJ!=0) { 00165 const IHeader* ihead = dynamic_cast<const IHeader*>(pOBJ); 00166 inputs.push_back(ihead); 00167 } 00168 else { 00169 static int headerWarningCount = 0; 00170 if( headerWarningCount < 10 ){ 00171 log.warning() 00172 <<"An inputHeader " << pref.path() << ", " << pref.entry() << " not found." 00173 << " Consider using a longer AES window." 00174 << endreq; 00175 headerWarningCount++; 00176 if(headerWarningCount==10){ 00177 log.warning() 00178 <<" (Further missing inputHeader messages suppressed.)" 00179 << endreq; 00180 } 00181 } 00182 } 00183 } 00184 ho.setInputHeaders(inputs); 00185 return StatusCode::SUCCESS; 00186 }
StatusCode HeaderObjectCnv::fillPer | ( | IRootIOSvc * | rioSvc, | |
const DayaBay::HeaderObject & | ho, | |||
PerHeaderObject & | tho | |||
) | [static] |
Definition at line 85 of file HeaderObjectCnv.cc.
00088 { 00089 GaudiMsgStreams log("HeaderObjectCnv::fillPer"); 00090 00091 tho.inputHeaders.clear(); 00092 size_t siz = ho.inputHeaders().size(); 00093 if( siz <= 0 ) return StatusCode::SUCCESS; 00094 00095 for (size_t ind = 0; ind<siz; ++ind) { 00096 const IHeader* ihead = ho.inputHeaders()[ind]; 00097 const HeaderObject* other_ho = 00098 dynamic_cast<const HeaderObject*>(ihead); 00099 00100 const GenericAddress* gad=other_ho->outputAddress(); 00101 if(!gad) { 00102 static map<string,int> errorMap; 00103 string other_ho_name = other_ho->name(); 00104 if (!errorMap[other_ho_name]) { 00105 log.warning() 00106 << MSG::WARNING 00107 << "Failed to get output address for " << other_ho_name 00108 << ", skipping and won't tell you about it again." << endreq; 00109 } 00110 errorMap[other_ho_name] = 1; 00111 continue; // skip this one 00112 } 00113 00114 const RootOutputAddress* roa=dynamic_cast<const RootOutputAddress*>(gad); 00115 tho.inputHeaders.push_back(PerRef(roa->entry(),roa->tespath())); 00116 } 00117 return StatusCode::SUCCESS; 00118 }
StatusCode HeaderObjectCnv::PerToTran | ( | const PerHeaderObject & | tobj, | |
DayaBay::HeaderObject & | dobj | |||
) | [virtual] |
Copy data from TObject based class of type TType to DataObject based class of type DOType.
Implements RootIOTypedCnv< PerHeaderObject, DayaBay::HeaderObject >.
Definition at line 197 of file HeaderObjectCnv.cc.
00199 { 00200 return HeaderObjectCnv::toTran(perobj,tranobj); 00201 }
StatusCode HeaderObjectCnv::TranToPer | ( | const DayaBay::HeaderObject & | dobj, | |
PerHeaderObject & | tobj | |||
) | [virtual] |
Copy data from DataObject based class of type DOType to TObject based class of type TType.
Implements RootIOTypedCnv< PerHeaderObject, DayaBay::HeaderObject >.
Definition at line 203 of file HeaderObjectCnv.cc.
00205 { 00206 return HeaderObjectCnv::toPer(tranobj,perobj); 00207 }
StatusCode HeaderObjectCnv::fillRepRefs | ( | IOpaqueAddress * | addr, | |
DataObject * | dobj | |||
) | [virtual] |
Reimplemented from RootIOTypedCnv< PerHeaderObject, DayaBay::HeaderObject >.
Definition at line 122 of file HeaderObjectCnv.cc.
00124 { 00125 HeaderObject* ho = dynamic_cast<HeaderObject*>(tranobj); 00126 PerHeaderObject& tho = getPerOutputObject(); 00127 return HeaderObjectCnv::fillPer(m_rioSvc, *ho, tho); 00128 }
StatusCode HeaderObjectCnv::fillObjRefs | ( | IOpaqueAddress * | addr, | |
DataObject * | dobj | |||
) | [virtual] |
Reimplemented from RootIOTypedCnv< PerHeaderObject, DayaBay::HeaderObject >.
Definition at line 188 of file HeaderObjectCnv.cc.
00190 { 00191 PerHeaderObject& tho = getPerInputObject(); 00192 HeaderObject* ho = dynamic_cast<HeaderObject*>(tranobj); 00193 return HeaderObjectCnv::fillTran(m_rioSvc, tho, *ho); 00194 }
PerHeaderObject & RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::getPerInputObject | ( | ) | [inherited] |
PerHeaderObject & RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::getPerOutputObject | ( | ) | [inherited] |
const RootIOBaseObject * RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::getBaseInputObject | ( | ) | [virtual, inherited] |
Implements RootIOBaseCnv.
const RootIOBaseObject * RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::getBaseOutputObject | ( | ) | [virtual, inherited] |
Implements RootIOBaseCnv.
virtual StatusCode RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::TranObjectToPerObject | ( | DataObject & | dat, | |
const RootOutputAddress & | ||||
) | [virtual, inherited] |
Implements RootIOBaseCnv.
virtual StatusCode RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::PerObjectToTranObject | ( | DataObject *& | dat | ) | [virtual, inherited] |
Implements RootIOBaseCnv.
virtual RootInputStream * RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::makeInputStream | ( | const RootInputAddress & | ria | ) | [virtual, inherited] |
Implements RootIOBaseCnv.
virtual RootOutputStream * RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::makeOutputStream | ( | const RootOutputAddress & | ria | ) | [virtual, inherited] |
Implements RootIOBaseCnv.
virtual long RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::repSvcType | ( | ) | const [virtual, inherited] |
Reimplemented from RootIOBaseCnv.
virtual StatusCode RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::initialize | ( | ) | [virtual, inherited] |
Reimplemented from RootIOBaseCnv.
virtual StatusCode RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::finalize | ( | ) | [virtual, inherited] |
Reimplemented from RootIOBaseCnv.
virtual StatusCode RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::createObj | ( | IOpaqueAddress * | addr, | |
DataObject *& | dat | |||
) | [virtual, inherited] |
Reimplemented from RootIOBaseCnv.
virtual StatusCode RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::createRep | ( | DataObject * | pObject, | |
IOpaqueAddress *& | refpAddress | |||
) | [virtual, inherited] |
Reimplemented from RootIOBaseCnv.
int RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::commit | ( | const RootOutputAddress & | roa | ) | [inherited] |
Reimplemented from RootIOBaseCnv.
RootIOBaseCnv * RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::otherConverter | ( | int | clID | ) | [inherited] |
Reimplemented from RootIOBaseCnv.
virtual StatusCode RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::queryInterface | ( | const InterfaceID & | riid, | |
void ** | ppvInterface | |||
) | [virtual, inherited] |
Reimplemented from RootIOBaseCnv.
virtual unsigned long RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::addRef | ( | ) | [virtual, inherited] |
Reimplemented from RootIOBaseCnv.
virtual unsigned long RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::release | ( | ) | [virtual, inherited] |
Reimplemented from RootIOBaseCnv.
virtual StatusCode RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::setDataProvider | ( | IDataProviderSvc * | svc | ) | [virtual, inherited] |
Reimplemented from RootIOBaseCnv.
virtual IDataProviderSvc * RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::dataProvider | ( | ) | const [virtual, inherited] |
Reimplemented from RootIOBaseCnv.
virtual StatusCode RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::setConversionSvc | ( | IConversionSvc * | svc | ) | [virtual, inherited] |
Reimplemented from RootIOBaseCnv.
virtual IConversionSvc * RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::conversionSvc | ( | ) | const [virtual, inherited] |
Reimplemented from RootIOBaseCnv.
virtual StatusCode RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::setAddressCreator | ( | IAddressCreator * | creator | ) | [virtual, inherited] |
Reimplemented from RootIOBaseCnv.
virtual IAddressCreator * RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::addressCreator | ( | ) | const [virtual, inherited] |
Reimplemented from RootIOBaseCnv.
virtual const CLID & RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::objType | ( | ) | const [virtual, inherited] |
Reimplemented from RootIOBaseCnv.
virtual long RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::i_repSvcType | ( | ) | const [virtual, inherited] |
Reimplemented from RootIOBaseCnv.
virtual StatusCode RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::updateObj | ( | IOpaqueAddress * | pAddress, | |
DataObject * | refpObject | |||
) | [virtual, inherited] |
Reimplemented from RootIOBaseCnv.
virtual StatusCode RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::updateObjRefs | ( | IOpaqueAddress * | pAddress, | |
DataObject * | pObject | |||
) | [virtual, inherited] |
Reimplemented from RootIOBaseCnv.
virtual StatusCode RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::updateRep | ( | IOpaqueAddress * | pAddress, | |
DataObject * | pObject | |||
) | [virtual, inherited] |
Reimplemented from RootIOBaseCnv.
virtual StatusCode RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::updateRepRefs | ( | IOpaqueAddress * | pAddress, | |
DataObject * | pObject | |||
) | [virtual, inherited] |
Reimplemented from RootIOBaseCnv.
StatusCode RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::service | ( | const std::string & | name, | |
T *& | psvc, | |||
bool | createIf = false | |||
) | const [inherited] |
Reimplemented from RootIOBaseCnv.
StatusCode RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::service | ( | const std::string & | type, | |
const std::string & | name, | |||
T *& | psvc | |||
) | const [inherited] |
Reimplemented from RootIOBaseCnv.
static unsigned char RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::storageType | ( | ) | [static, inherited] |
Reimplemented from RootIOBaseCnv.
static const InterfaceID & RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::interfaceID | ( | ) | [static, inherited] |
Reimplemented from RootIOBaseCnv.
static const InterfaceID & RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::interfaceID | ( | ) | [static, inherited] |
Reimplemented from RootIOBaseCnv.
ISvcLocator * RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::serviceLocator | ( | ) | const [protected, inherited] |
Reimplemented from RootIOBaseCnv.
IMessageSvc * RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::msgSvc | ( | ) | const [protected, inherited] |
Reimplemented from RootIOBaseCnv.
IMessageSvc * RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::messageService | ( | ) | const [protected, inherited] |
Reimplemented from RootIOBaseCnv.
IDataManagerSvc * RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::dataManager | ( | ) | const [protected, inherited] |
Reimplemented from RootIOBaseCnv.
RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::INVALID_ADDRESS [inherited] |
Reimplemented from RootIOBaseCnv.
RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::INVALID_OBJECT [inherited] |
Reimplemented from RootIOBaseCnv.
RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::NO_MEMORY [inherited] |
Reimplemented from RootIOBaseCnv.
RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::BAD_STORAGE_TYPE [inherited] |
Reimplemented from RootIOBaseCnv.
RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::NO_SOURCE_OBJECT [inherited] |
Reimplemented from RootIOBaseCnv.
RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::ICONVERSIONSVC_LAST_ERROR [inherited] |
Reimplemented from RootIOBaseCnv.
std::string RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::m_perclassName [protected, inherited] |
PerHeaderObject * RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::m_perInObj [protected, inherited] |
PerHeaderObject * RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::m_perOutObj [protected, inherited] |
IRootIOSvc * RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::m_rioSvc [protected, inherited] |
Reimplemented from RootIOBaseCnv.
IConversionSvc * RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::m_cnvSvc [protected, inherited] |
Reimplemented from RootIOBaseCnv.
RootInputStream * RootIOTypedCnv< PerHeaderObject , DayaBay::HeaderObject >::m_ris [protected, inherited] |
Reimplemented from RootIOBaseCnv.