| # Gaudi Framework, version v20r2
Generated: 18 Jul 2008

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Search for |

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Gaudi::XMLFileCatalog Class Reference

`#include <XMLFileCatalog.h>`

Inheritance diagram for Gaudi::XMLFileCatalog:

[legend]
Collaboration diagram for Gaudi::XMLFileCatalog:

[legend]
List of all members.

## Detailed Description

This class constitutes the core of the XML based FileCatalog API for POOL.

It uses the DOM model and the external XercesC library for parsing.

Definition at line 25 of file XMLFileCatalog.h.

## Public Member Functions
| XMLFileCatalog (CSTR url, IMessageSvc *m)
| Create a catalog file, initialization of XercesC.
virtual | ~XMLFileCatalog ()
| Destructor,.
virtual unsigned long | addRef ()
| Increase reference count on catalog.
virtual unsigned long | release ()
| release catalog
virtual StatusCode | queryInterface (const InterfaceID &id, void **ppv)
| Query interface.
virtual std::string | createFID () const
| Create file identifier using UUID mechanism.
virtual CSTR | connectInfo () const
| Access to connect string.
virtual void | init ()
| Parse the DOM tree of the XML catalog.
virtual void | commit ()
| Save DOM catalog to file.
virtual void | rollback ()
| Save DOM catalog to file.
virtual bool | readOnly () const
| Check if the catalog is read-only.
virtual bool | dirty () const
| Check if the catalog should be updated.
virtual bool | existsPFN (CSTR pfn) const
| Return the status of a physical file name.
virtual std::string | lookupPFN (CSTR fid) const
| Lookup file identifier by physical file name.
virtual bool | existsLFN (CSTR lfn) const
| Return the status of a logical file name.
virtual std::string | lookupLFN (CSTR lfn) const
| Lookup file identifier by logical file name.
virtual bool | existsFID (CSTR fid) const
| Return the status of a 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 void | getLFN (CSTR fid, Files &files) const
| Dump all logical file names of the catalog associate to the FileID.
virtual void | getFID (Strings &fids) const
| Dump all file Identifiers.
virtual void | deleteFID (CSTR FileID) const
| Delete FileID Node from the catalog.
virtual void | registerPFN (CSTR fid, CSTR pfn, CSTR ftype) const
| Create a FileID and Node of the physical file name with all the attributes.
virtual void | registerLFN (CSTR fid, CSTR lfn) const
| Create a FileID and Node of the logical file name with all the attributes.
virtual void | registerFID (CSTR fid) const
| Create a FileID and Node.
virtual void | getMetaData (CSTR fid, Attributes &attr) const
| Dump all MetaData of the catalog for a given file ID.
virtual std::string | getMetaDataItem (CSTR fid, CSTR name) const
| Access metadata item.
virtual void | setMetaData (CSTR fid, CSTR name, CSTR value) const
| Insert/update metadata item.
virtual void | dropMetaData (CSTR fid) const
| Drop all metadata of one FID.
virtual void | dropMetaData (CSTR fid, CSTR attr) const
| Drop specified metadata item.
## Protected Types
typedef const std::string & | CSTR
## Private Member Functions
xercesc::DOMDocument * | getDoc (bool throw_if_no_exists=true) const
std::string | getfile (bool create)
void | printError (CSTR msg, bool throw_exc=true) const
std::string | lookupFID (CSTR lfn) const
xercesc::DOMNode * | element (CSTR fid, bool print_err=true) const
xercesc::DOMNode * | child (xercesc::DOMNode *par, CSTR tag, CSTR attr="", CSTR val="") const
std::pair< xercesc::DOMElement *, xercesc::DOMElement * > | i_registerFID (CSTR fid) const
## Private Attributes
bool | m_rdOnly
bool | m_update
xercesc::DOMDocument * | m_doc
xercesc::XercesDOMParser * | m_parser
xercesc::ErrorHandler * | m_errHdlr
std::string | m_file
unsigned long | m_refCount
IMessageSvc * | m_msgSvc

## Member Typedef Documentation

typedef const std::string& Gaudi::XMLFileCatalog::CSTR`[protected]`

Definition at line 27 of file XMLFileCatalog.h.

## Constructor & Destructor Documentation

Gaudi::XMLFileCatalog::XMLFileCatalog | ( | CSTR | url,
|  | IMessageSvc * | m |
| ) |  |  |

Create a catalog file, initialization of XercesC.

virtual Gaudi::XMLFileCatalog::~XMLFileCatalog | ( |  | ) | `[virtual]`

Destructor,.

## Member Function Documentation

virtual unsigned long Gaudi::XMLFileCatalog::addRef | ( |  | ) | `[virtual]`

Increase reference count on catalog.

