Go to the documentation of this file.00001 #include "Utilities/StorageFactory/interface/StorageMaker.h"
00002 #include "Utilities/StorageFactory/interface/StorageMakerFactory.h"
00003 #include "Utilities/StorageFactory/interface/StorageFactory.h"
00004 #include "Utilities/LStoreAdaptor/interface/LStoreFile.h"
00005 #include "FWCore/Utilities/interface/Exception.h"
00006 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00007 #include <unistd.h>
00008 #include <iostream>
00009
00010 class LStoreStorageMaker : public StorageMaker
00011 {
00012 public:
00015 virtual Storage *open (const std::string &proto,
00016 const std::string &path,
00017 int mode)
00018 {
00019 std::string fullpath = proto + ":" + path;
00020 return new LStoreFile (fullpath, mode);
00021 }
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 virtual bool check (const std::string &proto,
00038 const std::string &path,
00039 IOOffset *size = 0)
00040 {
00041 std::string fullpath = proto + ":" + path;
00042 try {
00043 LStoreFile fileObj( fullpath );
00044 *size = fileObj.position( 0, Storage::END );
00045 } catch ( cms::Exception & e) {
00046 return false;
00047 }
00048 return true;
00049 }
00050
00051 };
00052 DEFINE_EDM_PLUGIN (StorageMakerFactory, LStoreStorageMaker, "lstore");