CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
StorageFactory.h
Go to the documentation of this file.
1 #ifndef STORAGE_FACTORY_STORAGE_FACTORY_H
2 # define STORAGE_FACTORY_STORAGE_FACTORY_H
3 
8 # include <string>
9 #include <memory>
10 #include "tbb/concurrent_unordered_map.h"
11 
12 class Storage;
14 {
15 public:
16  enum CacheHint
17  {
22  };
23 
24  enum ReadHint
25  {
29  };
30 
31  static StorageFactory *get (void);
32  ~StorageFactory (void);
33 
34  // implicit copy constructor
35  // implicit assignment operator
36 
38  CacheHint cacheHint(void) const;
39 
41  ReadHint readHint(void) const;
42 
43  bool enableAccounting (bool enabled);
44  bool accounting (void) const;
45 
46  void setTimeout(unsigned int timeout);
47  unsigned int timeout(void) const;
48 
49  void setDebugLevel(unsigned int level);
50  unsigned int debugLevel(void) const;
51 
52  void setTempDir (const std::string &s, double minFreeSpace);
53  std::string tempDir (void) const;
54  std::string tempPath (void) const;
55  double tempMinFree (void) const;
56 
57  void stagein (const std::string &url);
58  Storage * open (const std::string &url,
59  int mode = IOFlags::OpenRead);
60  bool check (const std::string &url,
61  IOOffset *size = 0);
62  void activateTimeout (const std::string &url);
63 
65  const std::string &proto,
66  const std::string &path,
67  int mode);
68 
69 private:
70  typedef tbb::concurrent_unordered_map<std::string, std::shared_ptr<StorageMaker>> MakerTable;
71 
72  StorageFactory (void);
73  StorageMaker *getMaker (const std::string &proto);
75  std::string &protocol,
76  std::string &rest);
77 
82  double m_tempfree;
85  unsigned int m_timeout;
86  unsigned int m_debugLevel;
89 };
90 
91 #endif // STORAGE_FACTORY_STORAGE_FACTORY_H
CacheHint cacheHint(void) const
void stagein(const std::string &url)
bool enableAccounting(bool enabled)
std::string tempPath(void) const
void setTimeout(unsigned int timeout)
std::string m_tempdir
void setReadHint(ReadHint value)
Storage * open(const std::string &url, int mode=IOFlags::OpenRead)
bool check(const std::string &url, IOOffset *size=0)
ReadHint m_readHint
unsigned int m_debugLevel
StorageMaker * getMaker(const std::string &proto)
double tempMinFree(void) const
Storage * wrapNonLocalFile(Storage *s, const std::string &proto, const std::string &path, int mode)
tuple path
else: Piece not in the list, fine.
std::string tempDir(void) const
unsigned int timeout(void) const
void setDebugLevel(unsigned int level)
CacheHint m_cacheHint
std::string m_temppath
ReadHint readHint(void) const
int64_t IOOffset
Definition: IOTypes.h:19
bool accounting(void) const
void setTempDir(const std::string &s, double minFreeSpace)
static StorageFactory s_instance
void setCacheHint(CacheHint value)
unsigned int m_timeout
void activateTimeout(const std::string &url)
tbb::concurrent_unordered_map< std::string, std::shared_ptr< StorageMaker > > MakerTable
tuple level
Definition: testEve_cfg.py:34
MakerTable m_makers
LocalFileSystem m_lfs
tuple size
Write out results.
unsigned int debugLevel(void) const