Implements IInterface.

virtual unsigned long Gaudi::XMLFileCatalog::release | ( |  | ) | `[virtual]`

release catalog

Implements IInterface.

virtual StatusCode Gaudi::XMLFileCatalog::queryInterface | ( | const InterfaceID & | id,
|  | void ** | ppv |
| ) |  |  | `[virtual]`

Query interface.

Implements IInterface.

virtual std::string Gaudi::XMLFileCatalog::createFID | ( |  | ) | const`[virtual]`

Create file identifier using UUID mechanism.

Implements Gaudi::IFileCatalog.

virtual CSTR Gaudi::XMLFileCatalog::connectInfo | ( |  | ) | const`[inline, virtual]`

Access to connect string.

Implements Gaudi::IFileCatalog.

Definition at line 47 of file XMLFileCatalog.h.

References connectInfo(), and m_file.

Referenced by connectInfo().

    00047 { return m_file;                 }

virtual void Gaudi::XMLFileCatalog::init | ( |  | ) | `[virtual]`

Parse the DOM tree of the XML catalog.

Implements Gaudi::IFileCatalog.

Referenced by rollback().

virtual void Gaudi::XMLFileCatalog::commit | ( |  | ) | `[virtual]`

Save DOM catalog to file.

Implements Gaudi::IFileCatalog.

virtual void Gaudi::XMLFileCatalog::rollback | ( |  | ) | `[inline, virtual]`

Save DOM catalog to file.

Implements Gaudi::IFileCatalog.

Definition at line 53 of file XMLFileCatalog.h.

References dirty(), init(), and rollback().

Referenced by rollback().

    00053 { if ( dirty() )  init();        }

virtual bool Gaudi::XMLFileCatalog::readOnly | ( |  | ) | const`[inline, virtual]`

Check if the catalog is read-only.

Implements Gaudi::IFileCatalog.

Definition at line 55 of file XMLFileCatalog.h.

References m_rdOnly, and readOnly().

Referenced by readOnly().

    00055 { return m_rdOnly;                }

virtual bool Gaudi::XMLFileCatalog::dirty | ( |  | ) | const`[inline, virtual]`

Check if the catalog should be updated.

Implements Gaudi::IFileCatalog.

Definition at line 57 of file XMLFileCatalog.h.

References dirty(), and m_update.

Referenced by dirty(), and rollback().

    00057 { return m_update;                }

virtual bool Gaudi::XMLFileCatalog::existsPFN | ( | CSTR | pfn | ) | const`[inline, virtual]`

Return the status of a physical file name.

Definition at line 59 of file XMLFileCatalog.h.

References element(), and existsPFN().

Referenced by existsPFN().

    00059 { return element(pfn,false) != 0; }

virtual std::string Gaudi::XMLFileCatalog::lookupPFN | ( | CSTR | fid | ) | const`[inline, virtual]`

Lookup file identifier by physical file name.

Definition at line 61 of file XMLFileCatalog.h.

References lookupFID(), and lookupPFN().

Referenced by lookupPFN().

    00061 { return lookupFID(fid);          }

virtual bool Gaudi::XMLFileCatalog::existsLFN | ( | CSTR | lfn | ) | const`[inline, virtual]`

Return the status of a logical file name.

Definition at line 63 of file XMLFileCatalog.h.

References element(), and existsLFN().

Referenced by existsLFN().

    00063 { return element(lfn,false) != 0; }

virtual std::string Gaudi::XMLFileCatalog::lookupLFN | ( | CSTR | lfn | ) | const`[inline, virtual]`

Lookup file identifier by logical file name.

Definition at line 65 of file XMLFileCatalog.h.

References lookupFID(), and lookupLFN().

Referenced by lookupLFN().

    00065 { return lookupFID(lfn);          }

virtual bool Gaudi::XMLFileCatalog::existsFID | ( | CSTR | fid | ) | const`[inline, virtual]`

Return the status of a FileID.

Definition at line 67 of file XMLFileCatalog.h.

References element(), and existsFID().

Referenced by existsFID().

    00067 { return element(fid,false) != 0; }

virtual void Gaudi::XMLFileCatalog::getPFN | ( | CSTR | fid,
|  | Files & | files |
| ) |  |  | const`[virtual]`

Dump all physical file names of the catalog and their attributes associate to the FileID.

virtual void Gaudi::XMLFileCatalog::getLFN | ( | CSTR | fid,
|  | Files & | files |
| ) |  |  | const`[virtual]`

Dump all logical file names of the catalog associate to the FileID.

virtual void Gaudi::XMLFileCatalog::getFID | ( | Strings & | fids | ) | const`[virtual]`

Dump all file Identifiers.

