1 #ifndef GAUDIUTILS_MULTIFILECATALOG_H
2 #define GAUDIUTILS_MULTIFILECATALOG_H
27 typedef const std::string&
CSTR;
31 template <
class T>
void _exec(T pmf)
const {
35 template <
class A1,
class F> std::string
_find(A1& arg1,F pmf)
const {
38 if ( !(result= ((*i)->*pmf)(arg1)).empty() )
break;
41 template <
class A1,
class F>
void _collect(A1 arg1,F pmf)
const {
45 arg1.insert(arg1.end(),tmp.begin(),tmp.end());
48 template <
class A1,
class A2,
class F>
void _collect(A1 arg1,A2& arg2,F pmf)
const {
51 ((*i)->*pmf)(arg1,tmp);
52 arg2.insert(arg2.end(),tmp.begin(),tmp.end());
82 virtual bool dirty()
const;
97 {
return 0 !=
getCatalog(fid,
false,
false,
false); }
virtual void setMetaData(const std::string &fid, const std::string &name, const std::string &value) const =0
Insert/update metadata item.
MultiFileCatalog(const std::string &nam, ISvcLocator *svc)
Create a catalog file, initialization of XercesC.
virtual void getPFN(const std::string &fid, Files &files) const =0
Dump all PFNames of the catalog and their attributes associate to the FileID.
virtual void getPFN(CSTR fid, Files &files) const
Dump all physical file names of the catalog and their attributes associate to the FileID...
virtual const Catalogs & catalogs() const
Access catalog container (CONST)
virtual void rollback()
Save DOM catalog to file.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
bool m_started
Flag to indicate if catalog is started.
virtual bool existsLFN(CSTR lfn) const
Return the status of a logical file name.
virtual void commit()
Save DOM catalog to file.
virtual StatusCode initialize()
IService implementation.
void _collect(A1 arg1, F pmf) const
virtual std::string lookupLFN(const std::string &lfn) const =0
Lookup file identifier by physical file name.
virtual Catalogs & catalogs()
Access catalog container.
virtual void registerFID(const std::string &fid) const =0
Create a Node for a FileID and DOM Node.
virtual std::string getMetaDataItem(CSTR fid, CSTR name) const
Access metadata item.
virtual std::string lookupPFN(const std::string &lfn) const =0
Lookup file identifier by physical file name.
virtual ~MultiFileCatalog()
Destructor,.
virtual void getFID(Strings &fids) const
Dump all file Identifiers.
void printError(CSTR msg, bool throw_exc=true) const
virtual void removeCatalog(CSTR connect)
Remove catalog identified by name from the existing ones.
virtual void getMetaData(const std::string &fid, Attributes &attr) const =0
Dump all MetaData of the catalog for a given file ID.
virtual void commit()=0
Save catalog to file.
virtual void getMetaData(CSTR fid, Attributes &attr) const
Dump all MetaData of the catalog for a given file ID.
virtual void deleteFID(CSTR fid) const
Delete FileID from the catalog.
void propHandler(Property &)
simple property handle to allow interactive modification of list of the file catalogs ...
std::string lookupFID(CSTR lfn) const
virtual void setMetaData(CSTR fid, CSTR attr, CSTR val) const
Insert/update metadata item.
virtual StatusCode finalize()
Finalize service object.
Base class used to extend a class implementing other interfaces.
virtual void getFID(Strings &fids) const =0
Dump all file Identifiers.
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
virtual bool existsPFN(CSTR pfn) const
Return the status of physical file name.
virtual void setWriteCatalog(IFileCatalog *cat)
Define the writable catalog identified by reference.
Catalogs::iterator i_findCatalog(CSTR connect, bool must_be_writable)
Find catalog by connect string.
IFileCatalog * getCatalog(CSTR fid, bool throw_if_not, bool writable=true, bool prt=true) const
Find catalog containing a given file identifier.
CatalogNames m_catalogNames
Property : Container with catalog names.
Catalogs m_catalogs
Container with references to known catalogs.
This class is used for returning status codes from appropriate routines.
virtual void getLFN(const std::string &fid, Files &files) const =0
Dump all LFNames of the catalog associate to the FileID.
virtual IFileCatalog * findCatalog(CSTR connect, bool must_be_writable) const
Catalog management.
std::string _find(A1 &arg1, F pmf) const
virtual IFileCatalog * writeCatalog(CSTR fid="") const
Access to the (first) writable file catalog.
virtual std::string lookupLFN(CSTR lfn) const
Lookup file identifier by logical file name.
virtual void deleteFID(const std::string &FileID) const =0
Delete FileID Node from the catalog.
virtual std::string lookupPFN(CSTR pfn) const
Lookup file identifier by physical file name.
virtual const std::string & name() const
Retrieve name of the service.
std::vector< IFileCatalog * > Catalogs
virtual bool dirty() const
Check if the catalog should be updated.
virtual void registerFID(CSTR fid) const
Create a FileID and DOM Node.
Property base class allowing Property* collections to be "homogeneous".
virtual void dropMetaData(CSTR fid) const
Drop all metadata of one FID.
virtual void addCatalog(CSTR connect)
Add new catalog identified by name to the existing ones.
virtual CSTR connectInfo() const
Access to connect string.
CatalogNames m_oldNames
BACKUP:: Container with catalog names.
virtual void dropMetaData(const std::string &fid) const =0
Drop all metadata of one FID.
virtual bool readOnly() const
Check if the catalog is read-only.
virtual void rollback()=0
Save catalog to file.
virtual std::string createFID() const
Catalog interface.
std::vector< std::string > CatalogNames
virtual bool existsFID(CSTR fid) const
Return the status of a FileID.
virtual void init()
Parse the DOM tree of the XML catalog.
virtual void init()=0
Parse the DOM tree of the XML catalog.
This is a number of static methods for bootstrapping the Gaudi framework.
void _collect(A1 arg1, A2 &arg2, F pmf) const
virtual void registerLFN(CSTR fid, CSTR lfn) const
Create a FileID and DOM Node of the LFN with all the attributes.
Gaudi::PluginService::Factory2< IService *, const std::string &, ISvcLocator * > Factory
virtual void registerPFN(CSTR fid, CSTR pfn, CSTR ftype) const
Create a FileID and DOM Node of the PFN with all the attributes.
virtual void getLFN(CSTR fid, Files &files) const
Dump all logical file names of the catalog associate to the FileID.
virtual void dropMetaData(CSTR fid, CSTR attr) const
Drop specified metadata item.
This class constitutes the core of the XML based FileCatalog API for using POOL within Gaudi...