27 auto t = sr.to_string();
35 int loadRefs( boost::string_ref , boost::string_ref cnt,
unsigned long entry,
38 TTree* t = ( ti !=
sections().
end() ? ti->second : nullptr );
39 if ( !t ) { t = (TTree*)
c->
file()->Get(
_treeName( cnt ).c_str() ); }
41 TBranch*
b1 = t->GetBranch(
"Links" );
42 TBranch*
b2 = t->GetBranch(
"Refs" );
47 b1->SetAutoDelete( kFALSE );
48 b2->SetAutoDelete( kFALSE );
49 b1->SetAddress( &plm );
50 b2->SetAddress( &pmgr );
51 int nb1 = b1->GetEvent( entry );
52 int nb2 = b2->GetEvent( entry );
53 if ( nb1 > 1 && nb2 > 1 ) {
57 for (
size_t j = 0; j < ref_size; ++j ) {
58 const pair<int, int>& oid = mgr.
references()[j]->m_oid;
59 string loc = mgr.
links()[j].substr( 1 );
61 if ( oid.first >= 0 ) {
62 r = m_poolLinks[oid.first];
65 msg <<
"Add leaf:" << oid.first <<
"->" << loc <<
" from " <<
c->
getDb( r.
dbase ) <<
"#" 67 <<
" Typ:" <<
hex << int( r.
svc ) <<
" Ent:" <<
dec << r.
entry << endl;
70 for (
int i = 0,
n = lm.
size(); i <
n; ++i ) {
73 msg <<
"Add Link:" << lnk->
path() << endl;
79 msg <<
MSG::ERROR <<
"Failed to access POOL Ref/Link branches:" << cnt <<
" [" <<
_treeName( cnt ) <<
"]" 87 TBranch*
getBranch( boost::string_ref , boost::string_ref branch_name )
override {
89 TTree* t = ( ti !=
sections().
end() ? ti->second : nullptr );
90 if ( t ) {
return (TBranch*)t->GetListOfBranches()->At( 0 ); }
92 t = (TTree*)
c->
file()->Get( tname.c_str() );
94 TBranch* b = (TBranch*)t->GetListOfBranches()->At( 0 );
96 sections()[branch_name.to_string()] = t;
99 msgSvc() <<
MSG::ERROR <<
"Failed to access POOL branch:" << branch_name <<
" [" << tname <<
"]" <<
endmsg;
115 TTree* t = (TTree*)
c->
file()->Get(
"##Params" );
117 TBranch* b = t->GetBranch(
"db_string" );
119 for ( i = 0, b->SetAddress( text ); i < b->GetEntries(); ++i ) {
121 char* id1 = strstr( text,
"[NAME=" );
122 char* id2 = strstr( text,
"[VALUE=" );
126 char* id11 = strstr( id1,
"]" );
127 char* id22 = strstr( id2,
"]" );
128 if ( id11 && id22 ) {
132 msgSvc() <<
"Param:" << id1 <<
"=" << id2 <<
"." <<
endmsg;
138 t = (TTree*)
c->
file()->Get(
"##Links" );
140 b = t->GetBranch(
"db_string" );
142 m_poolLinks.
resize( (
size_t)b->GetEntries() + 2 );
143 for ( i = 0, b->SetAddress( text ); i < b->GetEntries(); ++i ) {
146 int clid = 1, technology = 0, ipar[2] = {-1, -1};
147 for (
char* p1 = (
char*)text; p1; p1 = ::strchr( ++p1,
'[' ) ) {
148 char* p2 = ::strchr( p1,
'=' );
149 char* p3 = ::strchr( p1,
']' );
151 if ( ::strncmp(
"[DB=", p1, 4 ) == 0 ) {
154 }
else if ( ::strncmp(
"[CNT=", p1, 5 ) == 0 ) {
157 }
else if ( ::strncmp(
"[OID=", p1, 5 ) == 0 ) {
159 ::sscanf( p1 + 5,
"%08X,%08X", (
unsigned int*)&ipar[0], (
unsigned int*)&ipar[1] );
160 }
else if ( ::strncmp(
"[CLID=", p1, 6 ) == 0 ) {
162 ::sscanf( p1 + 6,
"%08X", (
unsigned int*)&clid );
163 }
else if ( ::strncmp(
"[TECH=", p1, 6 ) == 0 ) {
165 ::sscanf( p1 + 6,
"%08X", (
unsigned int*)&technology );
173 c->
makeRef(
"", clid, technology, db, container, -1, m_poolLinks[i + 2] );
175 msgSvc() <<
"Add link[" << i <<
"]:" << db << container <<
" [" << r.
dbase <<
"," << r.
container <<
"] " 176 <<
" tech:" <<
hex << setw( 8 ) << r.
svc <<
" CLID:" << setw( 8 ) << r.
clid <<
dec <<
endmsg;
const std::string & path() const
Access to path of object.
Definition of the MsgStream class used to transmit messages.
TFile * file() const
Direct access to TFile structure.
const std::string & getDb(int which) const
Access database/file name from saved index.
int makeLink(boost::string_ref p)
Convert path string to path index.
std::vector< pool::Token * > & references()
Access to token array.
MsgStream & dec(MsgStream &log)
constexpr static const auto SUCCESS
const std::string & getLink(int which) const
Access link name from saved index.
std::vector< RootRef > refs
The references corresponding to the next layer of items in the data store.
MsgStream & hex(MsgStream &log)
Persistent reference object containing all leafs and links corresponding to a Gaudi DataObject...
int dbase
Data members to define object location in the persistent world.
std::vector< std::string > & links()
Access to link array.
Persistent reference object.
Description: PoolDbLinkManager class implementation definition.
This class is used for returning status codes from appropriate routines.
Link * link(long id)
Retrieve symbolic link identified by ID.
const std::string & getCont(int which) const
Access container name from saved index.
std::vector< int > links
The links of the link manager.
constexpr static const auto FAILURE
void makeRef(const IRegistry &pA, RootRef &ref)
Create reference object from registry entry.
Embedded class defining a symbolic link Note: No copy constructor; bitwise copy (done by the compiler...
AttribStringParser::Iterator begin(const AttribStringParser &parser)
Concrete implementation of the IDataConnection interface to access ROOT files.
A LinkManager is the object aggregated into a DataObject, which is responsible for the handling of no...
Helper functions to set/get the application return code.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
long size() const
Retrieve number of link present.