本文整理汇总了C++中KVString::Atoi方法的典型用法代码示例。如果您正苦于以下问题:C++ KVString::Atoi方法的具体用法?C++ KVString::Atoi怎么用?C++ KVString::Atoi使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KVString
的用法示例。
在下文中一共展示了KVString::Atoi方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetProperties
//________________________________________________________________
Bool_t KVFAZIADetector::SetProperties()
{
// detector name are assumed to be defined as
// SI2-T2-Q2-B001
// CSI-T2-Q2-B001
// SI1-T1-Q1-B001
//
KVString tmp;
KVString sname(GetName());
sname.Begin("-");
SetLabel(sname.Next());
gFazia->AddDetectorLabel(GetLabel());
tmp = sname.Next(); tmp.ReplaceAll("T",""); fTelescope = tmp.Atoi();
tmp = sname.Next(); tmp.ReplaceAll("Q",""); fQuartet = tmp.Atoi();
tmp = sname.Next(); tmp.ReplaceAll("B",""); fBlock = tmp.Atoi();
KVSignal* sig=0;
//"QH1", "I1", "QL1", "Q2", "I2", "Q3
if (fSignals)
delete fSignals;
fSignals = new KVList(kTRUE);
KVString lsignals="";
if ( !strcmp(GetLabel(),"SI1") ) { lsignals="QH1,I1,QL1"; }
else if ( !strcmp(GetLabel(),"SI2" ) ) { lsignals="Q2,I2"; }
else if ( !strcmp(GetLabel(),"CSI" ) ) { lsignals="Q3"; }
else{
Warning("SetProperties","Unknown label \"%s\" for this detector : %s\n",GetLabel(),GetName());
lsignals="";
}
lsignals.Begin(",");
while ( !lsignals.End() )
{
KVString ssig = lsignals.Next();
if (ssig.BeginsWith("Q")){
sig = new KVChargeSignal(ssig.Data());
}
else if (ssig.BeginsWith("I")){
sig = new KVCurrentSignal(ssig.Data());
}
else{
Warning("unknown format signal detectorlabel=%s, signal=%s\n",GetLabel(),ssig.Data());
sig = new KVSignal(ssig.Data(),"unknown");
}
sig->LoadPSAParameters(GetLabel());
sig->SetDetectorName(GetName());
fSignals->Add(sig);
}
return kTRUE;
}
示例2: SetPartition
//___________________________________________________________________________________________
void KVIntegerList::SetPartition(const Char_t* par)
{
//protected method, utilisée par le Streamer qui utilise le champ fName de la classe TNamed
//voir également KVIntegerList::DeducePartitionFromTNamed
KVString st(par);
st.Begin(" ");
TObjArray* toks = 0;
while (!st.End()) {
KVString tamp = st.Next();
Int_t val;
Int_t freq;
if (tamp.Contains("(")) {
if (!tamp.Contains(")")) {
Warning("SetPartition", "%s ->pb de coherence dans les parentheses", tamp.Data());
return;
} else {
toks = tamp.Tokenize("(");
val = ((TObjString*)toks->At(0))->GetString().Atoi();
freq = ((TObjString*)toks->At(1))->GetString().Atoi();
delete toks;
}
} else {
val = tamp.Atoi();
freq = 1;
}
Add(val, freq);
}
}
示例3: ReadHeader
Bool_t KVSimReader_SMF_asym::ReadHeader(){
KVString snom;
Int_t res = ReadLineAndCheck(1," ");
switch (res){
case 0:
return kFALSE;
case 1:
snom.Form("%s",GetReadPar(0).Data());
snom.ReplaceAll("evt_","");
//Info("ReadHeader","lecture %d",snom.Atoi());
nv->SetValue("event_number",snom.Atoi());
break;
default:
return kFALSE;
}
res = ReadLineAndCheck(1," ");
switch (res){
case 0:
return kFALSE;
case 1:
nv->SetValue("ndes",GetIntReadPar(0));
ndes = 0;
return kTRUE;
default:
return kFALSE;
}
}