1 #ifndef GAUDIUTILS_MULTIFILECATALOG_H
2 #define GAUDIUTILS_MULTIFILECATALOG_H
27 template <
class T>
void _exec(T pmf)
const {
34 if ( !(result= ((*i)->*pmf)(arg1)).empty() )
break;
37 template <
class A1,
class F>
void _collect(A1 arg1,F pmf)
const {
41 arg1.insert(arg1.end(),tmp.begin(),tmp.end());
44 template <
class A1,
class A2,
class F>
void _collect(A1 arg1,A2& arg2,F pmf)
const {
47 ((*i)->*pmf)(arg1,tmp);
48 arg2.insert(arg2.end(),tmp.begin(),tmp.end());
67 virtual CSTR connectInfo()
const;
76 virtual bool readOnly()
const;
78 virtual bool dirty()
const;
84 {
return _find(pfn,&IFileCatalog::lookupPFN); }
90 {
return _find(lfn,&IFileCatalog::lookupLFN); }
93 {
return 0 !=
getCatalog(fid,
false,
false,
false); }
96 {
_collect(fid,files,&IFileCatalog::getPFN); }
99 {
_collect(fid,files,&IFileCatalog::getLFN); }
103 {
_collect(fids,&IFileCatalog::getFID); }
108 virtual void registerPFN(
CSTR fid,
CSTR pfn,
CSTR ftype)
const;
110 virtual void registerLFN(
CSTR fid,
CSTR lfn)
const;
116 {
_collect(fid,attr,&IFileCatalog::getMetaData); }
131 virtual IFileCatalog* findCatalog(
CSTR connect,
bool must_be_writable)
const;
133 virtual void addCatalog(
CSTR connect);
137 virtual void removeCatalog(
CSTR connect);
150 virtual void setWriteCatalog(
CSTR connect);
154 IFileCatalog* getCatalog(
CSTR fid,
bool throw_if_not,
bool writable=
true,
bool prt=
true)
const;
156 Catalogs::iterator i_findCatalog(
CSTR connect,
bool must_be_writable);
162 void printError(
CSTR msg,
bool throw_exc=
true)
const;