CMS 3D CMS Logo

StorageMaker Class Reference

#include <Utilities/StorageFactory/interface/StorageMaker.h>

Inheritance diagram for StorageMaker:

DCacheStorageMaker GsiFTPStorageMaker HttpStorageMaker LocalStorageMaker RFIOStorageMaker StormLcgGtStorageMaker StormStorageMaker XrdStorageMaker

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)=0
virtual void stagein (const std::string &proto, const std::string &path)
virtual ~StorageMaker (void)


Detailed Description

Definition at line 8 of file StorageMaker.h.


Constructor & Destructor Documentation

StorageMaker::~StorageMaker ( void   )  [virtual]

Definition at line 7 of file StorageMaker.cc.

00008 {}


Member Function Documentation

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

Reimplemented in DCacheStorageMaker, RFIOStorageMaker, LocalStorageMaker, StormLcgGtStorageMaker, StormStorageMaker, and XrdStorageMaker.

Definition at line 16 of file StorageMaker.cc.

References mode, open(), IOFlags::OpenRead, IOFlags::OpenUnbuffered, and s.

00019 {
00020   // Fallback method is to open the file and check its
00021   // size.  Because grid jobs run in a directory where
00022   // there is usually more space than in /tmp, and that
00023   // directory is automatically cleaned up, open up the
00024   // temporary files in the current directory.  If the
00025   // file is downloaded, it will delete itself in the
00026   // destructor or close method.
00027   bool found = false;
00028   int mode = IOFlags::OpenRead | IOFlags::OpenUnbuffered;
00029   if (Storage *s = open (proto, path, mode, "."))
00030   {
00031     if (size)
00032       *size = s->size ();
00033 
00034     s->close ();
00035     delete s;
00036 
00037     found = true;
00038   }
00039 
00040   return found;
00041 }

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

Implemented in DCacheStorageMaker, RFIOStorageMaker, GsiFTPStorageMaker, HttpStorageMaker, LocalStorageMaker, StormLcgGtStorageMaker, StormStorageMaker, and XrdStorageMaker.

Referenced by check().

void StorageMaker::stagein ( const std::string &  proto,
const std::string &  path 
) [virtual]

Reimplemented in DCacheStorageMaker, and RFIOStorageMaker.

Definition at line 11 of file StorageMaker.cc.

00013 {}


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:32:51 2009 for CMSSW by  doxygen 1.5.4