Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:16:05

0001 #ifndef SPHENIXNPC_CDBUTILS_H
0002 #define SPHENIXNPC_CDBUTILS_H
0003 
0004 #include <cstdint>  // for uint64_t
0005 #include <set>
0006 #include <string>
0007 
0008 class SphenixClient;
0009 
0010 class CDBUtils
0011 {
0012  public:
0013   CDBUtils();
0014   explicit CDBUtils(const std::string &globaltag);
0015 
0016   // delete copy ctor and assignment operator (cppcheck)
0017   explicit CDBUtils(const CDBUtils &) = delete;
0018   CDBUtils &operator=(const CDBUtils &) = delete;
0019 
0020   virtual ~CDBUtils() = default;
0021   int createGlobalTag(const std::string &tagname);
0022   int setGlobalTag(const std::string &tagname);
0023   int lockGlobalTag(const std::string &tagname);
0024   int unlockGlobalTag(const std::string &tagname);
0025   int createPayloadType(const std::string &domain);
0026   std::string getUrl(const std::string &type, uint64_t iov);
0027   int insertPayload(const std::string &pl_type, const std::string &file_url, uint64_t iov_start);
0028   int insertPayload(const std::string &pl_type, const std::string &file_url, uint64_t iov_start, uint64_t iov_end);
0029   int cloneGlobalTag(const std::string &source, const std::string &target);
0030 
0031   int deleteGlobalTag(const std::string &);
0032   void listGlobalTags();
0033   void listPayloadTypes();
0034   void listPayloadIOVs(uint64_t iov);
0035   void clearCache();
0036   bool isGlobalTagSet();
0037   void Verbosity(int i);
0038   int Verbosity() const { return m_Verbosity; }
0039   int deletePayloadIOV(const std::string &pl_type, uint64_t iov_start);
0040   int deletePayloadIOV(const std::string &pl_type, uint64_t iov_start, uint64_t iov_end);
0041 
0042  private:
0043   int m_Verbosity = 0;
0044   SphenixClient *cdbclient = nullptr;
0045   std::string m_CachedGlobalTag;
0046   std::set<std::string> m_PayloadTypeCache;
0047 };
0048 
0049 #endif  // SPHENIXNPC_CDBUTILS_H