CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
bak_RootCnvSvc-04-01-14/src/RootAddress.cxx
Go to the documentation of this file.
1#define RootAddress_cpp
2
3#include <iostream>
4#include <stdio.h>
5#include "RootCnvSvc/RootAddress.h"
6
7RootAddress::RootAddress(unsigned char svc, const CLID& clid, const std::string path,const std::string treename,const std::string branchname,int entry)
8 : GenericAddress(svc, clid, path, "", 0, 0)
9{
10 // parse branchname and store what has to be read
11 m_branchname = branchname;
12 int s=branchname.size();
13 m_nrBranches=0;
14 if (branchname.size()) {
15 int pos=0,where=1;
16 while (where!=std::string::npos) {
17 m_nrBranches++;
18 where=branchname.find(":",pos);
19 pos=where+1;
20 }
21 }
22
23 m_treename = treename;
24 m_path=path;
25 m_entrynr=entry;
26}
27void RootAddress::Print() const {
28 std::cout << "RootAddress: path "<<m_path<< ", treename "<<m_treename <<" branchname "<<m_branchname<<" entry "<<m_entrynr<<std::endl;
29}
30
31std::string RootAddress::getBranchname(int nb) const {
32 int pos,where=-1;
33 int i=0;
34 while (i<=nb) {
35 pos=where+1;
36 where=m_branchname.find(":",pos);
37 i++;
38 }
39 if (where==std::string::npos) where=m_branchname.size();
40
41 return m_branchname.substr(pos,where-pos);
42}
XmlRpcServer s
Definition: HelloServer.cpp:11
std::string getBranchname(int i) const