本文整理汇总了C++中IRegistry::identifier方法的典型用法代码示例。如果您正苦于以下问题:C++ IRegistry::identifier方法的具体用法?C++ IRegistry::identifier怎么用?C++ IRegistry::identifier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRegistry
的用法示例。
在下文中一共展示了IRegistry::identifier方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: log
//-----------------------------------------------------------------------------
StatusCode RootHistCnv::PersSvc::createRep(DataObject* pObject,
IOpaqueAddress*& refpAddress)
//-----------------------------------------------------------------------------
{
// There are objects in the HDS to be stored
if( m_outputEnabled && undefFileName != m_defFileName ) {
SmartDataPtr<DataObject> top(dataProvider(), stat_dir);
if ( 0 != top ) {
IRegistry* pReg = top->registry();
if ( pReg ) {
if ( top.ptr() == pObject ) {
TDirectory* pDir = m_hfile;
refpAddress = new RootObjAddress( repSvcType(),
CLID_DataObject,
stat_dir,
m_defFileName,
long(pDir),
long(0));
return StatusCode::SUCCESS;
}
else {
StatusCode sc = ConversionSvc::createRep(pObject, refpAddress);
if( sc.isFailure() ) {
MsgStream log( msgSvc(), name() );
log << MSG::ERROR
<< "Error while creating persistent Histogram:"
<< pReg->identifier()
<< endmsg;
}
return sc;
}
}
}
MsgStream err( msgSvc(), name() );
err << MSG::ERROR
<< "Internal error while creating Histogram persistent representations"
<< endmsg;
return StatusCode::FAILURE;
} else {
if (m_outputEnabled && !m_prtWar) {
m_prtWar = true;
MsgStream log( msgSvc(), name() );
log << MSG::WARNING
<< "no ROOT output file name, "
<< "Histograms cannot be persistified" << endmsg;
}
}
return StatusCode::SUCCESS;
}
示例2: log
//-----------------------------------------------------------------------------
StatusCode
RootHistCnv::RDirectoryCnv::fillObjRefs(IOpaqueAddress* pAddr,DataObject* pObj) {
MsgStream log(msgSvc(), "RDirectoryCnv");
IRegistry* pReg = pObj->registry();
std::string full = pReg->identifier();
const std::string& fname = pAddr->par()[0];
TFile *tf;
findTFile(full,tf).ignore();
// cd to TFile:
setDirectory(full);
TIter nextkey(gDirectory->GetListOfKeys());
while (TKey *key = (TKey*)nextkey()) {
IOpaqueAddress* pA = 0;
TObject *obj = key->ReadObj();
std::string title = obj->GetTitle();
std::string sid = obj->GetName();
std::string f2 = full + "/" + sid;
int idh = ::strtol(sid.c_str(),NULL,10);
// introduced by Grigori Rybkine
std::string clname = key->GetClassName();
std::string clnm = clname.substr(0,3);
TClass* isa = obj->IsA();
if (isa->InheritsFrom("TTree")) {
createAddress(full, CLID_ColumnWiseTuple, idh, obj, pA).ignore();
TTree* tree = (TTree*) obj;
tree->Print();
log << MSG::DEBUG << "Reg CWNT \"" << obj->GetTitle()
<< "\" as " << f2 << endmsg;
title = "/" + sid;
} else if (isa->InheritsFrom("TDirectory")) {
createAddress(full,CLID_NTupleDirectory, title, obj, pA).ignore();
} else if ( isa == TProfile::Class() ) {
createAddress(full,CLID_ProfileH,idh,obj,pA).ignore();
title = sid;
} else if ( isa == TProfile2D::Class() ) {
createAddress(full,CLID_ProfileH2,idh,obj,pA).ignore();
title = sid;
} else if ( isa == TH1C::Class() ) {
createAddress(full,CLID_H1D,idh,obj,pA).ignore();
title = sid;
} else if ( isa == TH1S::Class() ) {
createAddress(full,CLID_H1D,idh,obj,pA).ignore();
title = sid;
} else if ( isa == TH1I::Class() ) {
createAddress(full,CLID_H1D,idh,obj,pA).ignore();
title = sid;
} else if ( isa == TH1F::Class() ) {
createAddress(full,CLID_H1D,idh,obj,pA).ignore();
title = sid;
} else if ( isa == TH1D::Class() ) {
createAddress(full,CLID_H1D,idh,obj,pA).ignore();
title = sid;
} else if ( isa == TH2C::Class() ) {
createAddress(full,CLID_H2D,idh,obj,pA).ignore();
title = sid;
} else if ( isa == TH2S::Class() ) {
createAddress(full,CLID_H2D,idh,obj,pA).ignore();
title = sid;
} else if ( isa == TH2I::Class() ) {
createAddress(full,CLID_H2D,idh,obj,pA).ignore();
title = sid;
} else if ( isa == TH2F::Class() ) {
createAddress(full,CLID_H2D,idh,obj,pA).ignore();
title = sid;
} else if ( isa == TH2D::Class() ) {
createAddress(full,CLID_H2D,idh,obj,pA).ignore();
title = sid;
} else if ( isa == TH3C::Class() ) {
createAddress(full,CLID_H3D,idh,obj,pA).ignore();
title = sid;
} else if ( isa == TH3S::Class() ) {
createAddress(full,CLID_H3D,idh,obj,pA).ignore();
title = sid;
} else if ( isa == TH3I::Class() ) {
createAddress(full,CLID_H3D,idh,obj,pA).ignore();
title = sid;
} else if ( isa == TH3F::Class() ) {
createAddress(full,CLID_H3D,idh,obj,pA).ignore();
title = sid;
} else if ( isa == TH3D::Class() ) {
createAddress(full,CLID_H3D,idh,obj,pA).ignore();
title = sid;
} else {
log << MSG::ERROR << "Encountered an unknown object with key: "
<< obj->GetName() << " in ROOT file " << fname << endmsg;
return StatusCode::FAILURE;
}
if ( 0 != pA ) {
StatusCode sc = dataManager()->registerAddress(pReg, title, pA);
if ( !sc.isSuccess() ) {
log << MSG::ERROR << "Failed to register address for " << full << endmsg;
return sc;
}
log << MSG::VERBOSE << "Created address for " << clnm
<< "'" << title << "' in " << full << endmsg;
}
}
//.........这里部分代码省略.........