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 <map>
10 
11 class Storage;
13 {
14 public:
15  enum CacheHint
16  {
21  };
22 
23  enum ReadHint
24  {
28  };
29 
30  static StorageFactory *get (void);
31  ~StorageFactory (void);
32 
33  // implicit copy constructor
34  // implicit assignment operator
35 
37  CacheHint cacheHint(void) const;
38 
40  ReadHint readHint(void) const;
41 
42  bool enableAccounting (bool enabled);
43  bool accounting (void) const;
44 
45  void setTimeout(unsigned int timeout);
46  unsigned int timeout(void) const;
47 
48  void setDebugLevel(unsigned int level);
49  unsigned int debugLevel(void) const;
50 
51  void setTempDir (const std::string &s, double minFreeSpace);
52  std::string tempDir (void) const;
53  std::string tempPath (void) const;
54  double tempMinFree (void) const;
55 
56  void stagein (const std::string &url);
57  Storage * open (const std::string &url,
58  int mode = IOFlags::OpenRead);
59  bool check (const std::string &url,
60  IOOffset *size = 0);
61  void activateTimeout (const std::string &url);
62 
64  const std::string &proto,
65  const std::string &path,
66  int mode);
67 
68 protected:
69  typedef std::map<std::string, StorageMaker *> MakerTable;
70 
71  StorageFactory (void);
72  StorageMaker *getMaker (const std::string &proto);
74  std::string &protocol,
75  std::string &rest);
76 
81  double m_tempfree;
84  unsigned int m_timeout;
85  unsigned int m_debugLevel;
88 };
89 
90 #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
std::map< std::string, StorageMaker * > MakerTable
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)
tuple level
Definition: testEve_cfg.py:34
MakerTable m_makers
LocalFileSystem m_lfs
tuple size
Write out results.
unsigned int debugLevel(void) const