BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
RootAddress.cxx
Go to the documentation of this file.
1#define RootAddress_cpp
2
3#include "RootCnvSvc/RootAddress.h"
4#include <iostream>
5#include <stdio.h>
6
7RootAddress::RootAddress( unsigned char svc, const CLID& clid, const std::string path,
8 const std::string treename, const std::string branchname, int entry )
9 : GenericAddress( svc, clid, path, "", 0, 0 ) {
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 {
16 int pos = 0, where = 1;
17 while ( where != std::string::npos )
18 {
19 m_nrBranches++;
20 where = branchname.find( ":", pos );
21 pos = where + 1;
22 }
23 }
24
25 m_treename = treename;
26 m_path = path;
27 m_entrynr = entry;
28}
29void RootAddress::Print() const {
30 std::cout << "RootAddress: path " << m_path << ", treename " << m_treename << " branchname "
31 << m_branchname << " entry " << m_entrynr << std::endl;
32}
33
34std::string RootAddress::getBranchname( int nb ) const {
35 int pos = 0, where = -1;
36 int i = 0;
37 while ( i <= nb )
38 {
39 pos = where + 1;
40 where = m_branchname.find( ":", pos );
41 i++;
42 }
43 if ( where == std::string::npos ) where = m_branchname.size();
44
45 return m_branchname.substr( pos, where - pos );
46}
XmlRpcServer s
std::string getBranchname(int i) const
void Print() const