1 #define ROOTHISTCNV_RCONVERTER_CPP 13 #include "TDirectory.h" 33 TDirectory* gDir = gDirectory;
36 if (
findTFile( loc, tf ).isSuccess() ) { tf->cd(); }
41 auto p = full.find(
":", 0 );
42 if ( p != std::string::npos ) {
43 fil = full.substr( 0, p );
46 gDirectory->cd( fil.
c_str() );
49 while ( ( p = full.find(
"/", i ) ) != std::string::npos ) {
50 s = full.substr( i, p - i );
56 if ( full.compare( 0, 1,
"/" ) == 0 ) gDirectory->cd(
"/" );
58 for (
const auto& litr : lpath ) {
60 if ( !gDirectory->GetKey( litr.c_str() ) ) { gDirectory->mkdir( litr.c_str() ); }
61 gDirectory->cd( litr.c_str() );
74 long lf1 = loc.
find(
"/NTUPLES/" );
75 long lf2 = loc.
find(
"/stat/" );
78 ll = loc.
find(
"/", lf1 + 9 );
80 }
else if ( lf2 != -1 ) {
81 ll = loc.
find(
"/", lf2 + 6 );
86 <<
" --> no leading /NTUPLES/ or /stat/" <<
endmsg;
104 return diskDirectory( loc );
117 if ( findTFile( loc, tf ).isSuccess() ) {
126 gDirectory->cd(
"/" );
127 while ( ( p = full.find(
"/", i ) ) != -1 ) {
128 sdir = full.substr( i, p - i );
129 if ( !gDirectory->GetKey( sdir.
c_str() ) ) {
130 log <<
MSG::ERROR <<
"cannot cd to " << full <<
" from " << gDirectory->GetPath() <<
endmsg;
133 gDirectory->cd( sdir.
c_str() );
137 gDirectory->cd( full.substr( i ).c_str() );
151 return gDirectory->GetPath();
165 (
unsigned long)( pTObj ), pTObj );
178 auto pA =
new RootObjAddress( repSvcType(), clid, rzdir, title, 0, 0, pTObj );
190 StatusCode status = createAddress( rzdir, clid, obj, pTobj, refpAddress );
192 unsigned long* ipar = (
unsigned long*)refpAddress->
ipar();
209 StatusCode status = dataMgr->objectParent( pReg, pParentReg );
213 TDirectory* pParentDir = (TDirectory*)pParAddr->
ipar()[0];
215 gDirectory->cd( pParentDir->GetPath() );
234 TDirectory* pParentDir = changeDirectory( pObject );
236 TObject* pTObj = createPersistent( pObject );
240 return createAddress( pObject, pParentDir,
nullptr, pAddr );
267 auto imap = s_fileMap.find(
id );
268 if ( imap != s_fileMap.end() ) {
273 s_fileMap[id] = const_cast<TFile*>( tfile );
289 i1 =
id.
find(
"/", 0 );
294 i2 =
id.find(
"/", i1 + 1 );
299 i3 =
id.find(
"/", i2 + 1 );
306 auto imap = s_fileMap.find( idm );
308 tfile = imap->second;
316 if (
id.
size() > 0 && isdigit(
id[0] ) ) {
320 forced = tmp.
value();
std::string getDirectory()
constexpr auto size(const T &, Args &&...) noexcept
Definition of the MsgStream class used to transmit messages.
std::string diskDirectory(const std::string &loc)
IRegistry * registry() const
Get pointer to Registry.
void setDirectory(const std::string &loc)
Implementation of property with value of concrete type.
StatusCode createRep(DataObject *pObj, IOpaqueAddress *&refpAddr) override
Convert the transient object to the requested representation.
constexpr static const auto SUCCESS
StatusCode regTFile(const std::string, const TFile *)
virtual const name_type & name() const =0
Name of the directory (or key)
StatusCode findTFile(const std::string, TFile *&)
const char *PyHelper() getProperty(IInterface *p, char *name)
StatusCode createDirectory(const std::string &loc)
TDirectory * changeDirectory(DataObject *pObject)
Switch to object directory (=Parent directory)
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
virtual TObject * createPersistent(DataObject *pObj)
Create the persistent representation of an object.
This class is used for returning status codes from appropriate routines.
const ValueType & value() const
Backward compatibility (.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
unsigned int CLID
Class ID definition.
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
std::string directory(const std::string &loc)
StatusCode error(const std::string &msg)
std::string convertId(const std::string &) const
constexpr static const auto FAILURE
virtual StatusCode readObject(IOpaqueAddress *pAddr, DataObject *&refpObj)
Create the transient representation of an object.
bool assign(const Details::PropertyBase &source) override
get the value from another property
Opaque address interface definition.
A DataObject is the base class of any identifiable object on any data store.
virtual const unsigned long * ipar() const =0
Access to generic link parameters.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
StatusCode createAddress(DataObject *pObject, TDirectory *pDir, TObject *pTObject, IOpaqueAddress *&refpAddr)
Create address of the transient object according to the requested representation.
void setDiskDirectory(const std::string &loc)