Main Page
Namespaces
Classes
Package Documentation
CVS Directory
WorkBook
Offline Guide
Release schedule
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
Utilities
StorageFactory
src
StorageMaker.cc
Go to the documentation of this file.
1
#include "
Utilities/StorageFactory/interface/StorageMaker.h
"
2
#include "
Utilities/StorageFactory/interface/Storage.h
"
3
#include "
Utilities/StorageFactory/interface/IOFlags.h
"
4
#include <cstdlib>
5
6
StorageMaker::StorageMaker
(
void
)
7
{}
8
9
StorageMaker::~StorageMaker
(
void
)
10
{}
11
12
void
13
StorageMaker::stagein
(
const
std::string &proto,
14
const
std::string &
path
)
15
{}
16
17
void
18
StorageMaker::setTimeout
(
unsigned
int
timeout)
19
{}
20
21
bool
22
StorageMaker::check
(
const
std::string &proto,
23
const
std::string &
path
,
24
IOOffset
*
size
/* = 0 */
)
25
{
26
// Fallback method is to open the file and check its
27
// size. Because grid jobs run in a directory where
28
// there is usually more space than in /tmp, and that
29
// directory is automatically cleaned up, open up the
30
// temporary files in the current directory. If the
31
// file is downloaded, it will delete itself in the
32
// destructor or close method.
33
bool
found
=
false
;
34
int
mode
=
IOFlags::OpenRead
|
IOFlags::OpenUnbuffered
;
35
if
(
Storage
*
s
=
open
(proto, path, mode))
36
{
37
if
(size)
38
*size =
s
->size ();
39
40
s
->close ();
41
delete
s
;
42
43
found =
true
;
44
}
45
46
return
found
;
47
}
IOFlags::OpenUnbuffered
Definition:
IOFlags.h:22
Storage
Definition:
Storage.h:8
StorageMaker::open
virtual Storage * open(const std::string &proto, const std::string &path, int mode)=0
path
int path() const
Definition:
HLTadd.h:3
StorageMaker::check
virtual bool check(const std::string &proto, const std::string &path, IOOffset *size=0)
Definition:
StorageMaker.cc:22
Storage.h
StorageMaker::setTimeout
virtual void setTimeout(unsigned int timeout)
Definition:
StorageMaker.cc:18
StorageMaker::StorageMaker
StorageMaker(void)
Definition:
StorageMaker.cc:6
StorageMaker::stagein
virtual void stagein(const std::string &proto, const std::string &path)
Definition:
StorageMaker.cc:13
IOFlags::OpenRead
Definition:
IOFlags.h:9
IOFlags.h
mode
int mode
Definition:
AMPTWrapper.h:139
IOOffset
int64_t IOOffset
Definition:
IOTypes.h:19
asciidump.s
string s
Definition:
asciidump.py:422
newFWLiteAna.found
found
Definition:
newFWLiteAna.py:118
StorageMaker.h
findQualityFiles.size
tuple size
Write out results.
Definition:
findQualityFiles.py:322
StorageMaker::~StorageMaker
virtual ~StorageMaker(void)
Definition:
StorageMaker.cc:9
Generated for CMSSW Reference Manual by
1.8.5