// DataHeaderList.h #ifndef dial__DataHeaderList_H #define dial__DataHeaderList_H // Provides access to the data headers in an ATLAS-POOL // collection. // // Usage: // DataHeaderList dhl("mycoll"); // DataHeaderList::Iterator idh = dhl.iterator(); // while ( idh.isValid() ) { // const DataHeader& dh = *idh; // cout << dh << endl; // } #ifndef __CINT__ #include "SGTools/DataHeader.h" #include "Collection/Collection.h" #endif namespace pool { class IFileCatalog; class IDataSvc; } namespace dset { class DataHeaderList { public: // typedefs #ifndef __CINT__ typedef pool::Collection DHCollection; typedef DHCollection::Iterator Iterator; #endif private: // data // Validity. int m_error; // POOL stuff. #ifndef __CINT__ pool::IFileCatalog* m_pfc; pool::IDataSvc* m_pds; DHCollection* m_pcol; #else int* m_pfc; int* m_pds; int* m_pcol; #endif // Names of the DB (file), collection and file catalog. // We assume an implicit collection. std::string m_dbname; std::string m_collname; std::string m_catname; // Directory for temporary files. // This is deleted in in destructor if not blank. std::string m_tmpdir; public: // methods // Constructor. // dbname = name of the DB (file) holding the implicit collection // catname = name of the XML catalog holding this file // If blank, "POOLContainer_DataHeader" // collname = name of the collection in the file // If blank, a temporary catalog is created and then // deleted by the destructor DataHeaderList(std::string dbname, std::string catname ="", std::string catname =""); // Destructor. ~DataHeaderList(); // Validity. bool is_valid() const; // Error code. int error() const; // Return the DB (file) name. std::string database_name() const; // Return the collection name. std::string collection_name() const; // Return the file catalog name. std::string file_catalog_name() const; #ifndef __CINT__ // Return the POOL data service. pool::IDataSvc* data_service() const; // Return an iterator. Iterator iterator() const; #endif }; } // end namespace dial // Output stream. std::ostream& operator<<(std::ostream& lhs, const dset::DataHeaderList& rhs); #endif