Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:13

0001 #ifndef IOPool_TFileAdaptor_TFileAdaptor_h
0002 #define IOPool_TFileAdaptor_TFileAdaptor_h
0003 
0004 #include "FWCore/Utilities/interface/propagate_const.h"
0005 
0006 #include <map>
0007 #include <memory>
0008 #include <string>
0009 #include <vector>
0010 
0011 class TPluginManager;
0012 
0013 namespace edm {
0014   class ActivityRegistry;
0015   class ConfigurationDescriptions;
0016   class ParameterSet;
0017 }  // namespace edm
0018 
0019 // Driver for configuring ROOT plug-in manager to use TStorageFactoryFile.
0020 class TFileAdaptor {
0021 public:
0022   TFileAdaptor(edm::ParameterSet const& pset, edm::ActivityRegistry& ar);
0023 
0024   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0025 
0026   friend class TFileAdaptorUI;
0027 
0028 private:
0029   // Write current Storage statistics on a ostream
0030   void termination(void) const;
0031 
0032   //Called by TFileAdaptorUI
0033   void stats(std::ostream& o) const;
0034 
0035   void statsXML(std::map<std::string, std::string>& data) const;
0036 
0037   static void addType(TPluginManager* mgr, char const* type, int altType = 0);
0038   bool native(char const* proto) const;
0039 
0040   bool enabled_;
0041   bool doStats_;
0042   bool enablePrefetching_;
0043   std::string cacheHint_;
0044   std::string readHint_;
0045   std::string tempDir_;
0046   double minFree_;
0047   unsigned int timeout_;
0048   unsigned int debugLevel_;
0049   std::vector<std::string> native_;
0050 };
0051 
0052 namespace edm {
0053   namespace service {
0054     inline bool isProcessWideService(TFileAdaptor const*) { return true; }
0055   }  // namespace service
0056 }  // namespace edm
0057 
0058 /*
0059  * wrapper to bind TFileAdaptor to root, python etc
0060  * loading IOPoolTFileAdaptor library and instantiating
0061  * TFileAdaptorUI will make root to use StorageAdaptor for I/O instead
0062  * of its own plugins
0063  */
0064 
0065 class TFileAdaptorUI {
0066 public:
0067   TFileAdaptorUI();
0068   ~TFileAdaptorUI();
0069 
0070   // print current Storage statistics on cout
0071   void stats() const;
0072 
0073 private:
0074   edm::propagate_const<std::shared_ptr<TFileAdaptor>> me;
0075 };
0076 
0077 #endif