CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/CondCore/MetaDataService/interface/MetaData.h

Go to the documentation of this file.
00001 #ifndef CondCore_MetaDataService_METADATA_H
00002 #define CondCore_MetaDataService_METADATA_H
00003 #include <string>
00004 #include <vector>
00005 #include "CondCore/DBCommon/interface/Time.h"
00006 #include "CondCore/DBCommon/interface/DbSession.h"
00007 #include "MetaDataEntry.h"
00008 //
00009 // Package:     MetaDataService
00010 // Class  :     MetaData
00011 // 
00015 //
00016 // Author:      Zhen Xie
00017 //
00018 namespace cond{
00019   class MetaData {
00020   public:
00021     // constructor
00022     explicit MetaData( cond::DbSession& userSession );
00023     // destructor
00024     ~MetaData();
00025     // add metadata entry
00026     bool addMapping(const std::string& name, const std::string& token,cond::TimeType timetype=cond::runnumber);
00027     // replace iov token associated with a given tag
00028     //bool replaceToken(const std::string& name, const std::string& newtoken);
00029     // if given iov tag exists
00030     bool hasTag( const std::string& name ) const;
00031     // list all tags
00032     void listAllTags( std::vector<std::string>& result ) const;
00033     // list all entries in the metadata table
00034     //void listAllEntries( std::vector<cond::MetaDataEntry>& result ) const;
00035     // get iov token associated with given tag
00036     const std::string getToken( const std::string& tagname ) const;
00037     // get the metadata table entry by tag name
00038     //void getEntryByTag( const std::string& tagname, cond::MetaDataEntry& result )const;
00039     // delete all entries in the metadata table
00040     void deleteAllEntries();
00041     // delete metadata entry selected by iov token
00042     //void deleteEntryByToken( const std::string& token );
00043     // delete metadata entry selected by tag name
00044     void deleteEntryByTag( const std::string& tag );
00045   private:
00046     // create metadata table
00047     //void createTable(const std::string& tabname);
00048     mutable cond::DbSession m_userSession;
00049   };
00050 }
00051 #endif
00052