CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/CondCore/IOVService/interface/IOVService.h

Go to the documentation of this file.
00001 #ifndef CondCore_IOVService_IOVService_h
00002 #define CondCore_IOVService_IOVService_h
00003 #include <string>
00004 #include "CondCore/DBCommon/interface/Time.h"
00005 #include "CondCore/DBCommon/interface/DbSession.h"
00006 #include "CondFormats/Common/interface/IOVSequence.h"
00007 
00008 namespace cond{
00009 
00010   class IOVEditor;
00011   class IOVService{
00012   public:
00013 
00014     IOVService(cond::DbSession& dbSess);
00015     
00016     virtual ~IOVService();
00017 
00018     std::string payloadToken( const std::string& iovToken,
00019                               cond::Time_t currenttime );
00020 
00021     bool isValid( const std::string& iovToken,
00022                   cond::Time_t currenttime );
00023 
00024     std::pair<cond::Time_t, cond::Time_t>
00025     validity( const std::string& iovToken, cond::Time_t currenttime );
00026     
00027     std::set<std::string> payloadClasses( const std::string& iovtoken );
00028 
00029     int iovSize( const std::string& iovtoken );
00030 
00031     cond::TimeType timeType( const std::string& iovToken );
00032     
00033     void deleteAll( bool withPayload=false );
00034 
00035 
00040     IOVEditor* newIOVEditor( const std::string& token="" );
00041 
00047     std::string exportIOVWithPayload( cond::DbSession& destDB,
00048                                       const std::string& iovToken );
00054     std::string exportIOVRangeWithPayload( cond::DbSession& destDB,
00055                                            const std::string& iovToken,
00056                                            const std::string& destToken,
00057                                            cond::Time_t since,
00058                                            cond::Time_t till,
00059                                            bool outOfOrder
00060                                            );
00061     
00062   private:
00063     cond::IOVSequence const & iovSeq(const std::string& iovToken);
00064     
00065     cond::DbSession m_dbSess;
00066     std::string m_token;
00067     boost::shared_ptr<cond::IOVSequence> m_iov;
00068   };
00069 
00070 }//ns cond
00071 #endif