CMS 3D CMS Logo

XrdFile.h
Go to the documentation of this file.
1 #ifndef Utilities_XrdAdaptor_XrdFile_h
2 #define Utilities_XrdAdaptor_XrdFile_h
3 
8 #include "XrdCl/XrdClFile.hh"
9 #include <string>
10 #include <memory>
11 #include <atomic>
12 
13 namespace XrdAdaptor {
14  class RequestManager;
15 }
16 
17 class XrdFile : public Storage {
18 public:
19  XrdFile(void);
20  XrdFile(IOFD fd);
21  XrdFile(const char *name, int flags = IOFlags::OpenRead, int perms = 0666);
22  XrdFile(const std::string &name, int flags = IOFlags::OpenRead, int perms = 0666);
23  ~XrdFile(void) override;
24 
25  virtual void create(const char *name, bool exclusive = false, int perms = 0666);
26  virtual void create(const std::string &name, bool exclusive = false, int perms = 0666);
27  virtual void open(const char *name, int flags = IOFlags::OpenRead, int perms = 0666);
28  virtual void open(const std::string &name, int flags = IOFlags::OpenRead, int perms = 0666);
29 
30  using Storage::position;
31  using Storage::read;
32  using Storage::readv;
33  using Storage::write;
34 
35  bool prefetch(const IOPosBuffer *what, IOSize n) override;
36  IOSize read(void *into, IOSize n) override;
37  IOSize read(void *into, IOSize n, IOOffset pos) override;
38  IOSize readv(IOBuffer *into, IOSize n) override;
39  IOSize readv(IOPosBuffer *into, IOSize n) override;
40  IOSize write(const void *from, IOSize n) override;
41  IOSize write(const void *from, IOSize n, IOOffset pos) override;
42 
43  IOOffset position(IOOffset offset, Relative whence = SET) override;
44  void resize(IOOffset size) override;
45 
46  void close(void) override;
47  virtual void abort(void);
48 
49 private:
51 
56  std::shared_ptr<XrdCl::File> getActiveFile();
57 
61  bool m_close;
63  std::atomic<unsigned int> m_op_count;
64 };
65 
66 #endif // XRD_ADAPTOR_XRD_FILE_H
Storage::size
virtual IOOffset size(void) const
Definition: Storage.cc:77
XrdFile::m_offset
IOOffset m_offset
Definition: XrdFile.h:59
XrdFile::addConnection
void addConnection(cms::Exception &)
Definition: XrdFile.cc:517
XrdFile::close
void close(void) override
Definition: XrdFile.cc:153
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
XrdFile::getActiveFile
std::shared_ptr< XrdCl::File > getActiveFile()
Definition: XrdFile.cc:505
propagate_const.h
XrdFile::m_requestmanager
edm::propagate_const< std::shared_ptr< XrdAdaptor::RequestManager > > m_requestmanager
Definition: XrdFile.h:58
pos
Definition: PixelAliasList.h:18
XrdFile::readv
IOSize readv(IOBuffer *into, IOSize n) override
Definition: XrdFile.cc:254
XrdFile::create
virtual void create(const char *name, bool exclusive=false, int perms=0666)
Definition: XrdFile.cc:40
Storage::SET
Definition: Storage.h:22
Storage::Relative
Relative
Definition: Storage.h:22
XrdFile::~XrdFile
~XrdFile(void) override
Definition: XrdFile.cc:34
XrdFile
Definition: XrdFile.h:17
XrdFile::open
virtual void open(const char *name, int flags=IOFlags::OpenRead, int perms=0666)
Definition: XrdFile.cc:56
Storage.h
Storage::readv
virtual IOSize readv(IOPosBuffer *into, IOSize buffers)
Definition: Storage.cc:24
ztee.fd
fd
Definition: ztee.py:136
edm::propagate_const
Definition: propagate_const.h:32
IOFlags.h
IOFlags::OpenRead
Definition: IOFlags.h:7
XrdFile::abort
virtual void abort(void)
Definition: XrdFile.cc:168
XrdFile::XrdFile
XrdFile(void)
Definition: XrdFile.cc:22
XrdFile::resize
void resize(IOOffset size) override
Definition: XrdFile.cc:497
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
IOBuffer
Definition: IOBuffer.h:7
IOOffset
int64_t IOOffset
Definition: IOTypes.h:19
IOFD
int IOFD
Definition: IOTypes.h:22
XrdFile::m_size
IOOffset m_size
Definition: XrdFile.h:60
XrdFile::m_name
std::string m_name
Definition: XrdFile.h:62
generator_cfi.exclusive
exclusive
Definition: generator_cfi.py:24
Storage::position
virtual IOOffset position(void) const
Definition: Storage.cc:72
IOInput::read
int read(void)
Definition: IOInput.cc:52
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
Exception.h
XrdFile::prefetch
bool prefetch(const IOPosBuffer *what, IOSize n) override
Definition: XrdFile.cc:448
XrdFile::m_op_count
std::atomic< unsigned int > m_op_count
Definition: XrdFile.h:63
IOPosBuffer
Definition: IOPosBuffer.h:7
cms::Exception
Definition: Exception.h:70
XrdFile::write
IOSize write(const void *from, IOSize n) override
Definition: XrdFile.cc:395
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
IOSize
size_t IOSize
Definition: IOTypes.h:14
Storage
Definition: Storage.h:20
HLT_2018_cff.flags
flags
Definition: HLT_2018_cff.py:11758
XrdAdaptor
Definition: QualityMetric.h:15
XrdFile::m_close
bool m_close
Definition: XrdFile.h:61
Storage::write
virtual IOSize write(const void *from, IOSize n, IOOffset pos)
Definition: Storage.cc:44