CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
LocalStorageMaker Class Reference
Inheritance diagram for LocalStorageMaker:
StorageMaker

Public Member Functions

virtual bool check (const std::string &, const std::string &path, IOOffset *size=0)
 
virtual Storageopen (const std::string &proto, const std::string &path, int mode)
 
- Public Member Functions inherited from StorageMaker
virtual void setDebugLevel (unsigned int debugLevel)
 
virtual void setTimeout (unsigned int timeout)
 
virtual void stagein (const std::string &proto, const std::string &path)
 
 StorageMaker (void)
 
virtual ~StorageMaker (void)
 

Detailed Description

Definition at line 11 of file LocalStorageMaker.cc.

Member Function Documentation

virtual bool LocalStorageMaker::check ( const std::string &  ,
const std::string &  path,
IOOffset size = 0 
)
inlinevirtual

Reimplemented from StorageMaker.

Definition at line 32 of file LocalStorageMaker.cc.

References findQualityFiles::size.

35  {
36  struct stat st;
37  if (stat (path.c_str(), &st) != 0)
38  return false;
39 
40  if (size)
41  *size = st.st_size;
42 
43  return true;
44  }
list path
Definition: scaleCards.py:51
tuple size
Write out results.
virtual Storage* LocalStorageMaker::open ( const std::string &  proto,
const std::string &  path,
int  mode 
)
inlinevirtual

Implements StorageMaker.

Definition at line 14 of file LocalStorageMaker.cc.

References StorageFactory::CACHE_HINT_STORAGE, StorageFactory::cacheHint(), f, mergeVDriftHistosByStation::file, reco_application_tbsim_DetSim-Digi_cfg::File, StorageFactory::get(), IOFlags::OpenUnbuffered, StorageFactory::READ_HINT_UNBUFFERED, StorageFactory::readHint(), and StorageFactory::wrapNonLocalFile().

17  {
19  StorageFactory::ReadHint readHint = f->readHint();
20  StorageFactory::CacheHint cacheHint = f->cacheHint();
21 
23  || cacheHint == StorageFactory::CACHE_HINT_STORAGE)
24  mode &= ~IOFlags::OpenUnbuffered;
25  else
27 
28  File *file = new File (path, mode);
29  return f->wrapNonLocalFile (file, proto, path, mode);
30  }
CacheHint cacheHint(void) const
Storage * wrapNonLocalFile(Storage *s, const std::string &proto, const std::string &path, int mode)
static StorageFactory * get(void)
list path
Definition: scaleCards.py:51
double f[11][100]
ReadHint readHint(void) const
Definition: File.h:11