Implements Gaudi::IFileCatalog.

virtual void Gaudi::XMLFileCatalog::deleteFID | ( | CSTR | FileID | ) | const`[virtual]`

Delete FileID Node from the catalog.

virtual void Gaudi::XMLFileCatalog::registerPFN | ( | CSTR | fid,
|  | CSTR | pfn,
|  | CSTR | ftype |
| ) |  |  | const`[virtual]`

Create a FileID and Node of the physical file name with all the attributes.

virtual void Gaudi::XMLFileCatalog::registerLFN | ( | CSTR | fid,
|  | CSTR | lfn |
| ) |  |  | const`[virtual]`

Create a FileID and Node of the logical file name with all the attributes.

virtual void Gaudi::XMLFileCatalog::registerFID | ( | CSTR | fid | ) | const`[virtual]`

Create a FileID and Node.

virtual void Gaudi::XMLFileCatalog::getMetaData | ( | CSTR | fid,
|  | Attributes & | attr |
| ) |  |  | const`[virtual]`

Dump all MetaData of the catalog for a given file ID.

virtual std::string Gaudi::XMLFileCatalog::getMetaDataItem | ( | CSTR | fid,
|  | CSTR | name |
| ) |  |  | const`[virtual]`

Access metadata item.

virtual void Gaudi::XMLFileCatalog::setMetaData | ( | CSTR | fid,
|  | CSTR | name,
|  | CSTR | value |
| ) |  |  | const`[virtual]`

Insert/update metadata item.

virtual void Gaudi::XMLFileCatalog::dropMetaData | ( | CSTR | fid | ) | const`[inline, virtual]`

Drop all metadata of one FID.

Definition at line 89 of file XMLFileCatalog.h.

References dropMetaData().

Referenced by dropMetaData().

    00089 {   dropMetaData(fid,"*");   }

virtual void Gaudi::XMLFileCatalog::dropMetaData | ( | CSTR | fid,
|  | CSTR | attr |
| ) |  |  | const`[virtual]`

Drop specified metadata item.

xercesc::DOMDocument* Gaudi::XMLFileCatalog::getDoc | ( | bool | throw_if_no_exists = `true` | ) | const`[private]`

std::string Gaudi::XMLFileCatalog::getfile | ( | bool | create | ) | `[private]`

void Gaudi::XMLFileCatalog::printError | ( | CSTR | msg,
|  | bool | throw_exc = `true` |
| ) |  |  | const`[private]`

std::string Gaudi::XMLFileCatalog::lookupFID | ( | CSTR | lfn | ) | const`[private]`

Referenced by lookupLFN(), and lookupPFN().

xercesc::DOMNode* Gaudi::XMLFileCatalog::element | ( | CSTR | fid,
|  | bool | print_err = `true` |
| ) |  |  | const`[private]`

Referenced by existsFID(), existsLFN(), and existsPFN().

xercesc::DOMNode* Gaudi::XMLFileCatalog::child | ( | xercesc::DOMNode * | par,
|  | CSTR | tag,
|  | CSTR | attr = `""`,
|  | CSTR | val = `""` |
| ) |  |  | const`[private]`

std::pair<xercesc::DOMElement*, xercesc::DOMElement*> Gaudi::XMLFileCatalog::i_registerFID | ( | CSTR | fid | ) | const`[private]`

## Member Data Documentation

bool Gaudi::XMLFileCatalog::m_rdOnly`[private]`

Definition at line 100 of file XMLFileCatalog.h.

Referenced by readOnly().

bool Gaudi::XMLFileCatalog::m_update`[mutable, private]`

Definition at line 101 of file XMLFileCatalog.h.

Referenced by dirty().

xercesc::DOMDocument* Gaudi::XMLFileCatalog::m_doc`[private]`

Definition at line 102 of file XMLFileCatalog.h.

xercesc::XercesDOMParser* Gaudi::XMLFileCatalog::m_parser`[private]`

Definition at line 103 of file XMLFileCatalog.h.

xercesc::ErrorHandler* Gaudi::XMLFileCatalog::m_errHdlr`[private]`

Definition at line 104 of file XMLFileCatalog.h.

std::string Gaudi::XMLFileCatalog::m_file`[private]`

Definition at line 105 of file XMLFileCatalog.h.

Referenced by connectInfo().

unsigned long Gaudi::XMLFileCatalog::m_refCount`[private]`

Definition at line 106 of file XMLFileCatalog.h.

IMessageSvc* Gaudi::XMLFileCatalog::m_msgSvc`[private]`

Definition at line 107 of file XMLFileCatalog.h.

The documentation for this class was generated from the following file:

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v20r2/GaudiUtils/v2r0/src/component/XMLFileCatalog.h