CMS 3D CMS Logo

LocalStorageMaker Class Reference

Inheritance diagram for LocalStorageMaker:

StorageMaker

List of all members.

Public Member Functions

virtual bool check (const std::string &proto, const std::string &path, IOOffset *size=0)
virtual Storageopen (const std::string &proto, const std::string &path, int mode, const std::string &tmpdir)


Detailed Description

Definition at line 8 of file LocalStorageMaker.cc.


Member Function Documentation

virtual bool LocalStorageMaker::check ( const std::string &  proto,
const std::string &  path,
IOOffset size = 0 
) [inline, virtual]

Reimplemented from StorageMaker.

Definition at line 29 of file LocalStorageMaker.cc.

References size.

00032   {
00033     struct stat st;
00034     if (stat (path.c_str(), &st) != 0)
00035       return false;
00036 
00037     if (size)
00038       *size = st.st_size;
00039 
00040     return true;
00041   }

virtual Storage* LocalStorageMaker::open ( const std::string &  proto,
const std::string &  path,
int  mode,
const std::string &  tmpdir 
) [inline, virtual]

Implements StorageMaker.

Definition at line 11 of file LocalStorageMaker.cc.

References StorageFactory::CACHE_HINT_STORAGE, StorageFactory::cacheHint(), f, StorageFactory::get(), IOFlags::OpenUnbuffered, StorageFactory::READ_HINT_UNBUFFERED, and StorageFactory::readHint().

00015   {
00016     StorageFactory *f = StorageFactory::get();
00017     StorageFactory::ReadHint readHint = f->readHint();
00018     StorageFactory::CacheHint cacheHint = f->cacheHint();
00019 
00020     if (readHint != StorageFactory::READ_HINT_UNBUFFERED
00021         || cacheHint == StorageFactory::CACHE_HINT_STORAGE)
00022       mode &= ~IOFlags::OpenUnbuffered;
00023     else
00024       mode |= IOFlags::OpenUnbuffered;
00025 
00026     return new File (path, mode); 
00027   }


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:27:55 2009 for CMSSW by  doxygen 1.5.4