45 int loadRefs( std::string_view , std::string_view cnt,
unsigned long entry,
49 if ( !t ) { t = (TTree*)
c->
file()->Get(
_treeName( cnt ).c_str() ); }
51 TBranch*
b1 = t->GetBranch(
"Links" );
52 TBranch*
b2 = t->GetBranch(
"Refs" );
57 b1->SetAutoDelete( kFALSE );
58 b2->SetAutoDelete( kFALSE );
59 b1->SetAddress( &plm );
60 b2->SetAddress( &pmgr );
61 int nb1 =
b1->GetEvent( entry );
62 int nb2 =
b2->GetEvent( entry );
63 if ( nb1 > 1 && nb2 > 1 ) {
65 refs.refs.resize( ref_size );
67 for (
size_t j = 0; j < ref_size; ++j ) {
68 const pair<int, int>& oid = mgr.
references()[j]->m_oid;
69 string loc = mgr.
links()[j].substr( 1 );
71 if ( oid.first >= 0 ) {
75 msg <<
"Add leaf:" << oid.first <<
"->" << loc <<
" from " <<
c->
getDb( r.
dbase ) <<
"#" 77 <<
" Typ:" <<
hex << int( r.
svc ) <<
" Ent:" <<
dec << r.
entry << endl;
80 for (
int i = 0,
n = lm.
size(); i <
n; ++i ) {
83 msg <<
"Add Link:" << lnk->
path() << endl;
84 refs.links.push_back( link_id );
97 TBranch*
getBranch( std::string_view , std::string_view branch_name )
override {
100 if ( t ) {
return (TBranch*)t->GetListOfBranches()->At( 0 ); }
102 t = (TTree*)
c->
file()->Get( tname.c_str() );
104 TBranch* b = (TBranch*)t->GetListOfBranches()->At( 0 );
109 msgSvc() <<
MSG::ERROR <<
"Failed to access POOL branch:" << branch_name <<
" [" << tname <<
"]" <<
endmsg;
125 TTree* t = (TTree*)
c->
file()->Get(
"##Params" );
127 TBranch* b = t->GetBranch(
"db_string" );
129 for ( i = 0, b->SetAddress( text ); i < b->GetEntries(); ++i ) {
131 char* id1 = strstr( text,
"[NAME=" );
132 char* id2 = strstr( text,
"[VALUE=" );
136 char* id11 = strstr( id1,
"]" );
137 char* id22 = strstr( id2,
"]" );
138 if ( id11 && id22 ) {
142 msgSvc() <<
"Param:" << id1 <<
"=" << id2 <<
"." <<
endmsg;
148 t = (TTree*)
c->
file()->Get(
"##Links" );
150 b = t->GetBranch(
"db_string" );
153 for ( i = 0, b->SetAddress( text ); i < b->GetEntries(); ++i ) {
156 int clid = 1, technology = 0, ipar[2] = {-1, -1};
157 for (
char* p1 = (
char*)text; p1; p1 = ::strchr( ++p1,
'[' ) ) {
158 char* p2 = ::strchr( p1,
'=' );
159 char* p3 = ::strchr( p1,
']' );
161 if ( ::strncmp(
"[DB=", p1, 4 ) == 0 ) {
164 }
else if ( ::strncmp(
"[CNT=", p1, 5 ) == 0 ) {
167 }
else if ( ::strncmp(
"[OID=", p1, 5 ) == 0 ) {
169 ::sscanf( p1 + 5,
"%08X,%08X", (
unsigned int*)&ipar[0], (
unsigned int*)&ipar[1] );
170 }
else if ( ::strncmp(
"[CLID=", p1, 6 ) == 0 ) {
172 ::sscanf( p1 + 6,
"%08X", (
unsigned int*)&clid );
173 }
else if ( ::strncmp(
"[TECH=", p1, 6 ) == 0 ) {
175 ::sscanf( p1 + 6,
"%08X", (
unsigned int*)&technology );
185 msgSvc() <<
"Add link[" << i <<
"]:" << db << container <<
" [" << r.
dbase <<
"," << r.
container <<
"] " 186 <<
" tech:" <<
hex << setw( 8 ) << r.
svc <<
" CLID:" << setw( 8 ) << r.
clid <<
dec <<
endmsg;
Definition of the MsgStream class used to transmit messages.
int makeLink(std::string_view 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 & getDb(int which) const
Access database/file name from saved index.
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.
const std::string & getCont(int which) const
Access container name from saved index.
Description: PoolDbLinkManager class implementation definition.
This class is used for returning status codes from appropriate routines.
const std::string & path() const
Access to path of object.
Link * link(long id)
Retrieve symbolic link identified by ID.
const std::string & getLink(int which) const
Access link name from saved index.
long size() const
Retrieve number of link present.
constexpr static const auto FAILURE
void makeRef(const IRegistry &pA, RootRef &ref)
Create reference object from registry entry.
TFile * file() const
Direct access to TFile structure.
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...
Header file for std:chrono::duration-based Counters.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
T emplace_back(T... args)